apache配置virtualhost

httpd.conf

  1. 在80端口后增加Listen

Listen 80
Listen 8081

  1. 打开vhost.conf的注释

Include conf/extra/httpd-vhosts.conf

  1. 增加读写权限

注意这里事granted




    Options Indexes FollowSymLinks


    AllowOverride all


    Require all granted


httpd-vhost.conf

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


    ServerAdmin root@xxxxx
    DocumentRoot "/home/wxxxx"
    ServerName xxxx

    ErrorLog "/data/error_log/xxxx"
    CustomLog "/data/access_log/xxx" 


你可能感兴趣的:(apache配置virtualhost)