Accessing Wordpress on a local network
Posted by: maurice_in_vancouver (---.vc.shawcable.net)
Date: February 02, 2017 08:06PM

Hi there,

I've successfully installed WAMP, - truly helpful troubleshooter - have got wordpress installed and running locally. I've imported my website with over 2500 pictures, in 50+ galleries, 600+ posts, and 50+pages and everything is working great.

What I would like to do is allow my wife to access the blog from her pc, which is on the same local network - is that possible? both running windows 10, win all current wamp - just installed it from fresh installs yesterday. (february 1)

If so, any documents discussing it?

The reason I ask, is that in the troubleshooter doc, it mentions that computers in the same network should be able to access it...

hope someone has an answer.

Options: ReplyQuote
Re: Accessing Wordpress on a local network
Posted by: RiggsFolly (Moderator)
Date: February 03, 2017 10:03AM

Hi,

Yes its easy really.

Using the wampmanager menus do

left click wampmanager -> Apache -> httpd-vhosts

This will open the editor on this file. It should look like this

#
# Virtual Hosts
#

<VirtualHost *:80>
	ServerName localhost
	DocumentRoot D:/wamp/www
	<Directory  "D:/wamp/www/">
		Options +Indexes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local
	</Directory>
</VirtualHost>

Or if you have added a Virtual Host as is recommended it should look something like this

#
# Virtual Hosts
#

<VirtualHost *:80>
	ServerName localhost
	DocumentRoot C:/wamp/www
	<Directory  "C:/wamp/www/">
		Options +Indexes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local
	</Directory>
</VirtualHost>

<VirtualHost *:80>
	ServerName YOURDOMAIN.dev
	DocumentRoot C:/wamp/www/YOURDOMAIN
	<Directory  "C:/wamp/www/YOURDOMAIN/">
		Options +Indexes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local
	</Directory>
</VirtualHost>


For the Virtual Host(s) that you want to be visible on your local network add a line like this

<VirtualHost *:80>
	ServerName YOURDOMAIN.dev
	DocumentRoot C:/wamp/www/YOURDOMAIN
	<Directory  "C:/wamp/www/YOURDOMAIN/">
		Options +Indexes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local

                #Allow access from anywhere on my local network
                Require ip 192.168.1

	</Directory>
</VirtualHost>


Where 192.168.1 is the first 3 quartiles of your subnet.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Accessing Wordpress on a local network
Posted by: maurice_in_vancouver (---.vc.shawcable.net)
Date: February 04, 2017 05:54PM

thanks for the response! appreciated.

I added the line to the vmhosts files, then re-started each service. tried to access the blog, but nope didn't work.

I'm guessing I need to have the 2nd machine configured like my machine? ie: no skype, all the ms runtime updates added in, etc so I'll have to start running down that list from the troubleshooter.

will get to it now.

again, thanks.

Options: ReplyQuote
Re: Accessing Wordpress on a local network
Posted by: maurice_in_vancouver (---.vc.shawcable.net)
Date: February 05, 2017 08:00PM

Hi there,
I've made some sort of progress, I guess... I've made the entries in the httpd-vconf file as so:

# Virtual Hosts
#

<VirtualHost *:80>
DocumentRoot "c:/wamp64/www"
ServerName localhost
<Directory "c:/wamp64/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local

#Allow access from anywhere on my local network
Require ip 192.168.1

</Directory>
</VirtualHost>
#
<VirtualHost *:80>
DocumentRoot "c:/wamp64/www/max"
ServerName max
<Directory "c:/wamp64/www/max/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require local

#Allow access from anywhere on my local network
Require ip 192.168.1

</Directory>
</VirtualHost>

I can call my blog just by typing max in my browser's omnibox... I assume I call the blog from my wife's computer by using my ip address like:

192.168.1.133/max

correct? If so, it's not working. I can see all the files across the network, can ping her etc (we share printers, files and stuff all the time, so pretty sure not a network issue)...

do i need to edit the hosts file on my wife's machine?

Options: ReplyQuote
Re: Accessing Wordpress on a local network
Posted by: maurice_in_vancouver (---.vc.shawcable.net)
Date: February 05, 2017 11:59PM

I looked at previous pages on the forum here and discovered that my wife's machine needs a couple of lines in her hosts file ie:

192.168.1.133 max
::1 max

I have added this, restarted the dnscache, and still no loading of the blog via her browser. (the blog loads super fast on my machine via a straight "max" typed in the browser - even dynamic updates occur with quotes, counters, etc...)

I assumed [max] would bring me to the site, on her machine, but no; tried with the 192.168.1.133/max route and that didn't work either.

(Just as a note to the problems of using localhost rather than the virtual hosts - when i looked at why the blog was "sorta" functioning after converting to the vhosts, i discovered over 900 instances of localhost in the wordpress database that needed to be excised.)

Options: ReplyQuote
Re: Accessing Wordpress on a local network
Posted by: maurice_in_vancouver (---.vc.shawcable.net)
Date: February 06, 2017 06:06AM

well i solved it - windows firewall was the culprit.

Options: ReplyQuote
Re: Accessing Wordpress on a local network
Posted by: Towers (---.cust.vodafonedsl.it)
Date: February 09, 2017 11:02AM

Hello,
I have the same issue, but I'm not able to solve it. I did all the processes listed here and in the "how to" section about virtual hosts, but the directive "Require ip xxx" or "Require all granted" ecc doesn't work.

So as maurice, I only want to reach my web application stored in the 192.168.1.120 pc from other pcs in the LAN.
I created a virtualhost like this:

<VirtualHost *:80>
ServerName GeMag
DocumentRoot "c:/wamp64/www/gemag"
<Directory "c:/wamp64/www/gemag/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

gemag is the name of the web application (is it case sensitive?)
I modified the "Require" form "local" to "all granted", and it doen't work, either if i set it to "ip 192.168.1".

The Wamp icon is green

I the etc/hosts file I added:

127.0.0.1 GeMag
::1 GeMag


In the httpd.conf I read these lines:

Listen 0.0.0.0:80
Listen [::0]:80

are those right?

Then in the Directory section I have

<Directory "${INSTALL_DIR}/www/">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# [httpd.apache.org]
# for more information.
#
Options +Indexes +FollowSymLinks +Multiviews

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride all

#
# Controls who can get stuff from this server.
#

# onlineoffline tag - don't remove
Require all granted
</Directory>

I can use the web application on the machine where Wamp is running, but it always says "forbidden" trying to access from another pc in the LAN

I don't know how to solve it... any idea/check/information I'm missing??

Thanks for your help

Options: ReplyQuote
Re: Accessing Wordpress on a local network
Posted by: Towers (---.cust.vodafonedsl.it)
Date: February 09, 2017 11:56AM

Well, big EDIT here... I re-installed Wamp and after the virtual hosts redefined, it works... I don't know why... the only thing I did is exit wamp before modify the files... instead of modify and restart wamp... don't know if there is any difference between the procedures.

Thanks anyway

Options: ReplyQuote
Re: Accessing Wordpress on a local network
Posted by: Otomatic (Moderator)
Date: February 09, 2017 01:38PM

Hi,

In order for the changes to httpd-vhosts.conf or to the hosts file to be taken into account by apache and Windows, it is essential either to restart the machine or to restart the DNS.
Right click Wampmanager icon -> Tools -> Restart DNS

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.