首页 > 代码库 > 最新apache多域名多站点配置

最新apache多域名多站点配置

httpd.conf===>

Listen 80Listen 9001ServerName 123.123.123.123:80 用IP地址作为servernameLoadModule rewrite_module modules/mod_rewrite.soInclude 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.comServerAlias abc2.com tianpin.bj.12543534.clb.myqcloud.comDocumentRoot "/var/www/html"<Directory "/var/www/html">Options +Indexes +Includes +FollowSymLinks +MultiViewsAllowOverride AllRequire all granted</Directory></VirtualHost>#<VirtualHost *:80>#设置主机名ServerName www.abc.com#设置主机别名,即用该别名也可以访问(前提是域名解析正确)#ServerAlias abc.comDocumentRoot "/var/www/pttabc"<Directory "/var/www/pttabc">#加上Indexes用于显示设定“可显示文件列表”(当无可显示网页的时候)Options FollowSymLinks#启用文件夹访问控制的文件.htaccess设置AllowOverride All#请求控制Require all granted</Directory></VirtualHost>

 

最新apache多域名多站点配置