cannot access own pages because of xampp security

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

cannot access own pages because of xampp security

Postby wallyboz » 22. October 2009 20:05

I have set up v1.7.2 and have password-secured it.
On the localhost I can access the xampp pages after having given my credentials.

Now, I host 3 sites for foundations and all reside in subfolders of htdocs and for all 3 I added VirtualHosts in the httpd.conf. The environment is exactly the same as I had on my v1.6.6a xampp.
However, xampp security doesn't allow me to access either of the pages.

I guess that I have to make an exclusion for my own sites somewhere, maybe in httpd-xampp.conf, but have not the slightest idea how.

Luckily I still have the old environment on another machine and can NAT-forward simply in my router after some tests, but I have been strugling for 2 weeks now and I still have not seen the light.

If anyone experienced this I'd be glad to know how the problem was overcome.
wallyboz
 
Posts: 12
Joined: 03. July 2007 13:08
Location: Bergen op Zoom, The Netherlands
Operating System: Linux Ubuntu

Re: cannot access own pages because of xampp security

Postby Izzy » 23. October 2009 00:58

wallyboz wrote:Now, I host 3 sites for foundations and all reside in subfolders of htdocs and for all 3 I added VirtualHosts in the httpd.conf. The environment is exactly the same as I had on my v1.6.6a xampp.
However, xampp security doesn't allow me to access either of the pages.
The XAMPP security you set up should only relate to a .htaccess file in the \xampp\htdocs\xampp folder - so check that you don't have a .htaccess file in the \xampp\htdocs folder or in the foundation's sub-folders.

It is possible to use the httpd.conf file for vhosts, but in the \xampp\apache\conf\extra folder there is a httpd-vhosts.conf file specifically for this purpose, which I recommend you use instead of the httpd.conf file.

Do an Advanced forum search in the XAMPP for Windows forum for keyword virtualhost or vhosts for some helpful and useful examples in the results.


Please paste here the vhosts configurations.

Did you add the foundations to the Windows hosts file in the form 127.0.0.1 foundation1 etc.?

How are you calling the foundations in your browser?
http://foundation1 for example or http://localhost/foundation1 perhaps?

What does the apache error.log tell you? \xampp\apache\logs\error.log

Can you please paste the relevant error message that applies to your attempt at connecting to a foundation vhost using your browser?
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: cannot access own pages because of xampp security

Postby wallyboz » 28. October 2009 07:09

I took your advise and cut the VirtualHost from my httpd.conf and entered below in my httpd-xampp.conf:

Alias /bozanova "D:/xampp/htdocs/bozanova/"
<Directory "D:/xampp/htdocs/bozanova">
Order allow,deny
Allow from all
</Directory>

Alias /stst "D:/xampp/htdocs/stst/"
<Directory "D:/xampp/htdocs/stst">
Order allow,deny
Allow from all
</Directory>

between the <IfModule alias_module> .

I added

<VirtualHost *:80>
ServerAdmin postmaster@bozanova.nl
ServerName bozanova.nl
DirectoryIndex index.html index.htm index.php
ServerAlias http://www.bozanova.nl
DocumentRoot "D:/xampp/htdocs/bozanova"
ErrorLog "D:/xampp/apache/logs/error-bozanova.log"
</VirtualHost>

to the httpd-vhosts.conf.

Addressing the localhost on the localhost results in a display of the xampp-pages which is as expected.
Addressing either bozanova.nl (my own pages) or stst.nl (a foundation) results in an error 403 (Access forbidden! New XAMPP security concept:....)

I haven't made any changes to the hosts-file since I'm not concerned in addressing any pages on it apart from the XAMPP-pages which it does.

I am running XAMPP for Windows, does that imply anything on the use of forward- or backslashes in the various conf-files?

Any comment is highly appreciated since it takes a more and more efforts to keep my old webserver alive.
wallyboz
 
Posts: 12
Joined: 03. July 2007 13:08
Location: Bergen op Zoom, The Netherlands
Operating System: Linux Ubuntu

Re: cannot access own pages because of xampp security

Postby Izzy » 28. October 2009 09:32

Check this and see if it helps by copy and paste into the httpd-vhosts.conf file overwriting what you have there already.
Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/xampp/htdocs"
</VirtualHost>

<VirtualHost *:80>
ServerName bozanova.nl
ServerAlias www.bozanova.nl, bozanova
DocumentRoot "D:/xampp/htdocs/bozanova"
DirectoryIndex index.html index.htm index.php
ServerAdmin postmaster@bozanova.nl
ErrorLog logs/error-bozanova.log
</VirtualHost>

<VirtualHost *:80>
ServerName stst
DocumentRoot "D:/xampp/htdocs/stst"
DirectoryIndex index.html index.htm index.php
ServerAdmin postmaster@stst.nl
ErrorLog logs/error-stst.log
</VirtualHost>

I don't believe you need those 2 Alias entries as you can use the vhosts as I have outlined above using ServerAlias to replace the entries in the httpd-xampp.conf file.

If you want to use stst and bozanova on your localhost then add these entries to your Windows hosts file:
C:\Windows\system32\drivers\etc\host
Drag it into your text editor and make sure the first entries look like this
Code: Select all
127.0.0.1 localhost
127.0.0.1 stst
127.0.0.1 bozanova

