Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

access xampp/htdocs from outside

Tags:

apache

I installed xampp server in a server and I want to open the projects in htdocs not only from (http://localhost/folder/file.php) but from other computers as well, by its ip. example: (192.168.1.210/folder/file.php) how do I do this? I did edit the httd.conf

<Directory/>
  Options FollowSymLinks
  AllowOverride None
  Order deny,allow
  Deny from all
  Allow from all
</Directory>

to allow access in all subdirectories of xampp/htdocs.. but still nothing! I can't open my projects login file unless I'm logged in the server. thanks in advance!

like image 527
Mirela Avatar asked Oct 19 '12 14:10

Mirela


People also ask

How do I access XAMPP outside network?

Just enter the IP address of the XAMPP server in the browser. If you haven't already, you need to configure XAMPP for remote access. If you mean another network, then you need to turn on port forwarding in your router. Send your query to the WAN (public) IP address of your router.

How do I access Htdocs in XAMPP?

The htdocs folder can be found in /opt/lampp/ . You can navigate to your root folder from the file manager (nautilus by default), by clicking on Other locations from the sidebar, then Computer . From there you can find the opt folder that contains the lampp folder.

How do I access Htdocs in my browser?

Open up any Web browser on your desktop and enter "localhost" into the address box. The browser will open a list of files stored under the "HTDocs" folder on your computer. Click on the link to a PHP file and open it to run a script.


1 Answers

You need a virtual host in Apache, that listens to at least the given IP (192.168.1.210:80) or to any IP (*:80):

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot /var/www/some_app
</VirtualHost>

See: http://httpd.apache.org/docs/2.2/vhosts/examples.html

Please don't edit the httpd.conf, as the changes might get lost on the next software update. You need to create a vHost inside the site-available in den XAMPP/Apache folder.

like image 140
feeela Avatar answered Nov 09 '22 21:11

feeela