Error when trying to access XAMPP from a network [closed]
Asked Answered
C

3

66

I get following error when trying to access Xampp from a network I've tried but does not get any idea how to resolve it. Any help??I really confused

Access Forbidden :

Access to the requested Object is only available from the local network. This setting can be configured in the file "httpd-xampp.conf".

Chapen answered 21/5, 2011 at 17:28 Comment(5)
The error seems very self explanatory. Have you tried editing the httpd-xampp.conf file?Expletive
yeah, but wondering what exactly to do there.Chapen
Follow the link clear and concise yeslinux.blogspot.com/2012/07/…Shoe
@ChrisSalij: No, it is not very self explanatory. It doesn't say whare the file is. Try to find itUpdo
my advice: at the end of httpd-xampp.conf, remove 'xampp' such that you get : <LocationMatch "^/(?i:(?:security|licenses|phpmyadmin|webalizer|server-status|server-info))"> Require local ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var </LocationMatch> instead of #<LocationMatch "^/(?i(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))"> # Require local # ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var #</LocationMatch> now only you web/php pages are visible, and not the admin pagesSeignior
Z
92

In your xampppath\apache\conf\extra open file httpd-xampp.conf and find the below tag:

# Close XAMPP sites here
<LocationMatch "^/(?i:(?:xampp|licenses|phpmyadmin|webalizer|server-status|server-info))">
    Order deny,allow
    Deny from all
    Allow from ::1 127.0.0.0/8 
    ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
</LocationMatch>

and add

"Allow from all"

after Allow from ::1 127.0.0.0/8 {line}

Restart xampp, and you are done.

In later versions of Xampp

...you can simply remove this part

#
# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
        Require local
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>

from the same file and it should work over the local network.

Zusman answered 26/3, 2012 at 7:5 Comment(8)
But after adding that it takes me to the XAMPP homepage instead of whatever IP I provide it. I tried accessing my DLink router but I landed upon the XAMPP homepage after adding the Allow from all line to the file.Saltigrade
i cant able you get you give detailsZusman
just for somebody information: i had also to set up the passwords in "/opt/lampp/lampp security" after adding this string. Thanks.Peipus
Only works when set up passwords in /opt/lampp/lampp securityEricerica
Restarting your computer or XAMPP is a must!Gogh
People , now you need to update /opt/lampp/etc/extra/httpd-xampp.conf . Then it will work!Louettalough
we commented the "Require local" with '#' => "#Require local" (without the quotes) and it solved the problemForeskin
doesn't work...Mostly
O
41

This solution worked well for me: http://www.apachefriends.org/f/viewtopic.php?f=17&t=50902&p=196185#p196185

Edit /opt/lampp/etc/extra/httpd-xampp.conf and adding Require all granted line at bottom of block <Directory "/opt/lampp/phpmyadmin"> to have the following code:

<Directory "/opt/lampp/phpmyadmin">
  AllowOverride AuthConfig Limit
  Order allow,deny
  Allow from all
  Require all granted
</Directory>
Overshoot answered 12/9, 2012 at 10:10 Comment(2)
don't forget to restart the LAMPP service by using this command: sudo /opt/lampp/lampp restartKieffer
This answer is valid for Latest versions- Apache 2.4Somewhere
J
8

This answer is for XAMPP on Ubuntu.

The manual for installation and download is on (site official)

http://www.apachefriends.org/it/xampp-linux.html

After to start XAMPP simply call this command:

sudo /opt/lampp/lampp start

You should now see something like this on your screen:

Starting XAMPP 1.8.1...
LAMPP: Starting Apache...
LAMPP: Starting MySQL...
LAMPP started.

If you have this

Starting XAMPP for Linux 1.8.1...                                                             
XAMPP: Another web server daemon is already running.                                          
XAMPP: Another MySQL daemon is already running.                                               
XAMPP: Starting ProFTPD...                                                                    
XAMPP for Linux started

. The solution is

sudo /etc/init.d/apache2 stop
sudo /etc/init.d/mysql stop

And the restast with sudo //opt/lampp/lampp restart

You to fix most of the security weaknesses simply call the following command:

/opt/lampp/lampp security

After the change this file

sudo kate //opt/lampp/etc/extra/httpd-xampp.conf

Find and replace on

    #
# 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 
    Allow from all
    #\
    #   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/XAMPP_FORBIDDEN.html.var
</LocationMatch>
Judsonjudus answered 30/3, 2013 at 17:18 Comment(3)
/opt/lampp/lampp security is very useful after you setup XAMPP ! It'll take care of several default security issues: FTP account, PHPAdmin, Sqlite accountWellordered
I tried both of these solutions and neither resolved the error. After writing the changes to the file on the remote server, is there something else I need to do?Dollydolman
Relaunch xampp? What is the new error that you have now?Judsonjudus

© 2022 - 2024 — McMap. All rights reserved.