使用LNMP域名绑定详解

Linux系统下,一键搭建nginx+php+mysql+phpmyadmin常用网站环境一般使用的是军哥的LNMP一键安装(Linux lnmp一键安装包相关使用教程),在安装好之后就是域名的绑定啦!其实所谓的域名绑定,就是通过命令的形式,简易创建一个conf文件到/usr/local/nginx/conf/vhost下面,这个过程完全可以手工创建conf,或者,平时修改目录、域名等,直接修改conf文件,效果完全一样:

/root/vhost.sh #lnmp域名绑定命令
=========================================================================
Add Virtual Host for LNMP V0.9  ,  Written by Licess
=========================================================================
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):laogeng.net #输入你要绑定的域名,laogeng.net和www.laogeng.net要分别绑定
===========================
domain=laogeng.net
===========================
Do you want to add more domain name? (y/n)
y #是否添加子域名,可以输入y或n,这里输入y
Type domainname,example(bbs.laogeng.net forums.laogeng.net luntan.laogeng.net):
www.laogeng.net #输入你要绑定的其它域名,支持泛解析,例如:*.laogeng.net
===========================
domain list=www.laogeng.net
===========================
Please input the directory for the domain:laogeng.net :
(Default directory: /home/wwwroot/laogeng.net):/home/laogeng.net #网站存放目录,可默认或自行输入
===========================
Virtual Host Directory=/home/laogeng.net
===========================
===========================
Allow Rewrite rule? (y/n)
===========================
y #是否添加伪静态规则,这里输入是
Please input the rewrite of programme :
wordpress,discuz,typecho,sablog,dabr rewrite was exist.
(Default rewrite: other):wordpress #输入wordpress就可以
===========================
You choose rewrite=wordpress
===========================
===========================
Allow access_log? (y/n)
===========================
n #是否创建日志文件,如果不需要可不用
Press any key to start create virtul host...
#按任意建继续,以下为一些相关信息,包括创建目录,测试nginx等,如果有错误提示,请一定要认真分析
Create Virtul Host directory......
set permissions of Virtual Host directory......
You select the exist rewrite rule:/usr/local/nginx/conf/wordpress.conf
Test Nginx configure file......
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
Restart Nginx......
=========================================================================
Add Virtual Host for LNMP V0.9  ,  Written by Licess
=========================================================================
For more information please visit http://www.lnmp.org/
Your domain:laogeng.net
Directory of laogeng.net:/home/laogeng.net
=========================================================================

还没回应

发表评论

电子邮件地址不会被公开。 必填项已用*标注