【消费电子实验室-2014/1/23】LINUX系统作为服务器平台,以安全稳定著称。但是,在LINUX系统下如何添加网站呢?今天,消费电子实验室就为小伙伴介绍一下具体方法,希望对您有所帮助。 以下配置的路径以标准环境路径为准,如果您另行安装,请根据实际安装路径配置。 1、cd /server/httpd/conf/vhosts/ 进入绑定域名所在目录, 2、vim test.conf 建立一个配置文件,test可以自己命名; 3、点击字母“i”开始编辑文件,输入内容: DocumentRoot /alidata/www/phpwind ServerName localhost ServerAlias localhost Options -Indexes FollowSymLinks AllowOverride all Order allow,deny Allow from all RewriteEngine On RewriteRule ^(.*)-htm-(.*)$ $1.php?$2 RewriteRule ^(.*)/simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2 ErrorLog "/alidata/log/httpd/phpwind-error.log" CustomLog "/alidata/log/httpd/access/phpwind.log" common 其中: 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、测试网站。请在浏览器中输入域名,测试设置。 |
网站介绍 广告业务 欢迎投稿 招聘信息 联系我们 友情链接 法律顾问 网站地图
CopyRight 2012消费电子实验室 版权所有 京ICP备12048044号-4号
电话:13701384402 邮编:100040 邮箱:BICQ6688@QQ.COM