Make sure you accomplised complete installation of XAMPP, If not, please visit this tutorial (Windows | Linux | Mac OSX).

Open /opt/lampp/lampp restart/httpd-xampp.conf in an editor. Then, look for <LocationMatch> </LocationMatch>, comment the “Deny from all” statement.

<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/XAMPP_FORBIDDEN.html.var
</LocationMatch>

 Reset Xampp with /opt/lampp/lampp restart

 

 If you still can’t connect to XAMPP externally, it’s Firewall stop the connection. Either you disable Firewall, or make some modification for in Firewall settings. I’m only figure out in Linux environment. Here is how: 

  • Check current settings of your computer’s firewall by running : cat /etc/sysconfig/iptables.  The result is below: 

# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

  • Try at first stopping your firewall issuing the following command: /etc/init.d/iptables stop. Now you can access to XAMPP because firewall won’t stop the connection. 
  • Open file /etc/sysconfig/iptables by vi (vi /etc/sysconfig/iptables) or gedit (gedit /etc/sysconfig/iptables) .
  • Remove this: -A INPUT -j REJECT --reject-with icmp-host-prohibited
  • Add this: -A INPUT -m state --state NEW -m tcp -p tcp -m multiport --dports 80,443 -j ACCEPT
  • Here is how it finally looks like: 

# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
#-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A INPUT -m state --state NEW -m tcp -p tcp -m multiport --dports 80,443 -j ACCEPT
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

  • Now restart your Firewall by /etc/init.d/iptables start & XAMPP /opt/lampp/lampp restart
  • You can now connect to XAMPP.

Hopefully this help. Good luck 🙂