You should then be able to access using:
http://localhost - XAMPP pages
http://stst - STST files
http://bozanova - BOZANOVA files
Your domain name that is registered and pointing to your PC,s IP then you and those out on the Internet should be able to access using:
http://bozanova.nl
http://www.bozanova.nl

When you have stst.nl pointing to your PC,s IP then use the bozanova entry above as a template for the ServerName and ServerAlias for stst.nl domain name.

Test the above and see how it goes and make sure you save the conf files after editing and clear your browser,s cache often.

Good luck.
Last edited by Izzy on 03. November 2009 22:28, edited 1 time in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: cannot access own pages because of xampp security

Postby wallyboz » 28. October 2009 17:25

Izzy, I seem to be getting somewhere :) .

On the localhost all is fine now. I can access all (localhost, stst and bozanova).
From the internet however I can only access bozanova.nl and when I try stst.nl I still get the "error 403".

This is what I now have in my httpd-vhosts.conf:

<VirtualHost *:80>
NameVirtualHost *:80
</VirtualHost>

<VirtualHost *:80>
ServerName localhost
DocumentRoot "D:/xampp/htdocs"
</VirtualHost>

<VirtualHost *:80>
ServerName bozanova.nl
ServerAlias www.bozanova.nl, bozanova
DocumentRoot "D:/xampp/htdocs/bozanova"
DirectoryIndex index.html index.htm index.php
ServerAdmin postmaster@bozanova.nl
ErrorLog logs/error-bozanova.log
</VirtualHost>

<VirtualHost *:80>
ServerName stst
ServerAlias www.stst.nl, stst
DocumentRoot "D:/xampp/htdocs/stst"
DirectoryIndex index.html index.htm index.php
ServerAdmin postmaster@stst.nl
ErrorLog logs/error-stst.log
</VirtualHost>

Error 403 tells me the settings can be config'd in httpd-xampp.conf.
wallyboz
 
Posts: 12
Joined: 03. July 2007 13:08
Location: Bergen op Zoom, The Netherlands
Operating System: Linux Ubuntu

Re: cannot access own pages because of xampp security

Postby Izzy » 28. October 2009 23:48

I can access your site from here using http://www.stst.nl/ - no error.

http://stst.nl is Address not found!

Try changing ServerName to stst.nl - save the file then restart Apache and clear your browser's cache and do that often.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: cannot access own pages because of xampp security

Postby wallyboz » 29. October 2009 17:56

Yes I know.
But you are looking on the pages on my old server. Everytime something's not completely right I NAT-forward it back to the previous situation.
wallyboz
 
Posts: 12
Joined: 03. July 2007 13:08
Location: Bergen op Zoom, The Netherlands
Operating System: Linux Ubuntu

Re: cannot access own pages because of xampp security

Postby wallyboz » 31. October 2009 13:45

I've now set it up in the httpd-xampp.conf as below:
============================================
Alias /bozanova "D:/xampp/htdocs/bozanova/"
<Directory "D:/xampp/htdocs/bozanova">
Order allow,deny
Allow from all
</Directory>

Alias /lachalouette "D:/xampp/htdocs/lachalouette/"
<Directory "D:/xampp/htdocs/lachalouette">
Order allow,deny
Allow from all
</Directory>

Alias /stst "D:/xampp/htdocs/stst/"
<Directory "D:/xampp/htdocs/stst">
Order allow,deny
Allow from all
</Directory>

</IfModule>

#
# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
Order deny,allow
Deny from all
Allow from ::1 127.0.0.0/8 \
fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 \
fe80::/10 169.254.0.0/16

ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
</LocationMatch>
===================================================

on the localhost I can connect to
xampp-pages
bozanova
lachalouette
stst

from my lan I can connect by using:
http://bozanova3/bozanova/
http://bozanova3/lachalouette/
http://bozanova3/stst
(where bozanova3 is the new sebserver).

From the internet I still get the error 403 on all sites (which presently are still served by my old server: bozanova2) with the remark that settings can be configured in the httpd-xampp.conf file.
Shouldn't there be an entry in that file that above sites may be accessed by "all"? I cannot figure out how and exactly where. :oops:
wallyboz
 
Posts: 12
Joined: 03. July 2007 13:08
Location: Bergen op Zoom, The Netherlands
Operating System: Linux Ubuntu

Re: cannot access own pages because of xampp security

Postby wallyboz » 03. November 2009 17:26

I think I got it all like it was meant:

httpd-xampp.conf with the original <LocationMatch> and Aliases for my sites.

httpd.conf (Apache) with <VirtualHosts *:80> for all my sites

http-vhosts.conf also again with <VirtualHosts *:80> for same sites

As far as I can see it now does what I want. Access from the internet with the exception of the xampp-pages, access from the localhost and access from the iontranet as well.

Thank you very much for you patient input! :D
wallyboz
 
Posts: 12
Joined: 03. July 2007 13:08
Location: Bergen op Zoom, The Netherlands
Operating System: Linux Ubuntu

Re: cannot access own pages because of xampp security

Postby Izzy » 03. November 2009 22:23

wallyboz wrote:httpd.conf (Apache) with <VirtualHosts *:80> for all my sites

http-vhosts.conf also again with <VirtualHosts *:80> for same sites
FYI, the httpd-vhosts.conf file overrides the entries in the httpd.conf file so if they are the same then the only entries used by Apache will be those in the httpd-vhosts.conf file.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 134 guests