Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 01-15-2007, 01:08 AM   #1
Registered: Sep 2004
Distribution: CentOS, Slackware, Solaris, Ubuntu
Posts: 66

Rep: Reputation: 15
Apache Virtual Host query

Dear friends,

This is my httpd.conf

DocumentRoot /var/www/vhosts/project-manager/v1.0
ServerName pm.bnv.local

DocumentRoot /var/www/vhosts/accounting/v2.0
ServerName accounting.bnv.local

The issue is when I write in the browser it loads the pm.bnv.local by default. I want to have Apache test page when someone types the IP in the browser.
Old 01-15-2007, 07:44 AM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
I don't think this would be a problem if this was the only site in your conf but since you have multiple virtual hosts, it's going to direct to the default and use the ServerName defined. Why would the name make any difference? Most associate names better than IP Addresses..
Old 01-15-2007, 09:05 AM   #3
Registered: Sep 2003
Location: NW Arkansas
Distribution: Linux Redhat 9.0, Fedora Core 2,Debian 3.0, Win 2K, Win95, Win98, WinXp Pro
Posts: 344

Rep: Reputation: 31
Another idea (and the one that I use) is to just give the second virtual host a different private IP address. Then there aren't any issues.
Old 01-16-2007, 02:21 AM   #4
Wim Sturkenboom
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Add a third virtual host before all others and let that point to the apache testpage. Although it's not guaranteed (as far as I know) that it will use that one, the chances are good that it will use it as the default.
Old 01-16-2007, 06:28 AM   #5
Registered: Sep 2004
Distribution: CentOS, Slackware, Solaris, Ubuntu
Posts: 66

Original Poster
Rep: Reputation: 15
Thanks Guys,

Wim your proposed solution worked for me. Thanks for help.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
apache virtual host help? paddyjoy Linux - Server 4 09-19-2006 06:49 AM
apache and virtual host voip_tech_2004 Red Hat 1 04-12-2006 12:36 PM
Apache - Name virtual host tisource Linux - Networking 5 03-03-2006 03:52 AM
Virtual host and apache Samspeed Linux - General 8 08-06-2003 08:41 AM
apache virtual host mimi Linux - General 1 04-06-2002 06:11 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:59 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration