Setup virtual hosts for ports other than 80

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Setup virtual hosts for ports other than 80

Postby anoopvvv » 10. April 2012 17:51

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
anoopvvv
 
Posts: 1
Joined: 10. April 2012 17:39
XAMPP Version: 5.6.3
Operating System: Linux

Re: Setup virtual hosts for ports other than 80

Postby JonB » 27. April 2012 17:53

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)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 7 guests