XAMPP Virtual Hosts Problems

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

XAMPP Virtual Hosts Problems

Postby Andromedan » 31. December 2007 06:29

HI. I am running XAMPP on Red Hat Linux 5, as a home server with Webmin, Usermin & Virtualmin. Everything works OK, except when i try to add a virtual host, either manually, or with Virtualmin.
Then i get a 403 Error, (Access Denied) when i try to access anything on the server, even blocks PHPMyAdmin out too...
If i then remove the virtual host entries, things return to normal.
I cannot find anything on the web that works to fix this problem & have been trying for days to figure it out... Hope someone here can help me!

Thanks in advance,
Andro
Andromedan
 
Posts: 7
Joined: 28. March 2007 10:56

Postby Izzy » 31. December 2007 07:06

You will need to add permissions to each of your <Directory> directives in your virtual host containers:
<Directory (path)>
Options (Indexes etc.)
Order allow,deny
Allow from all

</Directory>

The default in the httpd.conf file is set to be very restrictive so you need to change that behavior for each directory in your virtual host configurations.

This handy method also allows you to change any directory behavior on an individual virtual host basis.

References:
http://httpd.apache.org/docs/2.2/mod/mo ... html#order
http://httpd.apache.org/docs/2.2/mod/co ... #directory
http://httpd.apache.org/docs/2.2/mod/core.html#options
http://httpd.apache.org/docs/2.2/mod/directives.html

If you are trying to debug your virtual host configuration, you may find the Apache -S command line switch useful.
path/to/apache/bin/httpd -S

HTH and have a great New Year's celebration! :mrgreen:


===========================================
1. The new DeskTopXampp Launch Control for XAMPP / XAMPPlite
Posted by Ridgewood available from Ridgewood'sDTX web site

2. Build Rich AJAX Applications - Faster
TIBCO General Interface Pro Edition but FREE and Open Source
Fully working with NO donations required to get a user/password
===========================================
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Cheers

Postby Andromedan » 31. December 2007 08:22

Thanks for the info dude, i did try to change the default in httpd.conf to be unrestrictive, but it didn't work & i set the permissions in the virtual host containers in httpd.conf & httpd-vhosts.conf & i still get the same 403 error, how can i make it default to allow the virtual hosts without having to do manual file editing?

This is the code in my httpd.conf Virtual Hosts:

Code: Select all
ServerName Any
<VirtualHost 192.168.0.5:80>
SuexecUserGroup "#1000" "#1000"
ServerName tdlwebhosting.org
ServerAlias www.tdlwebhosting.org
DocumentRoot /home/tdlwebhosting/public_html
ErrorLog /home/tdlwebhosting/logs/error_log
CustomLog /home/tdlwebhosting/logs/access_log combined
ScriptAlias /cgi-bin/ /home/tdlwebhosting/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/tdlwebhosting/public_html>
Options Indexes IncludesNOEXEC FollowSymLinks
allow from all
AllowOverride All
</Directory>
<Directory /home/tdlwebhosting/cgi-bin>
allow from all
</Directory>
</VirtualHost>


With this or any other Virtual Host directive in the conf file, the server blocks ALL access attempts to anything.
Andromedan
 
Posts: 7
Joined: 28. March 2007 10:56

Postby Izzy » 31. December 2007 08:34

i did try to change the default in httpd.conf to be unrestrictive, but it didn't work

Changing the default should do the trick for you, so you don't have to edit any vhost containers.
What did you do to the default setting that didn't work?

Using the links to the Apache docs should give you the correct way but it may be just entering the Order I gave above may do the trick.

Then remove the corresponding entries in the vhosts file - remember that entries in the vhosts file override the httpd.conf entries.

I was compiling this reply after you made some edits so here is what I think you should have:
Code: Select all
<Directory /home/tdlwebhosting/public_html>
Options Indexes IncludesNOEXEC FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory /home/tdlwebhosting/cgi-bin>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


Try this and case is important.
With this or any other Virtual Host directive in the conf file, the server blocks ALL access attempts to anything.

Yes, any errors in the conf files will give Apache a migraine ;)

You should try the command apache -S and debug your vhost containers.


===========================================
1. The new DeskTopXampp Launch Control for XAMPP / XAMPPlite
Posted by Ridgewood available from Ridgewood'sDTX web site

2. Build Rich AJAX Applications - Faster
TIBCO General Interface Pro Edition but FREE and Open Source
Fully working with NO donations required to get a user/password
===========================================
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Half Working

Postby Andromedan » 31. December 2007 10:49

Hi dude. I did some more fiddling & got things about half working, i am no longer getting 403 errors, but apache is getting some virtual hosts mixed up.

This is the default access setting in XAMPP as far as i could tell:
Code: Select all
<Directory />
    Options FollowSymLinks
    AllowOverride None
    #XAMPP
    #Order deny,allow
    #Deny from all
</Directory>


But changing this to allow didn't do anything to the problem. I can't find anything else in the httpd.conf file that looks like a default setting.[/code]
Andromedan
 
Posts: 7
Joined: 28. March 2007 10:56

Postby Izzy » 31. December 2007 11:41

That's the default <Directory> setting.

So changing it to this did not change anything?
Code: Select all
<Directory />
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

Plus deleting the other Order entries in the httpd-vhosts.conf file?

What did apache -S have to say about the syntax of your httpd-vhosts.conf file?

Also to check the syntax for errors of your httpd.conf file use the apache -t command.

To get to the bottom of your issues you really should use the debug commands, thats what they are for, as Apache will tell you why it is not prepared to accept your configurations.

BTW If you get just one virtual host entry working before adding multiple entries then this will be to your advantage.
You can then see, with only one entry, what the issues are instead of trying to work out which entry is giving you a pain.
Once you have one working then adding the others based on your working entry will give you a success outcome.


===========================================
1. The new DeskTopXampp Launch Control for XAMPP / XAMPPlite
Posted by Ridgewood available from Ridgewood'sDTX web site

2. Build Rich AJAX Applications - Faster
TIBCO General Interface Pro Edition but FREE and Open Source
Fully working with NO donations required to get a user/password
===========================================
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Sorted It

Postby Andromedan » 01. January 2008 21:31

Hey dude, I am not sure how to run the Apache -S command using XAMPP, but i did manage to sort the problem eventually, it was the permissions of the folder that i created to hold the virtual hosts's HTML files. I reset the permissions & it started working. And no changing the default Folders entry did not do anything lol.

Thanks for all the help dude!
Running web servers can be so fun at times! :twisted: :twisted:
Andromedan
 
Posts: 7
Joined: 28. March 2007 10:56


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 18 guests