LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

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

Rep: Reputation: 15
Apache Virtual Host query


Dear friends,

This is my httpd.conf
NameVirtualHost 192.168.0.6:80

<VirtualHost 192.168.0.6:80>
DocumentRoot /var/www/vhosts/project-manager/v1.0
ServerName pm.bnv.local
</VirtualHost>

<VirtualHost 192.168.0.6:80>
DocumentRoot /var/www/vhosts/accounting/v2.0
ServerName accounting.bnv.local
</VirtualHost>

The issue is when I write 192.168.0.6 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, 06:44 AM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
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, 08:05 AM   #3
ScooterB
Member
 
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, 01: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, 05:28 AM   #5
Atif_Khan
Member
 
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.
 
  


Reply


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 05:49 AM
apache and virtual host voip_tech_2004 Red Hat 1 04-12-2006 11:36 AM
Apache - Name virtual host tisource Linux - Networking 5 03-03-2006 02:52 AM
Virtual host and apache Samspeed Linux - General 8 08-06-2003 07:41 AM
apache virtual host mimi Linux - General 1 04-06-2002 05:11 AM


All times are GMT -5. The time now is 11:35 AM.

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