当前位置:   article > 正文

CentOS7 yum安装Apache Httpd配置虚拟主机_centos7 yum install htttpd namevirtualhost

centos7 yum install htttpd namevirtualhost

软件环境

系统:CentOS7

Apache Httpd版本:2.4.6-89.el7.centos.1

Apache Httpd安装方式:yum安装

 

1. 复制虚拟主机配置文件

cp /usr/share/doc/httpd-2.4.6/httpd-vhosts.conf /etc/httpd/conf.d/

2. 编辑虚拟主机配置文件

vi /etc/httpd/conf.d/httpd-vhosts.conf

加入以下代码并把其余的注释掉:

  1. <VirtualHost *:80>
  2. ServerAdmin support@jfedu.net
  3. DocumentRoot "/var/www/html/jf1"
  4. ServerName www.jf1.com
  5. ServerAlias www.dummy-host.example.com
  6. ErrorLog "logs/www.jf1.com_error_log"
  7. CustomLog "logs/www.jf1.com_access_log" common
  8. </VirtualHost>
  9. <VirtualHost *:80>
  10. ServerAdmin support@jfedu.net
  11. DocumentRoot "/var/www/html/jf2"
  12. ServerName www.jf2.com
  13. ServerAlias www.dummy-host.example.com
  14. ErrorLog "logs/www.jf2.com_error_log"
  15. CustomLog
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/669107
推荐阅读
相关标签
  

闽ICP备14008679号