• hi , i use wamp server to host my local website .
    everything is work fine from my local pc which has wamp

    the problem happened when i try to access the same website from another pc on same network , https://server_ip_address/mywebsite/
    an error occured :

    Forbidden

    You don’t have permission to access /blog on this server.
    Apache/2.4.9 (Win32) PHP/5.5.12 Server at 172.16.0.72 Port 80

    i search more articles and found it is related to <directory/> in httpd.conf
    but nothing success with me , please i need clear steps to follow

Viewing 3 replies - 1 through 3 (of 3 total)
  • Suggest that rather than use ip addresses on your localhost and local computers, that you use names to map and access your site, it is much closer to how it will eventually be deployed.

    This is how I configure apache on Linux, only minor details are different. You want to configure your website as a VirtualHost.
    On your localhost PC, you add this to your apache configuration:

    <VirtualHost *:80>
    DocumentRoot AbsolutePathToYourWebsiteRootDirectory
    ServerName myweb.local
    ServerAlias www.myweb.local
    </VirtualHost>

    The in your “hosts” file you add:

    127.0.0.1 myweb.local
    127.0.0.1 www.myweb.local

    Details on your hosts file here:
    https://en.wikipedia.org/wiki/Hosts_%28file%29

    You will also need to change your WordPress Address and Site Address to: “myweb.local”

    You can now access your WordPress site on your localhost PC as:
    https://myweb.local/

    Now you want to access the website from other computers on the same LAN. Say your localhost computer has local ip address “192.168.0.17”
    Then on the other computer, you add to the hosts file there:

    192.168.0.17 myweb.local
    192.168.0.17 www.myweb.local

    From this computer you can now access the website as:
    https://myweb.local/

    Of course the “myweb.local” can be anything (even “google.com”) just so long as the usage is consistent. Just remember that your hosts file will mask any real internet names.
    On occasions I have taken live sites to local for fixing, used the EXACT SAME NAME, the website never knows it has moved, when the time came the database+files moved back just as easily, of course I had to contrive to use the same database name and user+password (otherwise I would have had to adjust “wp-config.php”.

    Remember that the config and hosts files cannot be edited with a word processing editor.
    Using this technique you can host and map lots of different website, so much better than just one hardwired one you started with.

    add the ip address of the wordpress server/pc in the other pc’s host file.
    C:\Windows\System32\drivers\etc
    Hosts
    192.168.xxx.xxx https://www.jlorenzo.com.au

    @rossmitchell

    This is excellent info, how would this be done for mobile devices? that obviously don’t have an hosts file to edit…

    When I installed WP it chose localhost as the domain, how can this be resolved on a mobile device?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Access my WordPress site from another pc on same network’ is closed to new replies.