Run two php applications in two different ports in apache

I have two sample applications on the same machine. this is php. I need to develop an application that supports cross-domain cookies. so now I'm trying to run two applications on a different port on the apache server. so for this I changed the port number in httpd.conf. as I added Listen 8080 and I do not understand about

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 

Please let me know how to add this for my second port 8080. I launch my application from a browser as xxx.xx.x.xx / First / Cookies. I tried as xxx.xx.x.xx: 80 / First / Cookies. how can i try this for 8080 for my second application. Please guide me.

+4
source share
2 answers

This should be the minimum you need. Add other useful directives as you like.

 Listen 80 <VirtualHost *:80> DocumentRoot /home/x/z/ ... the usual stuff ... </VirtualHost> Listen 20117 <VirtualHost *:20117> DocumentRoot /home/x/y/public_html </VirtualHost> 
+5
source
 <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 

also add this line to the httpd.conf file

Listen 8080

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

also add this

0
source

Source: https://habr.com/ru/post/1389038/


All Articles