LinuxQuestions.org
Review your favorite Linux distribution.
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 07-08-2003, 12:58 PM   #1
Spaz17
Member
 
Registered: Jul 2003
Location: Somewhere, over the rainbow, way up high
Distribution: Gentoo
Posts: 132

Rep: Reputation: 15
apache


i cannont get multiple web address to run on one ip address
ive done exactly what apaches online manual says
o yea ive got apache 2.0.46
anyway, i listen to port 80
my main host is the same as my first virtual host
i have all hosts listening to all ips
i do not know what is wrong
help?
 
Old 07-08-2003, 01:14 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 261Reputation: 261Reputation: 261
Well, any error messages when restarting your apache server? Can you post your httpd.conf file with the portion of the virtual hosts defined in it here?
 
Old 07-08-2003, 01:16 PM   #3
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
Are the other DNS entries pointing to the host?
Have you restarted apache?

Can you post the virtualhost section of httpd.conf
 
Old 07-08-2003, 02:12 PM   #4
Spaz17
Member
 
Registered: Jul 2003
Location: Somewhere, over the rainbow, way up high
Distribution: Gentoo
Posts: 132

Original Poster
Rep: Reputation: 15
ya i can restart with no problem
i changed the domain names to protect the innocent
--------------------------------
NameVirtualHost *

<VirtualHost *>
ServerName domain1.com
ServerAlias *.domain1.com
ServerAdmin me@domain1.com
DocumentRoot /var/www/html/domain1.com
</VirtualHost>

<VirtualHost *>
ServerName domain2.com
ServerAlias *.domain2.com
ServerAdmin me@domain2.com
DocumentRoot /var/www/html/domain2.com
</VirtualHost>

<VirtualHost *>
ServerName domain3.us
ServerAlias *.domain3.us
ServerAdmin me@domain1.com
DocumentRoot /var/www/html/domain3.us
</VirtualHost>
-----------------------------
hmmmmm
 
Old 07-08-2003, 02:25 PM   #5
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 261Reputation: 261Reputation: 261
And like david_ross mentioned, you do have your DNS server pointing to correct IP these are hosted on, etc?
 
Old 07-08-2003, 02:28 PM   #6
Spaz17
Member
 
Registered: Jul 2003
Location: Somewhere, over the rainbow, way up high
Distribution: Gentoo
Posts: 132

Original Poster
Rep: Reputation: 15
yup dns is correct
all my sites work when i set them up as default hosts
and use no virtual hosts
 
Old 07-08-2003, 02:32 PM   #7
Spaz17
Member
 
Registered: Jul 2003
Location: Somewhere, over the rainbow, way up high
Distribution: Gentoo
Posts: 132

Original Poster
Rep: Reputation: 15
when i do it with webmin
: which i dont want to use if i dont have to :
it does it somewhat differently
<VirtualHost domain1.com>
instead of
<VirtualHost *>
but it still doesnt work..
 
Old 07-08-2003, 02:37 PM   #8
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 261Reputation: 261Reputation: 261
What happens when you have the virtual hosts defined like above and try to ping one of your domain names by name, does it resolve to the IP address?

Yah, either usually works with the <VirutalHost * or domain.com>
I use the * myself with my virtual hosts.
 
Old 07-08-2003, 02:39 PM   #9
Spaz17
Member
 
Registered: Jul 2003
Location: Somewhere, over the rainbow, way up high
Distribution: Gentoo
Posts: 132

Original Poster
Rep: Reputation: 15
i am able to find them when pinging
i should have mentioned
i can go to each site, but i get an
error 400
bad request
 
Old 07-08-2003, 02:50 PM   #10
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 261Reputation: 261Reputation: 261
How are you typing these in your browser? Cause a 400 error means its being sent usually without a hostname, etc in the http request?

Have you tried: http://domain1.com ?

Since I noticed you have a *.domain1.com as well.. etc for all the others. Are you trying to type in a www in the front of each domain name?

If so, have you tried actually adding a virtual host with www.domain1.com as a separate virtual host?

Example:

<VirtualHost *>
ServerName www.domain1.com
ServerAdmin me@domain1.com
DocumentRoot /var/www/html/domain1.com
</VirtualHost>
 
Old 07-08-2003, 02:50 PM   #11
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
Take a look at your error_log for more info.
 
