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.

Virtual host - only one recognised

Featured Replies

Hi,

 

I just started with Uniform Server and I just love the portability. There is just one little thing I can't get to work. And that is the Virtual host.

 

I used virtual host before on linux so i figured this would be a breeze. But somehow apache only uses the first virtual host entry. To make is easy i'm using 'test' as alias. So my hosts file in c:\windows\system32\driver\etc contains the following line:

 

127.0.0.1 test

 

on the bottom of my httpd.conf file there is the following:

 

<VirtualHost *>

DocumentRoot /www/test

ServerName test

</VirtualHost>

 

I tryed restarting windows and using fresh installations, but when I paste this peace of code in my httpd.conf file apache directs everything to the test map. So both http://localhost and http://test gets me to /www/test . When i'm using more virtual hosts only the first is used.

 

I'm stuck here and it would be great if anyone could point me in de right direction here.

Your set-up is working correctly.

 

The address you have supplied http://localhost is not recognised by Apache so cannot be found hence uses the default which is always the first VirtualHost.

 

This page explains it in more detail:

 

http://center.uniformserver.com/virtual_ho...ual_host_1.html

 

All the best :rolleyes:

  • Author

But when I add the following to my httpd.conf file:

 

<VirtualHost *>

DocumentRoot /www/test

ServerName test

</VirtualHost>

 

<VirtualHost *>

DocumentRoot /www/test2

ServerName test2

</VirtualHost>

 

It always goes to the 'test' map. So both http://test and http://test2 point to the /www/test directory. The /www/test2 map does exists and has a very simple index.html file in it.

 

It's like it always uses the default. What am I doing wrong?

  • Author

Try uncommenting this:

 

NameVirtualHost *

 

 

 

Whoohoo :rolleyes: :unsure: :angry: It works!

 

Great, now i can start using the uniform server. Thanks!

 

Why is it that uncommenting NameVirtualHost * fixes my problem?

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.