Apache 服务绑定域名的方法
例如使用一键安装包配置的 Apache 环境,添加网站配置方法如下:
1、进入站点配置文件目录,命令如下:
cd /alidata/server/httpd/conf/vhosts/
2、创建一个新的配置文件,命令如下:
vi aa.conf
3、按键盘上的字母 “i”,开始编辑文件,将下面的内容复制过去。
Order allow,denyDeny from allDocumentRoot /alidata/www/testServerName www.test.comServerAlias test.comErrorLog “/alidata/log/httpd/test-error.log”CustomLog “/alidata/log/httpd/test.log”
注意:对应的日志名字也需要自己修改一下,可以区分网站的日志信息。
4、重启 Apache 测试,命令如下:
/alidata/server/httpd/bin/apachectl restart