Old 07-08-2003, 02:55 PM   #12
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 261Reputation: 261Reputation: 261
A snippet from my httpd.conf file and virtual hosts:

<VirtualHost *>
ServerAdmin webmaster@domain.com
DocumentRoot /data/www/htdocs
ServerName domain1.org
</VirtualHost>

<VirtualHost *>
ServerAdmin webmaster@domain.com
DocumentRoot /data/www/htdocs
ServerName www.domain1.org
</VirtualHost>

<VirtualHost *>
ServerAdmin webmaster@domain2.com
DocumentRoot /data/www/domain2
ServerName domain2.com
</VirtualHost>

<VirtualHost *>
ServerAdmin webmaster@domain2.com
DocumentRoot /data/www/domain2
ServerName www.domain2.com
</VirtualHost>

I think the problem may be the * wildcards you have setup for the aliases.. not sure off top of my head though.
 
Old 07-08-2003, 02:57 PM   #13
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
Without trying to overload you with ideas, you may want to check you VHOSTS config using:
/path/to/httpd -t -D DUMP_VHOSTS
 
Old 07-08-2003, 03:23 PM   #14
cyph3r7
Member
 
Registered: Apr 2003
Location: Silicon Valley East, Northern Virginia
Distribution: FreeBSD,Debian, RH, ok well most of em...
Posts: 238

Rep: Reputation: 30
Hey dude take a look at my doctored httpd.conf file. I run about 30 virtual hosts, this is just a snipet to help you understand. First the "*" wildcard needs to be the base IP your DNS will be looking for. Seconde you need to specify the NamedVirtualHost as that IP also. Take a look:

# VirtualHost: Allows the daemon to respond to requests for more than one
# server address, if your server machine is configured to accept IP packets
# for multiple addresses. This can be accomplished with the ifconfig
# alias flag, or through kernel patches like VIF.

# Any httpd.conf or srm.conf directive may go into a VirtualHost command.
# See also the BindAddress entry.

NameVirtualHost 192.168.132.170

<VirtualHost 192.168.132.170>
ServerAdmin me@mydomain.com
DocumentRoot /home/www/extranet
ServerName extranet.mydomain.com
#ErrorLog logs/host.some_domain.com-error_log
#TransferLog logs/host.some_domain.com-access_log
</VirtualHost>

<VirtualHost 192.168.132.170>
ServerAdmin me@mydomain.com
DocumentRoot /home/www/web2
ServerName web2.mydomain.com
ErrorLog logs/host.some_domain.com-error_log
TransferLog logs/host.some_domain.com-access_log
</VirtualHost>


<VirtualHost 192.168.132.170>
ServerAdmin me@mydomain.com
DocumentRoot /home/www/web3
ServerName web3.mydomain.com
ErrorLog logs/host.some_domain.com-error_log
TransferLog logs/host.some_domain.com-access_log
</VirtualHost>

<VirtualHost 192.168.132.170>
ServerAdmin me@mydomain.com
DocumentRoot /home/www/web4
ServerName web4.mydomain.com
ErrorLog logs/host.some_domain.com-error_log
TransferLog logs/host.some_domain.com-access_log
</VirtualHost>


Even though mine are sub domains, that is just how they are aliased in DNS. You could name them whatever you wanted.

Good luck!
 
Old 07-08-2003, 03:43 PM   #15
Spaz17
Member
 
Registered: Jul 2003
Location: Somewhere, over the rainbow, way up high
Distribution: Gentoo
Posts: 132

Original Poster
Rep: Reputation: 15
nothing seems to be working
even when i use only the one virtual host, i get an error 400
should i have the default server with the same config as the first virtual server?
 
  


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
Mail from Apache being rejected - Cannot route to sender apache@localhost.localdomain jimwillsher Linux - Networking 2 01-19-2006 12:41 AM
Apache 1.3.33 (debian built) and Apache SSL does not respond to the proper ports lqorg_user Linux - Networking 0 11-06-2005 04:11 PM
Strange apache trailing / problem - Slack-current, apache 1.3.33 vamp Linux - Networking 1 01-30-2005 07:28 PM
Apache Webserver 403 Forbidden Errors (User not in apache group?) Mankind75 Mandriva 4 07-08-2004 05:30 AM
apache benchmarks (apache v13 / apache v20) ; large differences between benchmarking markus1982 Linux - Software 0 02-08-2003 10:53 AM

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

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