繁体   English   中英

在apache的两个不同端口运行两个php应用程序

[英]Run two php application in two different ports in apache

我在同一台机器上有两个示例应用程序。 它是PHP。 我需要开发支持跨域cookie的应用程序。 所以,现在我想在apache服务器的不同端口运行两个应用程序。 所以我改变了httpd.conf中的端口号。 就像我添加了Listen 8080并且我没有得到关于

VirtualHost *:80  
ServerAdmin webmaster@dummy-host.example.com  
 DocumentRoot /www/docs/dummy-host.example.com      
ServerName dummy-host.example.com   
ErrorLog logs/dummy-host.example.com-error_log  
CustomLog logs/dummy-host.example.com-access_log common

请让我知道如何为我的第二个端口8080添加它。我从浏览器运行我的应用程序xxx.xx.x.xx / First / Cookies。 我尝试了xxx.xx.x.xx:80 / First / Cookies。这很好,我怎么能为我的第二个应用程序尝试8080。 请指导我。

这应该是你需要的最低限度。 随意添加其他有用的指令。

Listen 80
<VirtualHost *:80>
        DocumentRoot /home/x/z/
        ... the usual stuff ...
</VirtualHost>

Listen 20117
<VirtualHost *:20117>
        DocumentRoot /home/x/y/public_html
</VirtualHost>
<VirtualHost SERVERNAME:8080>
ServerAdmin webmaster@another-host.example.com
ServerName SERVERNAME:8080
DocumentRoot "/www/docs/another-host.example.com"
ErrorLog logs/another-host.example.com-error_log  
CustomLog logs/another-host.example.com-access_log common

也在httpd.conf文件中添加此行

Listen 8080

<Directory "/www/docs/another-host">
Options All
AllowOverride All
Order allow,deny
Allow from all

还加上这个

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM