Apache 虚拟机简单配置
Apache 虚拟机简单配置
配置虚拟机主要是基于主机名的虚拟主机(一个IP地址,多个网站)。
配置方法:
1,修改httpd.conf文件,去掉#Include conf/extra/httpd-vhosts.conf前面的#,让httpd.conf包含httpd-vhosts.conf文件
2,修改httpd-vhosts.conf文件,添加虚拟机
<VirtualHost *:80> --监听的端口
DocumentRoot"/usr/local/apache/docs/dummy-host2.example.com"--目录路径
ServerNamedummy-host2.example.com域名
ErrorLog"logs/dummy-host2.example.com-error_log"日志
CustomLog"logs/dummy-host2.example.com-access_log"common
</VirtualHost>
<VirtualHost*:80>
DocumentRoot"/usr/local/apache/htdocs/vh01"
ServerNamec1.cj.com
</VirtualHost>
<VirtualHost*:80>
DocumentRoot"/usr/local/apache/htdocs/vh02"
ServerNamec2.cj.com
</VirtualHost>3,重启apache
相关推荐
星愿心愿 2020-11-24
ruancw 2020-11-10
VFCSDN 2020-10-14
somyjun 2020-09-29
longjing 2020-09-18
KINGJENSEN 2020-09-14
85251846 2020-09-14
周公周金桥 2020-09-06
lxttiger 2020-08-18
ARMOTO机器人 2020-08-18
atb 2020-08-17
SeetyST 2020-08-13
85206633 2020-08-15
yunna0 2020-08-15
young依然 2020-08-06
成长路上 2020-07-29
xiaogoua 2020-07-29
zhangsyi 2020-07-28