apphe httpdは複数のポートを配置します。

2080 ワード

appheは複数のhttpポートを配置しています。
方法1:httpd-vhostsを使う
  • は、apacheの構成ディレクトリに入ります。たとえば/usr/local/apache/conf/
  • httpd.com nf
  • を開きます。
  • は複数の傍受ウィンドウを構成し、81,82
    ServerName localhost:81  
    # Listen 80
    Listen 81  
    Listen 82 
    
  • .菗Include conf/extra/http-vhosts.comを見つけて、葒号を外して、注釈を解除します。
  • は/usr/local/apache/conf/extraディレクトリに入り、httpd-vhosts.com nfファイル
  • を開く。
  • 構成NameVirtual Host*:81
    
        ServerAdmin host1.example.com
        DocumentRoot "/home/public/web/host1"
        ServerName localhost:81
        ServerAlias localhost:81
        ErrorLog "logs/host1.example.com-error_log"
       #CustomLog "logs/host1.example.com-access_log common"
    
        
    
        ServerAdmin host2.example.com
        DocumentRoot "/home/public/web/host2"
        ServerName localhost:82
        ErrorLog "logs/host1.example.com-error_log"
       #CustomLog "logs/host1.example.com-access_log common"
     
    
  • 方法二:httpd.com nfだけを修正する。
  • は、apacheの構成ディレクトリに入ります。たとえば/usr/local/apache/conf/
  • httpd.com nf
  • を開きます。
  • は複数の傍受ウィンドウを構成し、81,82
    Listen   81
    Listen   82
    
  • そしてファイルの最後に追加します。
    
    DocumentRoot /home/public/web/host1
    ServerName localhost:81
    
    
    
     Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    
    
    
    DocumentRoot /home/public/web/host2
    ServerName localhost:82
    
    
    
     Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    
    
  • apache別バージョンのディレクトリ権限設定
  • oldは
  • を使用します。
    Order allow,deny
    Allow from all
    
  • newは
  • を使用します。
    Require all granted
    
  • new example
  • #add for WWW
    Listen 91
    
    DocumentRoot  "D:/IDE/WWW"
    ServerName localhost:91
    
    
    
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted