name in virtual hosts

joyacv2
joyacv2 used Ask the Experts™
on
Hi,

I have the following code in /etc/apache2/sites-available/testSite


NameVirtualHost 10.123.108.80

<VirtualHost 10.123.108.80>
       DocumentRoot /var/www/turnos
        ServerAdmin webmaster@localhost
        ServerAlias www.test.com
        ServerName test.com
</VirtualHost>

When i enter the ip all works well, go directly to the turnos folder, but how I can make the alias and server name to work?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Do you have DNS records configured for "www.test.com" and "test.com" so that it resolves to your server's IP address?

Also if you server is behind a router, and you are accessing it from your external WAN IP address, you may need to change the configuration so that it will work for any IP address instead of just the 10.123.108.80. E.g.:

NameVirtualHost *:80

<VirtualHost *:80>
       DocumentRoot /var/www/turnos
        ServerAdmin webmaster@localhost
        ServerAlias www.test.com
        ServerName test.com
</VirtualHost>

Open in new window

Author

Commented:
Hi,

Is internal network, how i configure the dns records?

Commented:
create a local dns and use it around the network.

TY/SA

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial