Allow Internet Access to my website

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

Allow Internet Access to my website

Postby webuser » 04. July 2010 05:44

Hi,

I installed XAMPP and got the web server running but when I try to access it from the internet it says:

Access forbidden!

New XAMPP security concept:

Access to the requested directory is only available from the local network.

This setting can be configured in the file "httpd-xampp.conf".


I tried to edit httpd-xampp.conf but it still doesn't allow access. What exactly do I have to change in it?


Thanks.
webuser
 
Posts: 13
Joined: 04. July 2010 05:34

Re: Allow Internet Access to my website

Postby Altrea » 04. July 2010 07:31

webuser wrote:I tried to edit httpd-xampp.conf but it still doesn't allow access. What exactly do I have to change in it?


If you just want to access your website, you had to change nothing!
the new security concept just save the administration tools of xampp (phpmyadmin, admin control panel, example applications, etc.).

Just create a folder in htdocs for your website (or put it directly in htdocs. delete the index.php file there).
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8288
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Allow Internet Access to my website

Postby webuser » 04. July 2010 10:20

It worked, and that easy. :D

Thanks.


And how can I add a simple basic http authentication to it? So that before you can access the website username and password authentication pops up?

Without opening a new topic. :)
webuser
 
Posts: 13
Joined: 04. July 2010 05:34

Re: Allow Internet Access to my website

Postby Altrea » 04. July 2010 10:35

webuser wrote:And how can I add a simple basic http authentication to it? So that before you can access the website username and password authentication pops up?

The answer is mod_auth.
Take a look at the Apache auth howto
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8288
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Allow Internet Access to my website

Postby webuser » 04. July 2010 20:21

Ok so I made a password file with users.

But how can I configure the server to request the a password? I read those pages but can't find exactly what to do next.
webuser
 
Posts: 13
Joined: 04. July 2010 05:34

Re: Allow Internet Access to my website

Postby Altrea » 04. July 2010 20:41

Read the second source i posted :shock: . I don't post it just for fun.
In your case the second half of the paragraph Getting it working.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8288
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Allow Internet Access to my website

Postby webuser » 05. July 2010 02:57

Yes I read it but I still don't have it working.

Using the httpd.conf example, how do I edit it so it works?

Just put that code in there somewhere, linked to the correct pathway for the password file of course?

Can you give me an exmaple of a complete httpd.conf file with that implemented or something?


Thanks.
webuser
 
Posts: 13
Joined: 04. July 2010 05:34

Re: Allow Internet Access to my website

Postby Altrea » 05. July 2010 05:03

Okay, lets try a full working example.

I have xampp installed directly in C:\

The path of my .htuser Password-file (created with the htpasswd tool of apache) is c:\xampp\.htuser

i have a project folder c:\xampp\htdocs\projectxy\

the path of my .htaccess file is c:\xampp\htdocs\projectxy\.htaccess

The source of my .htaccess file is the following:
Code: Select all
AuthType Basic
AuthName "Service LogIn"
AuthUserFile C:/xampp/.htuser
Require valid-user


Thats all.

You can create your own <Directory> Block for your project-folder in httpd.conf (like the Directory-Block for the htdocs folder). It's important that this Directory Block has an AllowOverride Rule whichs allows the override by htaccess-files (the htdocs <Directory> Block does have this rule by default.

You can create your own VHost for your project-folder too. But thats a different topic.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8288
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Allow Internet Access to my website

Postby webuser » 05. July 2010 07:43

OK I tried it but it didn't ask for a password yet.

And I can't make a file like ".htaccess" because windows wants me to name it before the extension. So I just named it "ht.htaccess" if thats not a problem. But it didn't ask for a password.

And my password-file has no extension, just named "passwords". But I did set the correct path etc to it and all.

But how would a Directory example look like from a httpd.conf perspective?
webuser
 
Posts: 13
Joined: 04. July 2010 05:34

Re: Allow Internet Access to my website

Postby Nobbie » 05. July 2010 08:22

webuser wrote: So I just named it "ht.htaccess" if thats not a problem


It is a problem, it must be .htaccess

Or change httpd.conf, look for .htaccess and change it to ht.htaccess also.

Anyway, also in windows it is possible to have a file called .htaccess (without prefix). Either take another editor or simply rename the file after editing.
Nobbie
 
Posts: 8767
Joined: 09. March 2008 13:04

Re: Allow Internet Access to my website

Postby Altrea » 05. July 2010 08:26

Nobbie wrote:...simply rename the file after editing.

with the beautiful rename function in the command line :D
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8288
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Allow Internet Access to my website

Postby webuser » 05. July 2010 21:32

Now it works. :D

Thanks.


I do however have another problem. I can't access MySQL, not from the inside and not from the outside.

I edited "config.inc.php" to give it a password and further left it alone. But it keeps asking me for an authentication again and again. And from the outside using another IP and over the internet it gives no access.
webuser
 
Posts: 13
Joined: 04. July 2010 05:34

Re: Allow Internet Access to my website

Postby neoluk » 15. July 2010 18:06

If you just want to access your website, you had to change nothing!
the new security concept just save the administration tools of xampp (phpmyadmin, admin control panel, example applications, etc.).
Just create a folder in htdocs for your website (or put it directly in htdocs. delete the index.php file there).


I already have my site on a subfolder but still it is not visible.
If I don't have to change nothing, where can I find the solution to the fact that I cannot see it form outside the LAN?
The following error is still visible

Access forbidden!
New XAMPP security concept:
Access to the requested object is only available from the local network.
This setting can be configured in the file "httpd-xampp.conf".


please help, bacause I really cannot solve the problem alone.
thx
neoluk
 
Posts: 1
Joined: 15. July 2010 17:59

Re: Allow Internet Access to my website

Postby Altrea » 15. July 2010 22:23

neoluk wrote:The following error is still visible

Access forbidden!
New XAMPP security concept:
Access to the requested object is only available from the local network.
This setting can be configured in the file "httpd-xampp.conf".


Which Address does your browser address-bar show, if you see this message?
Is that your own script you installed in this subfolder, or some well known php-script?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8288
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Allow Internet Access to my website

Postby vhreporter » 16. July 2010 03:12

I fixed the problem by commenting out the following in the httpd-xampp.conf file (found at C:\xampp\apache\conf\extra):

#
# 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>

I'm sure there had to be a better configuration to this, but after working through all the MySQL issue, I'm a little fried and didn't care. Also - I had to restart the Apache service for the changes to take effect.

Also, if you just access the root directory from a browser, the index.php file gets precedence and it has a reference to another file deeper in the subdir "xampp" - so you will get a request to authenticate, which is not a bad deal. Test using the index.html file.

I haven't tested yet, but I assume as long as there isn't a .htaccess file in your public web folder, you should be OK.

Curious to see if this helps...
vhreporter
 
Posts: 4
Joined: 16. July 2010 03:00

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 61 guests