LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-02-2005, 02:36 PM   #1
mac_casey
Member
 
Registered: Jun 2002
Location: Edmonton
Distribution: SUSE 10
Posts: 62

Rep: Reputation: 15
vhost container - Apache namebased virtual host problems


Greetings everyone,

Okay here is my situation. Im confused with what i have read and am look for clarification. I am using Apache and NameVirutalHost so that i can host a few of my own domains. I am using Mandrake 10.1 Official just so i am clear.

I have read about how to enter your NameVirutalHost entried into the vhosts.conf file. But i am having problems when i have more than one entry. For example

<VirtualHost *>
ServerName test1.com
ServerAlias www.test1.com
ServerPath /test1
DocumentRoot /var/www/html/test1
DirectoryIndex default.php
ServerAdmin info@domain.com
</VirtualHost>

<VirtualHost *>
ServerName test2.com
ServerAlias www.test2.com
ServerPath /test2
DocumentRoot /var/www/html/test2
DirectoryIndex default.php
ServerAdmin info@domain2.com
</VirtualHost>

From what i read i need to make these intries into the vhost.conf file right? On a pevious apache version (redhat #?) all i did was edit the httpd.conf file. Has things changed? Please help

I also read my httpd.conf file on my mandrake box (the one im using right now and it only seems to look at this statement

Include conf/vhosts/Vhosts.conf

Is this where i should have multiple vhost.conf files entered into my httpd.conf file so that it knows to look for these named virtual hosts?

Please advise ...i really need the help. Im a Newbie (groan)
 
Old 01-02-2005, 04:33 PM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
At least with Apache 1.3, you can (should?) have your virtual hosts declaration in the httpd.conf file. Have a look there, even if you are using Apache 2 since the httpd.conf file gives examples of the input it expects. If you find a virtual hosts example in httpd.conf, you should be able to add your servers there.
 
Old 01-02-2005, 08:10 PM   #3
mac_casey
Member
 
Registered: Jun 2002
Location: Edmonton
Distribution: SUSE 10
Posts: 62

Original Poster
Rep: Reputation: 15
This is all that my httpd says


###
### Virtual Hosts
###
# We include different templates for Virtual Hosting. Have a look in the
# vhosts directory and modify to suit your needs.
Include conf/vhosts/Vhosts.conf
#Include conf/vhosts/DynamicVhosts.conf
#Include conf/vhosts/VirtualHomePages.conf



This is what the vhost.conf says


################# IP-based Virtual Hosts
#<VirtualHost 192.168.2.100>
#User jmdault
#Group jmdault
#DocumentRoot /home/jmdault/public_html
#ServerName test2.com
#Setenv VLOG /home/jmdault/logs
#ErrorLogs /home/jmdault/test2-error_log
#RewriteEngine On
#RewriteOptions inherit
#</VirtualHost>

################# Named VirtualHosts
#NameVirtualHost 111.222.33.44
#<VirtualHost 111.222.33.44>
#ServerName www.domain.tld
#ServerPath /domain
#DocumentRoot /web/domain
#</VirtualHost>


I should also point out

PHP VERSION: 4.3.8 (apache2handler), SQL: (MYSQL) 4.0.20

Last edited by mac_casey; 01-02-2005 at 08:15 PM.
 
Old 01-03-2005, 07:25 AM   #4
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Well, after looking at the Apache documentation , it looks as if either approach, httpd.conf or vhosts.conf is acceptable. The sections on name-based virtual hosting give examples modifying httpd.conf, but if you look in the core modules section, it gives and example of using the include module to add other configuration files. I've succesfully used name-based virtual hosting by modifying my httpd.conf with Apache 1.3, and the documentation for 2.0 still suggests httpd.conf. If vhosts.conf is giving you a problem, I'd just go with modifying httpd.conf and comment out the include vhosts.conf statment.
 
  


Reply



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: Alias is working on ssl vhost but not on mass vhost jonavogt Linux - Software 0 06-07-2005 02:05 PM
Apache virtual host problems Baltasar Linux - Software 8 07-22-2004 07:58 PM
Encrypted virtual drive/container magkakape Linux - Software 2 06-22-2004 07:27 AM
Apache virtual host problems.. Swene Linux - Networking 0 05-02-2002 12:23 PM
How-to setup on Apache some Multiple Namebased Virtual Websites with cgi-bin FunkFlex Linux - Newbie 0 02-08-2002 08:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:08 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
Open Source Consulting | Domain Registration