SVC
SVC

Reputation: 53

Run two php application in two different ports in apache

i have two sample application in the same machine. it is PHP. i am in need to develope application that supports cross domain cookies. so ,now i am trying to run two application in different port in apache server. so for that i changed the port number in httpd.conf. like i added Listen 8080 and i am not getting about the

VirtualHost *:80  
ServerAdmin [email protected]  
 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 that for my second port 8080. i run my application from the browser as xxx.xx.x.xx/First/Cookies. i tried as xxx.xx.x.xx:80/First/Cookies.----this is fine, how can i try it for 8080 for my second application. Please guide me.

Upvotes: 5

Views: 5571

Answers (2)

James
James

Reputation: 3275

This should be the bare minimum you need. Add other useful directives at will.

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

Listen 20117
<VirtualHost *:20117>
        DocumentRoot /home/x/y/public_html
</VirtualHost>

Upvotes: 5

maxjackie
maxjackie

Reputation: 23282

<VirtualHost SERVERNAME:8080>
ServerAdmin [email protected]
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 in httpd.conf file

Listen 8080

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

also add this

Upvotes: 0

Related Questions