Jump to content
View in the app

A better way to browse. Learn more.

The Uniform Server Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to access vhosts over LAN?

Featured Replies

How can I access my sites from other computers on the same LAN?

http://192.168.0.### (the server's internal IP address) shows me the splash/welcome screen in the C:\UniServerZ/www/ directory.

But how can I view C:\UniServerZ/vhosts/my-website?

  • Author

P.S. I see tutorials on altering Apache files "by hand" but am concerned this could affect the Uniform Server's performance, or that I will confuse the /www and /vhosts in Uniform server's setup (vs. the seemingly random naming of other wamp/xampp/what have you setups out there), or there is already something in the interface to do this, which I am too much of a newbie to recognize as such.

Any helps, including URLs, are most appreciated.

  • 3 months later...

Hellow, try to do like this

 

For example: Your server hosted on IP: 192.168.0.10

 

Enable virtual host in httpd.conf

##====== VIRTUAL HOST ===========
#To enable uncomment next line
Include conf/extra/httpd-vhosts.conf

Edit httpd-vhosts.conf

# Case 1 : if Access from any local IP  though 192.168.0.xx by taping http://192.168.0.10 on browser 
<VirtualHost _default_:${AP_PORT}>
	ServerAdmin admin@localhost
	DocumentRoot ${US_ROOTF}/vhosts/my-website
	ServerName ${US_SERVERNAME}
	ErrorLog  logs/my-website-error.log
	CustomLog logs/my-website-access.log common
	
	<Directory "${US_ROOTF}/vhosts/my-website/">
		Options Indexes Includes
		AllowOverride All
		Require all granted	
			
	</Directory>	
</VirtualHost>


# Case 2: If access from any local ip though a virtual server's name
#         For each local client,
#  	  You need to bind your virtual server's name with your server IP in Windows hosts file
#	  Open Notepad as administrator and load C:\Windows\System32\drivers\etc\hosts
#         Add after the last line
#         192.168.0.10	my-website 
#         Now each client from local ip 192.168.0.xx can access on browser by http://my-website

<VirtualHost *:80>
	ServerAdmin admin@localhost
	DocumentRoot ${US_ROOTF}/vhosts/my-website
	ServerName my-website
	ErrorLog  logs/my-website-error.log
	CustomLog logs/my-website-access.log common
	
	<Directory "${US_ROOTF}/vhosts/my-website/">
		Options Indexes Includes
		AllowOverride All
		Require all granted	
			
	</Directory>	
</VirtualHost>

Restart your Apache.

Now you can access to your site from your LAN by server IP (

 

Hope it will help even to late ;)

  • 1 year later...

Hellow, try to do like this

 

For example: Your server hosted on IP: 192.168.0.10

 

Enable virtual host in httpd.conf

##====== VIRTUAL HOST ===========
#To enable uncomment next line
Include conf/extra/httpd-vhosts.conf

Edit httpd-vhosts.conf

# Case 1 : if Access from any local IP  though 192.168.0.xx by taping http://192.168.0.10 on browser 
<VirtualHost _default_:${AP_PORT}>
	ServerAdmin admin@localhost
	DocumentRoot ${US_ROOTF}/vhosts/my-website
	ServerName ${US_SERVERNAME}
	ErrorLog  logs/my-website-error.log
	CustomLog logs/my-website-access.log common
	
	<Directory "${US_ROOTF}/vhosts/my-website/">
		Options Indexes Includes
		AllowOverride All
		Require all granted	
			
	</Directory>	
</VirtualHost>


# Case 2: If access from any local ip though a virtual server's name
#         For each local client,
#  	  You need to bind your virtual server's name with your server IP in Windows hosts file
#	  Open Notepad as administrator and load C:\Windows\System32\drivers\etc\hosts
#         Add after the last line
#         192.168.0.10	my-website 
#         Now each client from local ip 192.168.0.xx can access on browser by http://my-website

<VirtualHost *:80>
	ServerAdmin admin@localhost
	DocumentRoot ${US_ROOTF}/vhosts/my-website
	ServerName my-website
	ErrorLog  logs/my-website-error.log
	CustomLog logs/my-website-access.log common
	
	<Directory "${US_ROOTF}/vhosts/my-website/">
		Options Indexes Includes
		AllowOverride All
		Require all granted	
			
	</Directory>	
</VirtualHost>

Restart your Apache.

Now you can access to your site from your LAN by server IP (

 

Hope it will help even to late ;)

i did as you said but still doesnt work for me. some one??

 

 

  • 1 year later...

virtual hosts need their own way of being recognised - a shared IP address among 6 virtual hosts won't work..

So you use a name - a domain name. A few problems.. you need a different one for each host (or subdomains) and you need to register them.. You also need to setup apache to handle them (plenty of guides online for that).

The REAL problem though is that if you want to access them over a local network then you need two things: domain (either locally hosted or via a public dns) and a proper dns setup in your windows machines.

So.. I chose to have local names - like home.lan, admin.lan, inventory.lan...

To use them apache has to be configured.

Then you need a local dns nameserver on your webserver PC - setup those domains on there and it will serve any local requests with the IP address of your apache enabled pc.

The real issue though is that for many networks you'd need to then reconfigure every devices dns settings. If they're all on dynamic IP address's it's easier to use a dhcp server - when each device requests it's IP address the dhcp server can also reply with the ip address of a dns server to use - in this case the one you have your domains on. 

I do have very crude versions of a dns and dhcp server but they're not ready for release really. I might offer them to the US developers for future releases so make the virtual host setup workable out of the box for users.

  • 3 years later...

Edit server's httpd.conf file at: \wamp\bin\apache\apache2.2.x\conf\httpd.conf. Search for " Listen " (around line 61). 
Edit the httpd-vhosts.conf file at: \wamp\bin\apache\apache2.2.x\conf\extra\httpd-vhosts.conf. 
Restart Apache server.

  • 7 months later...
On 2/27/2023 at 5:40 AM, Jameswalter said:

Edit server's httpd.conf file at: \wamp\bin\apache\apache2.2.x\conf\httpd.conf. Search for " Listen " (around line 61). 
Edit the httpd-vhosts.conf file at: \wamp\bin\apache\apache2.2.x\conf\extra\httpd-vhosts.conf. 
Restart Apache server.

That will do nothing.

When a browser requests a website it needs an ip address to send it to. Once it connects to that IP it then sends a text request of the hostname / website it is requesting.

Configuring apache will allow it to accept those requests. It will not tell other browsers where to send their requests in the first place.

Read my reply above yours.

  • 8 months later...

You need to redirect port 80 (HTTP) from your computer to the computer running the Apache web server.
You can do this through your router or firewall settings. The port number you use for redirection may be different, so check your router or firewall documentation.

  • 5 months later...

If the port is anything other than the standard 80, it's really worth checking the device's documentation to make sure it's configured correctly.

  • 2 months later...
On 7/3/2024 at 8:19 PM, Dima D said:

You need to redirect port 80 (HTTP) from your computer to the computer running the Apache web server.
You can do this through your router or firewall settings. The port number you use for redirection may be different, so check your router or firewall documentation.

 

On 12/26/2024 at 1:41 PM, ZaraLee said:

If the port is anything other than the standard 80, it's really worth checking the device's documentation to make sure it's configured correctly.

Port redirection is only needed for computers accessing apache from the outside world through the network router.

The op has asked how to make virtual hosts available from INSIDE the network to other computers on the network internally.

With respect, none of you have understood this problem correctly and thus you are providing the wrong answers.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.