LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 05-03-2005, 01:13 PM   #1
setenv02
Member
 
Registered: Apr 2005
Location: Chicago,IL
Distribution: redhat 9
Posts: 32

Rep: Reputation: 15
virtual hosting


I need help with name based virtual hosting. When I configure the virtualhosts for one domain it doesn't use the default page that I requested. Both domains visit the same page and thats not what I want. I was wondering whats the right configuration to put in the httpd.conf file for name based virtual hosting. I need basic configuration to be added to the file.
 
Old 05-03-2005, 01:17 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 65
Take a look at the examples here:
http://httpd.apache.org/docs/vhosts/name-based.html

If you still have problems then try posting the relevant part of httpd.conf so we can see your current configuration.
 
Old 05-03-2005, 07:09 PM   #3
setenv02
Member
 
Registered: Apr 2005
Location: Chicago,IL
Distribution: redhat 9
Posts: 32

Original Poster
Rep: Reputation: 15
I am still having problems, here is my virtual host configuration.
NameVirtualHost 192.168.1.2
<VirtualHost www.setenv.gotdns.org>
DirectoryIndex /var/bin/index.htm
NameVirtualHost setenv.gotdns.org:80
DocumentRoot /var/bin
ServerName setenv.gotdns.org
ErrorLog logs/error_1.log
TransferLog logs/transfer_1.log
</virtualhost>
 
Old 05-04-2005, 03:47 AM   #4
ivanatora
Member
 
Registered: Sep 2003
Location: Bulgaria
Distribution: Ubuntu 9.10, FreeBSD 7.2
Posts: 459

Rep: Reputation: 31
You need to made a vhost for each of the hosted pages. Try not to write the vhost name in <Virtual Host <here>> section, but instead write it as that:
<Virtual Host *:80> #if you run apache at port 80
ServerName www.setenv.gotdns.org
... other options... drop ServerName...
</Virtual Host>
Respective for the other vhost.
This works in Apache 1.3.27

Last edited by ivanatora; 05-04-2005 at 03:48 AM.
 
Old 05-04-2005, 04:13 PM   #5
setenv02
Member
 
Registered: Apr 2005
Location: Chicago,IL
Distribution: redhat 9
Posts: 32

Original Poster
Rep: Reputation: 15
Virtual hosts still do not work. This is what I have pasted into my httpd.conf file, check it out.
NameVirtualHost 192.168.1.2
<VirtualHost *:80>
DirectoryIndex /var/bin/index.htm
DocumentRoot /var/bin
ServerName setenv.gotdns.org
ErrorLog logs/error_1.log
TransferLog logs/transfer_1.log
</virtualhost>
 
Old 05-04-2005, 05:50 PM   #6
msound
Member
 
Registered: Jun 2003
Location: SoCal
Distribution: CentOS
Posts: 465

Rep: Reputation: 30
heres mine: (httpd.conf)

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

<VirtualHost *:80>
ServerAdmin you@yourdomain.com
ServerPath /var/bin
DocumentRoot /var/bin/html
ScriptAlias /cgi-bin /var/bin/cgi-bin
DirectoryIndex index.html index.htm index.php
ServerName www.yourdomain.com
ErrorLog /var/log/httpd/error_log
CustomLog /var/log/httpd/access_log common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin you@yourdomain2.com
ServerPath /var/bin2
DocumentRoot /var/bin2/html
ScriptAlias /cgi-bin /var/bin2/cgi-bin
DirectoryIndex index.html index.htm index.php
ServerName www.yourdomain2.com
ErrorLog /var/log/httpd/error_log
CustomLog /var/log/httpd/access_log common
</VirtualHost>

enjoy
 
Old 05-05-2005, 03:35 AM   #7
ivanatora
Member
 
Registered: Sep 2003
Location: Bulgaria
Distribution: Ubuntu 9.10, FreeBSD 7.2
Posts: 459

Rep: Reputation: 31
Setenv02: you nead at least 2 <vritual host> sections - one for each vhost. There isn't meaning to make only one vhost, right?
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Hosting? nr5 Linux - Software 10 06-03-2005 02:30 PM
Virtual hosting... id10t Linux - Networking 4 02-02-2004 06:43 PM
Virtual Hosting - what does it actually do? gevers1 Linux - General 3 02-01-2004 10:28 AM
Virtual Hosting joseph Linux - General 3 08-20-2003 05:16 AM
Virtual Hosting marson Linux - General 2 12-28-2000 09:14 PM


All times are GMT -5. The time now is 03:49 AM.

Main Menu
Advertisement
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