zoukankan      html  css  js  c++  java
  • apache下设置域名多站点访问及禁止apache访问80端口

    apache下设置域名多站点访问

    当前系统:macOS High Sierra

    域名访问配置指定端口后,不同域名只能配置不同的端口

    apache配置目录:

    sudo vim /etc/apache2/httpd.conf
    sudo vim /etc/apache2/extra/httpd-vhosts.conf

    具体代码如下(/etc/apache2/extra/httpd-vhosts.conf):

    Listen 8001
    <VirtualHost *:8001>
        DocumentRoot "/Users/wanghaokun/dev/code/demo"
        ServerName localhost
        ErrorLog "/private/var/log/apache2/localhost-error_log"
        CustomLog "/private/var/log/apache2/localhost-access_log" common
        <Directory />
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order deny,allow
            Allow from all
            Require all granted
        </Directory>
    </VirtualHost>
    
    Listen 8002
    <VirtualHost *:8002>
        DocumentRoot "/Users/wanghaokun/dev/code/phalcon54/"
        ServerName www.testphalcon.com
        ErrorLog "/private/var/log/apache2/testphalcon-error_log"
        CustomLog "/private/var/log/apache2/testphalcon-access_log" common
        <Directory />
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order deny,allow
            Allow from all
            Require all granted
        </Directory>
    </VirtualHost>

    apache启动方式:

    sudo apachectl start
    sudo apachectl stop
    sudo apachectl restart

     

    禁止apache访问80端口

    在apache配置目录中查找80端口占用情况,修改或注释对应代码段即可

    相关文档:apache配置多域名

  • 相关阅读:
    着迷英语900句总结
    SQL Server 常见数据类型
    SQL Server视频总结
    第三次SLA文档学习
    Rosetton Stone Summary
    【周总结】2018-10-19—2018-11-25
    学生信息管理系统总结
    VB中 EOF 和 BOF 的区别
    VB中 On error 的用法
    VB中 . 与 ! 的区别
  • 原文地址:https://www.cnblogs.com/wanghaokun/p/10780675.html
Copyright © 2011-2022 走看看