Linux-CentOS XAMPP Apache配置多端口

一、使用IP+8888端口访问  /var/www/Phraseanet/www/  目录下的index.php文件

【1】修改httpd.conf文件
 /opt/lampp/etc/httpd.conf

 

修改三个地方: 

Listen 8888
 Include etc/extra/httpd-vhosts.conf
 #
 #    AllowOverride none
 #    Require all denied
 #

【2】修改httpd-vhosts.conf文件

 /opt/lampp/etc/extra/httpd-vhosts.conf

 


    ServerName localhost
    DocumentRoot "/var/www/Phraseanet/www"
   
        DirectoryIndex index.php
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
        
 

二、配置二级、三级域名

【1】二级


   ServerName test.baidu.com  
   DocumentRoot "/var/www/test"
   
       DirectoryIndex index.php
       Options FollowSymLinks Includes ExecCGI
       AllowOverride All
       Order allow,deny
       Allow from all
   

【2】三级


   ServerName pm.baidu.com
   ServerAlias cloud.pm.baidu.com
   DocumentRoot "/var/www/pm_cloud"
   
       DirectoryIndex index.html
       Options FollowSymLinks Includes ExecCGI
       AllowOverride All
       Order allow,deny
       Allow from all
     

【3】设置basic认证 - htpasswd


   ServerName auth3.baidu.com
   DocumentRoot "/var/www/hacfin_auth"
   
       DirectoryIndex index.php
       Options FollowSymLinks Includes ExecCGI
       AllowOverride All
       Order allow,deny
       Allow from all

       AuthUserFile /var/www/hacfin_auth/.htpasswd
       AuthType Basic
       AuthName "restricted"
       Require valid-user
   

 

你可能感兴趣的:(----9.4,Web,Server/Jenkins)