• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

lnmp使用实例

mysql 搞代码 4年前 (2022-01-09) 17次浏览 已收录 0个评论

更新系统 #yum check-update#yum update 安装Screen #yum install screen 开始安装lnmp: #screen -S lnmp#wget -c http://soft.vpser.net/lnmp/lnmp0.8.tar.gz //最新版请查阅lnmp官网#tar zxvf lnmp0.8.tar.gz#./lnmp0.8/centos.sh | tee lnmp.log //输出lo

更新系统

#yum check-update#yum update

安装Screen

#yum install screen

开始安装lnmp:

#screen -S lnmp#wget -c http://soft.vpser.net/lnmp/lnmp0.8.tar.gz //最新版请查阅lnmp官网#tar zxvf lnmp0.8.tar.gz#./lnmp0.8/centos.sh | tee lnmp.log //输出log文件,以备出错时查阅

接下来按照提示设定域名和mysql密码,程序会自动下载相关程序,而后编译安装之

安装PureFTP:

#./lnmp0.8/pureftp.sh

按提示输入mysql和ftp管理员密码,安装完成后可以通过http://vpsip/ftp/来登录管理ftp帐号

使用LNMP

添加虚拟主机:

#/root/vhost.sh

按照提示填入域名、目录、rewrite规则文件,如下所示:

root@buyvm256:~#/root/vhost.sh=========================================================================Add Virtual Host for LNMP V0.9  ,  Written by Licess ======<div>本文来源gaodai.ma#com搞##代!^码7网</div>===================================================================LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux This script is a tool to add virtual host for nginx For more information please visit http://www.lnmp.org/=========================================================================Please input domain:  //添加域名(Default domain: www.lnmp.org):xxx.com===========================domain=xxx.com===========================Do you want to add more domain name? (y/n)  //添加更多域名yType domainname,example(bbs.vpser.net forums.vpser.net luntan.vpser.net):www.xxx.com===========================domain list=www.xxx.com===========================Please input the directory for the domain:xxx.com :  //网站目录(Default directory: /home/wwwroot/xxx.com):===========================Virtual Host Directory=/home/wwwroot/xxx.com======================================================Allow Rewrite rule? (y/n)  //重写规则===========================yPlease input the rewrite of programme :wordpress,discuz,typecho,sablog,dabr rewrite was exist.(Default rewrite: other):wordpress  //选择重写规则===========================You choose rewrite=wordpress======================================================Allow access_log? (y/n)  //是否记录log===========================nPress any key to start create virtul host...

然后,登录 http://vpsip/ftp添加ftp帐号,http://vpsip/phpmyadmin/增加数据库

注意:开通ftp时,记着添加到www用户组

修改虚拟主机配置

创建好的虚拟主机,配置文件目录为/wp-content/local/nginx/conf/vhost/,文件名为domain.conf,如下所示:

aquan@buyvm256:~$ cat /usr/local/nginx/conf/vhost/xxx.com.conf server        {                listen       80;   //端口                server_name xxx.com www.xxx.com;   //域名                index index.html index.htm index.php default.html default.htm default.php;  //索引文件                root  /home/wwwroot/xxx.com;   //目录                include wordpress.conf;                location ~ .*\.(php|php5)?$                        {                                try_files $uri =404;                                fastcgi_pass  unix:/tmp/php-cgi.sock;                                fastcgi_index index.php;                                include fcgi.conf;                        }                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$                        {                                expires      30d;                        }                location ~ .*\.(js|css)?$                        {                                expires      12h;                        }                access_log off;        }

主机配置文件修改后,使用如下命令重新加载配置使之生效

#/etc/init.d/nginx reload

删除虚拟主机

删除/wp-content/local/nginx/conf/vhost/下对应配置文件(.conf),再删除/home/wwwroot/下的本地目录

一些其他问题

设置虚拟主机目录权限

#chown -R www /home/wwwroot/vps.aotee.com#chmod -R 777 /home/wwwroot/vps.aotee.com

搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:lnmp使用实例

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址