Share website on local network with WAMP
Posted by: funkyfrank (---.182.139.19.46.swissinet.com)
Date: November 24, 2014 11:43AM

I like to share a site in progress on the local network and be able to load it on mobile, tablet or desktop devices connected to the same local network.

How is it done please?

Do I need to change the permissions in httpd-vhosts.conf?

Those are set to

Require local
Require ip 192.168.188

for each Virtual Host.

With the Require ip 192.168.188 line I am not totally sure, does that mean it only accepts requests from any number after 192.168.188, so 192.168.188.56 or 192.168.188.78 for example?

Is there a way to type the Virtual Host project domain name into the other clients browser on the local network and reach the site for browsing like this?

What about the server, do I need to switch that to online? What happens when I do that? Is the site then browsable from outside the network, so the internet, as well? I assume not?

If one of the clients in the local network uses a vpn to connect to the internet, that should not interfere with its ability to have access to sites hosted on the local network, is this correct also?

(I assume this since the Windows clients in this local network communicate just fine, though all of them are on a VPN, so I assume Windows and local server networking does not interfere with traffic coming and going to the internet.)

Many thanks for any help.

Best
Frank

Version of Operating system? Windows 7 Ultimate 64bit
Version of Wamp Server installed? 2.5 32bit
Version of Apache you are running? 2.4.9
Version of MySQL you are running? 5.6.17
Version of PHP you are running? 5.5.12
What colour is your WampManager icon? Green
Host file localhost 127.0.0.1

New to WAMP?
Read this please: [forum.wampserver.com]

Options: ReplyQuote
Re: Share website on local network with WAMP
Posted by: RiggsFolly (---.as43234.net)
Date: November 24, 2014 01:17PM

Hi Frank

Quote

I like to share a site in progress on the local network and be able to load it on mobile, tablet or desktop devices connected to the same local network.
How is it done please?
Do I need to change the permissions in httpd-vhosts.conf?
Those are set to

Require local
Require ip 192.168.188

for each Virtual Host.

For each VHOST you wish to access from anywhere, you have to manually amend the VH definition to tell Apache who is allowed access to the site controlled by that VH definition.

So your code
Require local
Require ip 192.168.188

Should allow any ip address that starts with 192.168.188 access to the VH in question.

Quote

Is there a way to type the Virtual Host project domain name into the other clients browser on the local network and reach the site for browsing like this?

If you have your own DNS server, you would configure that to point the domainname to the ip of the PC running WAMPServer. But I assume you like most people dont have your own DNS.

So the other option is to edit the HOSTS file on each PC wishing to use a site on your WAMPServer PC so it knows about the domain name and the ip where it lives.

So if
WAMPServer in on 192.168.188.10
Client1 is on 192.168.188.50

you edit the HOSTS file on PC 192.168.188.50 like so
192.168.188.10  mysite1.dev

Then the browser running on 192.168.188.50 will be directed to 192.168.188.10 to find mysite.dev
On 192.168.188.10 Apache will see a domain name that matches one of its VHOST'ed domains and server the site from the correct folder i.e. DocumentRoot.



Quote

What about the server, do I need to switch that to online? What happens when I do that? Is the site then browsable from outside the network, so the internet, as well? I assume not?

When using VHOSTS I always leave the Server = Offline
This Online/Offline actually just edits the httpd.conf file changing
Offline='Require local` to
Online='Require all granted`
for the WAMPServer home page folder \wamp\www so it is more secure to leave this Offline as you rearely if ever want to allow access to that folder to the universe.
Also if your network is accessible from the internet this basically allows access from anywhere.

