域名绑定详解
2015-01-12 11:18
106 查看
其实所谓的域名绑定,就是通过命令的形式,简易创建一个conf文件到/usr/local/nginx/conf/vhost下面,这个过程完全可以手工创建conf,或者,平时修改目录、域名等,直接修改conf文件,效果完全一样:
注:绿色文字为注释,实际使用过程中没有。
/root/vhost.sh
#lnmp域名绑定命令
=========================================================================
Add Virtual Host
for
LNMP V0.9 , WrittenbyLicess
=========================================================================
LNMP is a tool to auto-compile &
install
Nginx+MySQL+PHP onLinux
This script is a tool to add virtual host
for
nginx
For
more
informationplease visit http://www.lnmp.org/
=========================================================================
Please input domain:
(Default domain: www.lnmp.org):legcloud.com
#输入你要绑定的域名,legcould和www.legcloud要分别绑定
===========================
domain=legcloud.com
===========================
Do you want to add
more
domainname? (y/n)
y
#是否添加子域名,可以输入y或n,这里输入y
Type domainname,example(bbs.vpser.net forums.vpser.net luntan.vpser.net):
www.legcloud.com
#输入你要绑定的其它域名,支持泛解析,例如:*.legcloud.com
===========================
domainlist=www.legcloud.com
===========================
Please input the directory
for
the domain:legcloud.com :
(Default directory: /home/wwwroot/legcloud.com):/home/legcloud.com
#网站存放目录,可默认或自行输入
===========================
Virtual Host Directory=/home/legcloud.com
===========================
===========================
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就可以
===========================
Youchoose rewrite=wordpress
===========================
===========================
Allow access_log? (y/n)
===========================
n
#是否创建日志文件,如果不需要可不用
Press anykeyto 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.confsyntax is ok
nginx: configuration
file
/usr/
local
/nginx/conf/nginx.conf
test
is successful
Restart Nginx......
=========================================================================
Add Virtual Host
for
LNMP V0.9 , WrittenbyLicess
=========================================================================
For
more
informationplease visit http://www.lnmp.org/
Your domain:legcloud.com
Directoryof legcloud.com:/home/legcloud.com
=========================================================================
注:绿色文字为注释,实际使用过程中没有。
相关文章推荐
- Apache绑定域名详解
- tomcat的配置详解:[1]tomcat绑定域名
- Tomcat6配置详解(虚拟目录+多域名绑定)
- 详解Tomcat服务器绑定多域名和虚拟目录的方法
- Apache 2配置域名绑定的方法详解
- 微信公众号的绑定域名详解
- 详解Tomcat Web 应用绑定域名的几种方式
- 方维o2o系统域名绑定破解详解
- 微信小程序 后台https域名绑定和免费的https证书申请详解
- 微信小程序 后台https域名绑定和免费的https证书申请详解
- 详解nginx服务器绑定域名和设置根目录的方法
- 方维o2o系统域名绑定破解详解
- 详解nginx反向代理+SwitchHost+Tomcat绑定域名配置总结
- 国外虚拟主机域名绑定方法,及Addon Domain/Subdomains/Parked domain详解
- SAE新浪云如何绑定独立域名详解
- 阿里云域名注册详解与Github绑定
- 服务器绑定域名详解
- 实习Apache绑定多个域名
- 关于如何在apache上绑定多域名的问题
- GMAIL绑定自己的域名MX解析出现错误