最新apache多域名多站點配置
阿新 • • 發佈:2017-06-14
設置 list director option file rtu directory virt host
httpd.conf===>
Listen 80 Listen 9001 ServerName 123.123.123.123:80 用IP地址作為servername LoadModule rewrite_module modules/mod_rewrite.so Include conf/extra/httpd-vhosts.conf <FilesMatch "\.ph(p[2-6]?|tml)$"> SetHandler application/x-httpd-php </FilesMatch>
httpd-vhost.conf===>
# Virtual Hosts <VirtualHost *:80> ServerName www.abc2.com ServerAlias abc2.com tianpin.bj.12543534.clb.myqcloud.com DocumentRoot "/var/www/html" <Directory "/var/www/html"> Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require all granted </Directory> </VirtualHost> #<VirtualHost *:80> #設置主機名 ServerName www.abc.com #設置主機別名,即用該別名也可以訪問(前提是域名解析正確) #ServerAlias abc.com DocumentRoot "/var/www/pttabc" <Directory "/var/www/pttabc"> #加上Indexes用於顯示設定“可顯示文件列表”(當無可顯示網頁的時候) Options FollowSymLinks #啟用文件夾訪問控制的文件.htaccess設置 AllowOverride All #請求控制 Require all granted</Directory> </VirtualHost>
最新apache多域名多站點配置