欢迎来到山村网

如何添加网站for linux(绑定域名)

2019-03-09 09:03:10浏览:159 来源:山村网   
核心摘要:以下配置的路径以阿里云提供的标准环境路径为准,如果您另行安装,请根据实际安装路径配置。1.cd /alidata/server/httpd/conf/vh

以下配置的路径以阿里云提供的标准环境路径为准,如果您另行安装,请根据实际安装路径配置。

1.cd /alidata/server/httpd/conf/vhosts/ 进入绑定域名所在目录,2.vim test.conf 建立一个配置文件,test可以自己命名;3.点击字母“i”开始编辑文件,输入内容:<VirtualHost *:80> documentRoot /alidata/www/phpwind ServerName localhost ServerAlias localhost <Directory "/alidata/www/phpwind"> Options -Indexes FollowSymlinks AllowOverride all Order allow,deny Allow from all </Directory> <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.*)-htm-(.*)$ $1.php?$2 RewriteRule ^(.*)/simple/([a-z0-9_]+.html)$ $1/simple/index.php?$2 </IfModule> ErrorLog "/alidata/log/httpd/phpwind-error.log" CustomLog "/alidata/log/httpd/access/phpwind.log" common</VirtualHost>其中:ServerName www.test.com 绑定的网站域名ServerAlias test.com 绑定的网站别名(您如果有多个域名添加在这里)DirectoryIndex index.html index.php index.htm 设置默认首页documentRoot /alidata/www/test 和 Directory "/alidata/www/test" 都是指定网站的目录,需要一致。按“esc”退出编辑模式,输入“:wq”保存退出。4.输入命令:/alidata/server/httpd/bin/apachectl restart 重启apache测试。5.测试网站。请在浏览器中输入域名,测试设置。
(责任编辑:豆豆)
下一篇:

路由器ip与MAC地址可以不设置绑定吗

上一篇:

三款家用路由器 家用路由器哪个牌子比较好

  • 信息二维码

    手机看新闻

  • 分享到
打赏
免责声明
• 
本文仅代表作者个人观点,本站未对其内容进行核实,请读者仅做参考,如若文中涉及有违公德、触犯法律的内容,一经发现,立即删除,作者需自行承担相应责任。涉及到版权或其他问题,请及时联系我们 xfptx@outlook.com