Add code

Wednesday 22 March 2017

How to access localhost website from another computer on the same network?

To access the localhost websites from another computers in a same network, need to follow these steps :
  1. Set up a virtual host
  2. Configure your hosts file
Set up a virtual host
You first need to set up a virtual host in your apache httpd-vhosts.conf file. On XAMP, you can find this file here: C:\xampp\apache\conf\extra\httpd-vhosts.conf This step prepares the Web server on your computer for handling symfony.local requests. You need to provide the name of the Virtual Host as well as the root/main folder of your website. To do this, add the following line at the end of that file. You need to change the DocumentRoot to wherever your main folder is. Here I have taken /Applications/MAMP/htdocs/Symfony/ as the root of my website.


<VirtualHost *:80>
    DocumentRoot "/Applications/MAMP/htdocs/Symfony/"
    ServerName symfony.local
</VirtualHost>

Configure your hosts file:

For the browser understand what symfony.local really means,
you need to edit the hosts file on your computer.

(if you're using WINDOWS 7, this file is in
 \Windows\system32\drivers\etc\hosts).



##
# Host Database
# localhost is used to configure the loopback interface
##
#...
127.0.0.1           symfony.local

Thats it. Now the configuration is completed.
Note: you should replace the above ip address with your system ip address.
Finally, you have to change the base secure and unsecure urls in
database at
core_config_data table.
Then your url will be change from http:localhost/project
to
http://127.0.0.1/project.

No comments:

Post a Comment

Magento : 404 error is showing admin page

Hello, Sometimes we may get the error on admin page once done with the Magento installation. In that scenario, we have to do the following: ...