---------------------------------------------------------------------------------------------
(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: Share website on local network with WAMP
Posted by: funkyfrank (---.234.27.17.81.swissinet.com)
Date: November 25, 2014 12:53AM

Thank you for your reply Riggs!!

Apart from the way with the Hosts file on the target machine is there a quick and dirty way to preview the document root on the local network?

I am either looking at a home dns server or changing hosts files on each local client? Is there a thir option? Perhaps with Apache that is already installed? Is there a not an option similar to VHosts to send local incoming requests on port 80 to a set document root dir?

Ideally if I could browse the folder with all the web projects in them in the browser and then when clicking on any of the folders I get to the working site instead of just viewing the html css php etc files in the browser, that would really be excellent.

At the moment I am looking into making a home dns server since it would be great to be able to resolve *.dev domains locally.

Will a home dns server enable me to have any domain name on .dev on the local network and resolve to Apache and from there to the correct working folder/doc root as long as the entry is in the VHost list?

If this can be done have you got any suggestions where to start?

[maradns.samiam.org] ?

[drupalmotion.com] ?

[superuser.com] ?

As for the rest of your reply, thank you very much, this all explained it very well and will be of much use in the future. I am sure these questions come up a lot so thanks for helping out!

Best Regards
Frank

Version of Operating system? Windows 7 Ultimate 64bit
Version of Wamp Server installed? 2.5 32bit
Version of Apache you are running? 2.4.9
Version of MySQL you are running? 5.6.17
Version of PHP you are running? 5.5.12
What colour is your WampManager icon? Green
Host file localhost 127.0.0.1

New to WAMP?
Read this please: [forum.wampserver.com]

Options: ReplyQuote
Re: Share website on local network with WAMP
Posted by: RiggsFolly (---.as43234.net)
Date: November 25, 2014 01:20AM

Quote

Ideally if I could browse the folder with all the web projects in them in the browser and then when clicking on any of the folders I get to the working site instead of just viewing the html css php etc files in the browser, that would really be excellent.

Yes but then you will have the problem of all your sites working off a single DocumentRoot.

This can cause problems later when you try to move sites from this structure to a LIVE server which will be configured with a specific DocumentRoot.

---------------------------------------------------------------------------------------------
(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: Share website on local network with WAMP
Posted by: funkyfrank (---.234.27.17.81.swissinet.com)
Date: November 25, 2014 01:39AM

Regarding the DocumentRoot, can you explain that a bit more detailed please? What exactly are we talking about? The folder where I keep all my web projects?


How would I get the sites to work off a single DocumentRoot? Heck if it is just for a tiny preview on the mobile for example..

What about the home DNS server, would you approve of the links? How would you go about this in a network of mac, android and windows devices?

Is routing with a home DNS server to *.dev domain possible and have each domain name correspond to an entry in the VHost file?

What software would you use?

Kind Regards
Frank

Version of Operating system? Windows 7 Ultimate 64bit
Version of Wamp Server installed? 2.5 32bit
Version of Apache you are running? 2.4.9
Version of MySQL you are running? 5.6.17
Version of PHP you are running? 5.5.12
What colour is your WampManager icon? Green
Host file localhost 127.0.0.1

New to WAMP?
Read this please: [forum.wampserver.com]

Options: ReplyQuote
Re: Share website on local network with WAMP
Posted by: RiggsFolly (---.as43234.net)
Date: November 25, 2014 11:37AM

Ok Frank I think I see what you are trying to do.

I have a similiar setup for little test beds and demo's I download to see how things work.


So I create a Virtual Host called 'testing' and in the document root of that site I create any number of sub folders like so :-

D:/websrc/testing/www

D:/websrc/testing/www/test1
D:/websrc/testing/www/test2
D:/websrc/testing/www/test3


The D:/websrc/testing/www folder does not contain an index.php or index.html it is just left empty.

Then when I point the browser to 'testing.dev' I get a directory listing in the browser and I can click on any or the folders. If there is an index.php in that folder it runs the sites homepage otherwise I can just click an any of the xxx.php files to run them standalone.


<VirtualHost *:80>
    DocumentRoot "D:/websrc/testing/www"
    ServerName testing.dev
    ServerAlias www.testing.dev

    <Directory "D:/websrc/testing/www">
	AllowOverride all
        Options Indexes FollowSymLinks

    	<IfDefine APACHE24>
    		Require local
    		Require ip 192.168.2
	</IfDefine>

	<IfDefine !APACHE24>
		Order Deny,Allow
    		Deny from all
    		Allow from 127.0.0.0/8 localhost ::1 192.168.2
    	</IfDefine>

    </Directory>
</VirtualHost>

---------------------------------------------------------------------------------------------
(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: Share website on local network with WAMP
Posted by: RiggsFolly (---.as43234.net)
Date: November 25, 2014 11:54AM

Frank,


Installing your own DNS Server!

Unless you are familiar with and or prepared to do a lot of research I would consider this a major project.
Editing a few HOSTS files on other PC may seem like a pain, but in the long run it may be a lot simpler and QUICKER than trying to get a DNS server to work and NOT screw up your normal internet access.



I would be interested to know how you get to one of your domains from a Phone!

I have always found this a bit of a pain as messing with the phones config is always rather difficult as they lock you out of all of the normal mechanisms.

I have a method I am more than willing to share but it does involve a bit of an odd mechanism and some other software, which I use in site debugging anyway but requires me basically set up a proxy and make that redirect access's on odd port numbers to the actual site on port 80.

---------------------------------------------------------------------------------------------
(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: Share website on local network with WAMP
Posted by: funkyfrank (---.234.27.17.81.swissinet.com)
Date: November 26, 2014 01:06PM

Quote

I have a method I am more than willing to share but it does involve a bit of an odd mechanism and some other software, which I use in site debugging anyway but requires me basically set up a proxy and make that redirect access's on odd port numbers to the actual site on port 80.

Yes, please do! SO happy to learn about this. Thank you for sharing your way.

While you share I am gearing up on the DNS server topic. Though very early stage still.
Been reading about it the past days.

To be able to limit my intake on this subject, or at least narrow down a bit, I am looking to set up what type of dns server? If you look at this document [www.zytrax.com] what type would that be?

I am trying to get there to ideally be able to feed the VHosts file with server names, allow local, and then add those to the HOST file on the machine with WAMP. Now simply by giving the domain.dev in any browser on the local network that requests gets forwarded to the machine running WAMP, resolving the request and serving the directory that is given in the VHosts file. Would that work?

For this kind of thing to work the DNS server needs to be what type?

If normal DNS requests from all clients get routed to the normal outside DNS servers I use and only the specific domains, domain.dev for example, gets looked up locally and served locally.

What type of DNS server would I need to set up for this to work?

Even happy with forwarding DNS requests through the machine running WAMP since that is on 24/7. So have one deskop, serve local *.dev domains locally and let in out all other dns traffic, if must be through the desktop.

And again, is this at all possible with a DNS server or is this something I cannot expect from a local DNS server?

If you find time, let me know what you think, happy to chat if you have a moment, for now, it would be great to hear about your method with the Proxy, so yes, please share it.

Laters
Frank

Version of Operating system? Windows 7 Ultimate 64bit
Version of Wamp Server installed? 2.5 32bit
Version of Apache you are running? 2.4.9
Version of MySQL you are running? 5.6.17
Version of PHP you are running? 5.5.12
What colour is your WampManager icon? Green
Host file localhost 127.0.0.1

New to WAMP?
Read this please: [forum.wampserver.com]

Options: ReplyQuote
Re: Share website on local network with WAMP
Posted by: RiggsFolly (---.as43234.net)
Date: November 26, 2014 03:57PM

Hi Frank,

I am not qualified to give advice on DNS Servers. Like I said if you want to go that way, its going to be a major project for you.
It would not be my prefered solution, but if you want to play with 1000 things you dont yet understand rather than just Apache, MySQL, PHP and WAMPServer, then feel free, but you are going to have to look for help else where.


All I will say is that the DNS you setup should only contain references to your specific local websites. If it see's anything else it should pass the request out to a real DNS Server, Authoratative I believe is the term, or the whole internet is going to disapear below the horizon and you are going to feel very alone!! Either that or you may find your PC goes into meltdown servicing millions of request and your disk space or memory will disappear.


Here is a link to Fiddler and the mechanism I use to get from a phone to a website hosted on one of my PC's

---------------------------------------------------------------------------------------------
(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: Share website on local network with WAMP
Posted by: funkyfrank (---.98.148.43.179.swissinet.com)
Date: December 16, 2014 04:28PM

Hi Riggs

In the meantime I have been digging into various dns servers and found quite a bit of material and tutorials on the scenario I have in mind. For this mostly BIND is used.

Would you mind sharing your opinion on if you would use a dns server locally which one would it be? Are the security concerns with BIND over djbdns [cr.yp.to] true to this day? Wiki describes BIND as industry standard though what I read about djbdns [www.lifewithdjbdns.org] makes me want to go that route. More than any technical question I just really looking for an opinion in this matter. If you are happy to share your aspects I am all ears.

Thank you.

Cheers
Frank

Version of Operating system? Windows 7 Ultimate 64bit
Version of Wamp Server installed? 2.5 32bit
Version of Apache you are running? 2.4.9
Version of MySQL you are running? 5.6.17
Version of PHP you are running? 5.5.12
What colour is your WampManager icon? Green
Host file localhost 127.0.0.1

New to WAMP?
Read this please: [forum.wampserver.com]

Options: ReplyQuote
Re: Share website on local network with WAMP
Posted by: funkyfrank (---.eu)
Date: January 09, 2015 01:26PM

Quote

Re: Share website on local network with WAMP
Posted by: RiggsFolly (---.as43234.net)
Date: November 25, 2014 11:37AM

Ok Frank I think I see what you are trying to do.

I have a similiar setup for little test beds and demo's I download to see how things work.


So I create a Virtual Host called 'testing' and in the document root of that site I create any number of sub folders like so :-

D:/websrc/testing/www

D:/websrc/testing/www/test1
D:/websrc/testing/www/test2
D:/websrc/testing/www/test3


The D:/websrc/testing/www folder does not contain an index.php or index.html it is just left empty.

Then when I point the browser to 'testing.dev' I get a directory listing in the browser and I can click on any or the folders. If there is an index.php in that folder it runs the sites homepage otherwise I can just click an any of the xxx.php files to run them standalone.


<VirtualHost *:80>
DocumentRoot "D:/websrc/testing/www"
ServerName testing.dev
ServerAlias www.testing.dev

<Directory "D:/websrc/testing/www">
AllowOverride all
Options Indexes FollowSymLinks

<IfDefine APACHE24>
Require local
Require ip 192.168.2
</IfDefine>

<IfDefine !APACHE24>
Order Deny,Allow
Deny from all
Allow from 127.0.0.0/8 localhost ::1 192.168.2
</IfDefine>

</Directory>
</VirtualHost>

Hey Riggs, Happy New Year to you!

By the way thank you for this post, going over it just now again and saw I never replied to it particularly, though now I tested this method and it works as a workbench/testing ground very well.

Thank you!

Version of Operating system? Windows 7 Ultimate 64bit
Version of Wamp Server installed? 2.5 32bit
Version of Apache you are running? 2.4.9
Version of MySQL you are running? 5.6.17
Version of PHP you are running? 5.5.12
What colour is your WampManager icon? Green
Host file localhost 127.0.0.1

New to WAMP?
Read this please: [forum.wampserver.com]



Edited 1 time(s). Last edit at 01/09/2015 01:28PM by funkyfrank.

Options: ReplyQuote
Re: Share website on local network with WAMP
Posted by: RiggsFolly (---.as43234.net)
Date: January 09, 2015 03:45PM

Hi Frank,

And a Happy New year to you too.

Glad to be of assitance.

---------------------------------------------------------------------------------------------
(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: Share website on local network with WAMP
Posted by: Otomatic (Moderator)
Date: January 09, 2015 04:22PM

Hi,

In place of
<IfDefine APACHE24>
that is a variable that must be defined in httpd.conf, we can use
<IfVersion >= 2.4>
that works even if the variable is not defined.
In place of
<IfDefine !APACHE24>
we can use
<IfVersion !>= 2.4>

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

Options: ReplyQuote
Re: Share website on local network with WAMP
Posted by: RiggsFolly (---.as43234.net)
Date: January 09, 2015 07:52PM

Yes you can, but you have to remember to active mod_version in the httpd.conf and that is not activated by default.

So they used IfDefine which is part of the Apache core and therefore should work without the need to activate another module.

It keeps it simpler and therefore reduces the possibility for things to be forgotten when building a new release I guess.

---------------------------------------------------------------------------------------------
(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


Sorry, only registered users may post in this forum.