Page 1 of 1

Setup virtual hosts for ports other than 80

PostPosted: 10. April 2012 17:51
by anoopvvv
how to set up virtual hosts for xampp linux in case of ports other than 80.Suppose i want to configure virtual hosts for port 5000.How can i do it.Iam using debian squeeze 6.04.
I have edited gedit /opt/lampp/etc/extra/httpd-vhosts.conf
NameVirtualHost *:5000
<VirtualHost *:5000>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /opt/lampp/htdocs
ServerName localhost
ServerAlias www.dummy-host.example.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

<VirtualHost *:5000>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot /opt/lampp/htdocs/joomla
ServerName sitename
ErrorLog logs/dummy-host2.example.com-error_log
CustomLog logs/dummy-host2.example.com-access_log common
</VirtualHost>
I have edited httpd.conf (gedit /opt/lampp/etc/httpd.conf)
Listen:5000

gedit /etc/hosts
127.0.0.1 localhost
127.0.0.1 sitename

But it is always redirecting to xampp home page

Re: Setup virtual hosts for ports other than 80

PostPosted: 27. April 2012 17:53
by JonB
Two things -

A. Your first vhost is ALWAYS - a duplicate of the original configuration. It serves to catch any misdirections

B. The next vhost should a DIFFERENT/NEW server root.

C. the redirect occurs because unless you modify/remove index.php from /opt/lampp/htdocs, that is what is going to be served.

Good Luck
8)