Need Help with virtual hosts

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

Need Help with virtual hosts

Postby skipsbro » 04. November 2007 03:00

Hello, I am a bit new at the idea of apache Virtual Hosting, but I would like to give it a whirl. I am running xampp on a ubuntu 7.04 server and I currently have a listen in httpd.conf like this

Listen 8000

and in httpd-vhosts.conf like this (for my secondary domain, jaksalad.com)

<VirtualHost *:8000>
ServerAdmin admin@feistyhosts.com
Document Root /www/jaksalad
ServerName jaksalad.com *.jaksalad.com
ErrorLog logs/jaksalad.com-error_logs
CustomLog logs/jaksalad.com-access_logs common
</Virtual Host>

However, when you try to visit http://jaksalad.com:8000 (I use port 8000 because Verzion blocks outbound port 80), you get the server index (Currently set to /var/www/)

What am I doing wrong?
skipsbro
 
Posts: 3
Joined: 04. November 2007 02:49

Re: Need Help with virtual hosts

Postby skuipers » 04. November 2007 06:50

You should specify the following in httpd-vhosts.conf:

NameVirtualHost *:8000

#
# Default virtual host
#

<VirtualHost *:8000>
ServerName your_primary_domain
DocumentRoot /var/www
ErrorLog your_error_log_location
CustomLog your_access_log_location
<Directory /var/www>
Options Includes MultiViews ExecCGI
AddHandler cgi-script .cgi .exe .pl
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


#
# Virtual host added for secondary domain
#

<VirtualHost *:8000>
ServerName *.jaksalad.com
DocumentRoot /www/jaksalad
ErrorLog logs/jaksalad.com-error_logs
CustomLog logs/jaksalad.com-access_logs common
<Directory /www/jaksalad>
Options Includes MultiViews ExecCGI
AddHandler cgi-script .cgi .exe .pl
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

This works for me anyhow. Of course the specifications in <Directory>..</Directory> are just an example; please adjust according to your own needs.

Do not forget to restart Apache after having made the modifications.
skuipers
 
Posts: 99
Joined: 21. January 2005 16:27
Location: The Netherlands

Postby skipsbro » 04. November 2007 08:14

I have done what you told me, and it did not work. Is there anything else I'm missing? Even if its obvious, It's like me to over look the little details.
skipsbro
 
Posts: 3
Joined: 04. November 2007 02:49

Postby skuipers » 04. November 2007 10:31

Did you make a change in /opt/lampp/etc/httpd.conf?

# Virtual hosts
#Include etc/extra/httpd-vhosts.conf

should become

# Virtual hosts
Include etc/extra/httpd-vhosts.conf
skuipers
 
Posts: 99
Joined: 21. January 2005 16:27
Location: The Netherlands

Postby skipsbro » 04. November 2007 17:49

ah, thank you, that is what I had done wrong.
skipsbro
 
Posts: 3
Joined: 04. November 2007 02:49


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 1 guest