簡體   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