MAC+XMAPPでの仮想ホストの構成

2252 ワード

MAC+XMAPPでの仮想ホストの構成
ラベル(スペース区切り):PHP
PC下でのPHP開発環境の設定
PCの下でPHP開発環境の参考文書を配置する
XMAPPでの仮想ホストの構成
  • 1./etc/hostsを開くと、以下の
  • のホストアドレスが追加されます.
    127.0.0.1   localhost
    255.255.255.255 broadcasthost
    ::1             localhost 
    
    //        
    127.0.0.1   www.39.com
    
  • 2.httpdを修正する.confファイル、ディレクトリは/Applications/XAMPP/xamppfiles/etc/httpd.confです.検索httpd-vhosts.conf最前面の#をキャンセルし、vhosts仮想ホストプロファイル
  • が導入されていることを確認します.
  • 3.またhttpd.confの一番後ろにコード
  • を追加します.
    
            #Options Indexes FollowSymLinks ExecCGI Includes #don't permission see list
            Options All
            AllowOverride All
            Order allow,deny
            Allow from all
    
    

    説明:「Options All」はディレクトリの閲覧を許可し、セキュリティリスクがあり、個人デバッガに適しており、サイトのルートディレクトリにindexが含まれている場合に注意してください.htmlページの場合、ディレクトリリストではなくWebページがデフォルトで開くため、indexを削除する必要があります.html. 「Options Indexes FollowSymLinks ExecCGI Includes」は、ディレクトリブラウズが許可されておらず、公式サイトに適しています
  • ファイルを開くconfファイル、ディレクトリは/Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf
  • 
        ServerAdmin [email protected]
        DocumentRoot "/Applications/XAMPP/xamppfiles/docs/dummy-host.example.com"
        ServerName dummy-host.example.com
        ServerAlias www.dummy-host.example.com
        ErrorLog "logs/dummy-host.example.com-error_log"
        CustomLog "logs/dummy-host.example.com-access_log" common
    
    
    
        ServerAdmin [email protected]
        DocumentRoot "/Applications/XAMPP/xamppfiles/docs/dummy-host2.example.com"
        ServerName dummy-host2.example.com
        ErrorLog "logs/dummy-host2.example.com-error_log"
        CustomLog "logs/dummy-host2.example.com-access_log" common
    
    
    
        ServerAdmin [email protected]
        DocumentRoot "/Users/yuanjunliang/Documents/www/www.39.com"
        ServerName www.39.com
        ErrorLog "logs/dummy-host2.example.com-error_log"
        CustomLog "logs/dummy-host2.example.com-access_log" common
    
    

    編集後、ブラウザにwww.39.comと入力すると、構成されたWebサイトが表示されます.