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
 #<Directory />
 #    AllowOverride none
 #    Require all denied
 #</Directory>

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

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

 

<VirtualHost *:8888>
    ServerName localhost
    DocumentRoot "/var/www/Phraseanet/www"
   <Directory "/var/www/Phraseanet/www">
        DirectoryIndex index.php
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
   </Directory>     
 </VirtualHost>

二、配置二级、三级域名

【1】二级

<VirtualHost *:80>
   ServerName test.baidu.com  
   DocumentRoot "/var/www/test"
   <Directory "/var/www/test">
       DirectoryIndex index.php
       Options FollowSymLinks Includes ExecCGI
       AllowOverride All
       Order allow,deny
       Allow from all
   </Directory>
</VirtualHost>

【2】三级

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

【3】设置basic认证 - htpasswd

<VirtualHost *:80>
   ServerName auth3.baidu.com
   DocumentRoot "/var/www/hacfin_auth"
   <Directory "/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
   </Directory>
</VirtualHost>

 

郎涯工作室 CSDN认证博客专家 Java PHP 视音频
微信搜索:【郎涯工作室】关注我。
卖码为生,有代码洁癖。不爱广度,爱深度 — 专注分享Java / PHP / C++ / 视音频领域等技术。
想和你一起,每天进步一点点,做一个不凡的人!
已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页