LinuxQuestions.org
Visit Jeremy's Blog.
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 02-05-2004, 10:45 PM   #1
viniosity
Member
 
Registered: Oct 2001
Location: Washington, DC
Distribution: Debian, Archlinux, Ubuntu, Sidux
Posts: 244

Rep: Reputation: 30
apache2 virtual hosts


I'm trying to get virtual hosts working with apache2. I had it working once (thanks to viewing other posts in this forum) and I don't think I changed my httpd.conf file but it's not working anymore. Can you all check out this part of my /usr/loca;/apache2/conf/httpd.conf file and let me know if you see any errors? (in this example two domains are replaced by foo.com and foo2.com) Many thanks!

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

#
# 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 *>
# 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>
<VirtualHost *>
#ServerAdmin webmaster@foo.com
#ServerPath /foo/
ServerName www.foo.com:80
ServerAlias foo.com store.foo.com
DocumentRoot /usr/local/jakarta-tomcat-3.3.1/webapps/foo
#JkMount /*.jsp ajp13
ErrorLog logs/foo.com-error_log
# CustomLog logs/foo.com-access_log common
</VirtualHost>
<VirtualHost *>
#ServerAdmin webmaster@foo2.com
#ServerPath /foo2/
ServerName www.foo2.com
ServerAlias store.foo2.com foo2.com
DocumentRoot /usr/local/jakarta-tomcat-3.3.1/webapps/foo2
ErrorLog logs/foo2.com-error_log
#CustomLog logs/foo2.com_log common
</VirtualHost>

Include /usr/local/jakarta-tomcat-3.3.1/conf/auto/mod_jk.conf
 
Old 02-06-2004, 01:29 AM   #2
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
What are you getting from the server now?
 
Old 02-06-2004, 05:13 AM   #3
kevinatkins
Member
 
Registered: Jan 2004
Location: cheshire, uk
Distribution: Ubuntu Hoary
Posts: 605

Rep: Reputation: 33
I think that your /etc/hosts file must contain the host names you intend to use....
 
Old 02-07-2004, 12:43 AM   #4
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
Not really, unless there's no dns entry.
 
Old 02-07-2004, 01:15 AM   #5
z-man
LQ Newbie
 
Registered: Feb 2004
Location: Montreal
Distribution: Mandrake
Posts: 5

Rep: Reputation: 0
why port in ServerName
ServerName www.foo.com:80

Maybe this helps
http://httpd.apache.org/docs/mod/core.html#listen

also hash ServerName in httpd.conf if you use virtual hosts



Hope this helps
 
  


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
Problems setting up virtual hosts with debian sarge and apache2 dthacker Debian 1 11-23-2005 06:25 PM
Subdomains on Apache2 with virtual hosts - how? <Ol>Origy Linux - Networking 2 08-18-2005 06:53 AM
SuSE 9.2 - apache2 & tomcat5 - how to configure VIRTUAL HOSTS & JSP? nicolasdiogo Linux - Networking 2 03-20-2005 09:06 AM
Apache2 Virtual Dynamic Hosts and defaults techrolla Linux - Networking 1 11-01-2004 05:01 PM
Apache2, SSL, 2 Virtual Hosts franticbob Linux - Software 0 04-07-2004 10:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:50 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