我爱编程

apache配置virtualhost

2018-04-13  本文已影响0人  任我笑笑

httpd.conf

  1. 在80端口后增加Listen

Listen 80
Listen 8081

  1. 打开vhost.conf的注释

Include conf/extra/httpd-vhosts.conf

  1. 增加读写权限

注意这里事granted


<Directory "/htdocs/xxx">

    Options Indexes FollowSymLinks


    AllowOverride all


    Require all granted
</Directory>

httpd-vhost.conf

除了DocumentRoot和端口号,可以根据需要写或者随便写

<VirtualHost *:8081>
    ServerAdmin root@xxxxx
    DocumentRoot "/home/wxxxx"
    ServerName xxxx

    ErrorLog "/data/error_log/xxxx"
    CustomLog "/data/access_log/xxx" 
</VirtualHost>

上一篇 下一篇

猜你喜欢

热点阅读