LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-21-2006, 11:09 AM   #1
mnm_mc
Member
 
Registered: Sep 2004
Distribution: SuSE 10 & RedHat
Posts: 35

Rep: Reputation: 15
Config file for Apache name-based virtual hosting


I am trying to configure the config file to host more than one website using name-based virtual hosting.

i am using Apache/2.0.54 (Linux/SUSE) and followed the directions at:


http://httpd.apache.org/docs/2.0/vhosts/name-based.html


NameVirtualHost *:80

<VirtualHost *:80>

ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain

</VirtualHost>

<VirtualHost *:80>

ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain

</VirtualHost>

This is all that I have done on the config file, of course I changed the domain names

I am wondering if there is more than just doing that?

thanks Mike
 
Old 03-21-2006, 11:16 AM   #2
zeitounator
Member
 
Registered: Aug 2003
Location: Montpellier, France, Europe, World, Solar System
Distribution: Debian Sarge, Fedora core 5 (i386 and x86_64)
Posts: 262

Rep: Reputation: 30
What is wrong with this configuration or what does not work as expected ?
 
Old 03-21-2006, 11:40 AM   #3
mnm_mc
Member
 
Registered: Sep 2004
Distribution: SuSE 10 & RedHat
Posts: 35

Original Poster
Rep: Reputation: 15
ya it doesn`t work, it just works only if I have two IPs (which it is setup on now, so I am running two webservers and would like to run just one and contain the websites on one system

I am wondering if I need to modify the file anymore than I have already.
 
Old 03-21-2006, 11:51 AM   #4
zeitounator
Member
 
Registered: Aug 2003
Location: Montpellier, France, Europe, World, Solar System
Distribution: Debian Sarge, Fedora core 5 (i386 and x86_64)
Posts: 262

Rep: Reputation: 30
What is the configuration of your default server in httpd.conf ? Can you access it from http://localhost or http://127.0.0.1 or http://yourIP ?

Did you bind apache to the correct ip (the one that corresponds to the dns entry for the domains - look at the 'listen' directive) ?
 
Old 03-21-2006, 12:34 PM   #5
mnm_mc
Member
 
Registered: Sep 2004
Distribution: SuSE 10 & RedHat
Posts: 35

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by zeitounator
What is the configuration of your default server in httpd.conf ? Can you access it from http://localhost or http://127.0.0.1 or http://yourIP ?

Did you bind apache to the correct ip (the one that corresponds to the dns entry for the domains - look at the 'listen' directive) ?
crap the config file has no entries, I am using both windows and linux, i think the problem is windows...go figure eh?

when i set up apache on linux it was simple and all i did was copy an index page and related files into the /srv/www/htdocs and it worked. I didnt have to even touch the config file.

using apache on windows was a little more of a setup and different directory structure.

I am going to try and modify the config file and it will more than likely work.

I will post a repsonse and let you know if it works, thanks for your help mike
 
Old 03-22-2006, 03:29 AM   #6
mnm_mc
Member
 
Registered: Sep 2004
Distribution: SuSE 10 & RedHat
Posts: 35

Original Poster
Rep: Reputation: 15
geez i just cant seem to get the dam thing to work...can someone help with this?


I made the changes as per named host and still nothing....

I am just wondering as when I setup apache some info was input into the config file such as email and domain name.

so by default the first domain shows up, so do i need to comment those entries out then try the domains with the config file?

Or do I just add the secondary domain to the virtual host and call it good?
thanks for any help or insight! mike

here is the section I got off the net and input it into the config file, the lines are unchanged so far and are commented out.

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

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

Last edited by mnm_mc; 03-22-2006 at 03:32 AM.
 
  


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
name based virtual hosting jkmartha Linux - Software 4 08-04-2005 09:21 AM
name based virtual hosting adm1329 Linux - Networking 5 05-05-2004 11:30 AM
Trouble with Named based Virtual hosting in Apache 2 IanChristie Linux - Networking 16 11-07-2003 02:04 PM
named based virtual hosting newbie nickblue Linux - Networking 9 08-04-2003 11:39 PM
name-based virtual hosting and corresponding DNS entries roba Linux - General 0 08-14-2002 04:08 PM


All times are GMT -5. The time now is 08:48 PM.

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