美文网首页我爱编程
apache配置virtualhost

apache配置virtualhost

作者: 任我笑笑 | 来源:发表于2018-04-13 16:26 被阅读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>
    
    

    相关文章

      网友评论

        本文标题:apache配置virtualhost

        本文链接:https://www.haomeiwen.com/subject/pmthkftx.html