Apache虚拟主机sites-enabled配置笔记

1. vi + /etc/httpd/conf/httpd.conf

在NameVirtualHost 192.168.10.195:80后添加如下行:(如下图)

Include /etc/httpd/conf/sites-enabled/

clip_image002

2. 创建相关目录

cd /etc/httpd/conf/

mkdir sites-available

mkdir sites-enabled

3. 创建虚拟目录配置文件*.vhost(*代表要配置的域名)

[root@master conf]# cd sites-available/

[root@master sites-available]# cat test.com.vhost

<VirtualHost 192.168.10.195:80>

ServerAdmin [email protected]

DocumentRoot /qubaoquan/

ServerName qubaoquan.test.com

ErrorLog logs/error_log

CustomLog logs/access_log common

</VirtualHost>

4. 创建符号链接

[root@master conf]# cd sites-enabled/

ln -s ../sites-available/test.com.vhost .

ln -sf ./test.com.vhost ../sites-enabled/test.com.vhost

5. 重新启动服务

你可能感兴趣的:(apache,职场,笔记,虚拟主机,休闲)