LinuxQuestions.org
Visit Jeremy's Blog.
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 06-22-2005, 04:03 AM   #1
Vito_Corleone
LQ Newbie
 
Registered: Sep 2004
Posts: 18

Rep: Reputation: 0
Apache Issue... (Please Help Me Before I Shoot Myself)


Ok, basically, i've been running an Apache server for awhile now, never had to tackle Virtual Hosts, and i've had little problems with the other things i've had to learn. Well, i've been at this for about 6 hours straight (sounds long, but i actually had a friend SSH in and try to fix it, but in the process, he actually corrupted my box so i had to go with a fresh install, at which time i found out, through a good amount of trouble shooting, that my FC4 dvd was bad). Anyway, i'm at my wit's end, and if someone could tell me what'd wrong with my httpd.conf file, i'd be EXTREMELY grateful.

Quick run down of the problem, when i goto site 2, i get the same file as for site 1. I'm sure this is something simple, but i can't seem to figure it out, so please, please, hlpe me. LOL. Without further ado...


### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs-2.0/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#

#
# 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@serenzia.com
DocumentRoot /var/www/html/serenzia
ServerName serenzia.com
ServerAlias www.serenzia.com
# ErrorLog logs/
# CustomLog logs/


<Directory "/var/www/html/serenzia/stuff">
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /usr/local/apache/passwd/passwords
Require user eric
</Directory>

<Directory "/var/www/html/serenzia/business">
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /usr/local/apache/passwd/passwords
Require user eddie
</Directory>


</VirtualHost>



<VirtualHost *:80>
ServerAdmin webmaster@redcore.com
DocumentRoot /var/www/html/redcore
ServerName redcoreclothing.com
ServerAlias www.redcoreclothing.com
# ErrorLog logs/
# CustomLog logs/
</VirtualHost>

I posted it ALL, but i suspect that the problem lies in my Virtual Host settings. Thanks in advance for ANYONE that is willing to lend a hand.

Edit: Couldn't post it all, it was too long. If there's another section anyone would like to see, just post and i'll throw it up here.
 
Old 06-22-2005, 04:38 AM   #2
stefan_nicolau
Member
 
Registered: Jun 2005
Location: Canada
Distribution: Debian Etch/Sid, Ubuntu
Posts: 529

Rep: Reputation: 32
I'm not sure, but:
A) Make sure you are using an HTTP/1.1 Browser
B) The first defined virtual host is the default, it may help
C) Try httpd -S and httpd -t to chech the configuration file and parse the settings.
 
Old 06-22-2005, 06:45 AM   #3
Satriani
Member
 
Registered: Mar 2003
Location: The Netherlands
Distribution: Red Hat 7.3, Red Hat 9, Solaris8, Slackware 10, Slax on USB, AIX, FreeBSD, WinXP, AIX, Ubuntu
Posts: 418

Rep: Reputation: 30
Not completey sure, but i think you do not need the *:80 in the NameVirtualHost directive, only the * .
Of course you will need to add it in the <VirtualHost *:80> to prevent SSL errors...
 
Old 06-22-2005, 12:59 PM   #4
Vito_Corleone
LQ Newbie
 
Registered: Sep 2004
Posts: 18

Original Poster
Rep: Reputation: 0
Wow. Not much going on in here. Thanks for your help, to the people above me, nothing so far though. I've made some changes, here's what it's looking like now. Still the same issue though, site one seems to be taking precedence over 2.

### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs-2.0/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost www.serenzia.com
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#

#
# 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 www.serenzia.com>
ServerAdmin webmaster@serenzia.com
DocumentRoot "/var/www/html/serenzia"
ServerName serenzia.com
ServerAlias www.serenzia.com
# ErrorLog logs/
# CustomLog logs/


<Directory "/var/www/html/serenzia/stuff">
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /usr/local/apache/passwd/passwords
Require user eric
</Directory>

<Directory "/var/www/html/serenzia/business">
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /usr/local/apache/passwd/passwords
Require user eddie
</Directory>


</VirtualHost>

NameVirtualHost www.redcoreclothing.com


<VirtualHost www.redcoreclothing.com>
ServerAdmin webmaster@redcore.com
DocumentRoot "/var/www/html/redcore"
ServerName redcoreclothing.com
ServerAlias www.redcoreclothing.com
# ErrorLog logs/
# CustomLog logs/


<Directory "/var/www/html/redcore/">

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs-2.0/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all

</Directory>

<Directory "/var/www/html/redcore/bs">
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /usr/local/apache/passwd/passwords
Require user red
</Directory>


</VirtualHost>


Is anyone around here familiar with this, or am i just kind of taking a shot in the dark?
 
Old 06-22-2005, 02:37 PM   #5
stefan_nicolau
Member
 
Registered: Jun 2005
Location: Canada
Distribution: Debian Etch/Sid, Ubuntu
Posts: 529

Rep: Reputation: 32
What is the output of httpd -S and httpd -t ?
 
Old 06-22-2005, 04:10 PM   #6
RandomLinuxNewb
Member
 
Registered: Oct 2003
Distribution: Slackware
Posts: 101

Rep: Reputation: 15
I think your problem is
Code:
NameVirtualHost www.serenzia.com
Change that to
Code:
NameVirtualHost *
 
Old 06-22-2005, 04:30 PM   #7
stefan_nicolau
Member
 
Registered: Jun 2005
Location: Canada
Distribution: Debian Etch/Sid, Ubuntu
Posts: 529

Rep: Reputation: 32
RandomLinuxNewb is right, but that directive was ok in the original file you posted, why have you changed it?
 
Old 06-22-2005, 05:27 PM   #8
Vito_Corleone
LQ Newbie
 
Registered: Sep 2004
Posts: 18

Original Poster
Rep: Reputation: 0
I changed it because the examples i've seen were showing that it should look like that. I've tried it a BUNCH of different ways and nothing appears to work.

I am unable to post the httpd -S or -t results as i'm at work right now. As soon as i get a free minute, i'll log in and post it for you guys. Thanks for all of your help so far.
 
Old 06-23-2005, 03:25 AM   #9
Satriani
Member
 
Registered: Mar 2003
Location: The Netherlands
Distribution: Red Hat 7.3, Red Hat 9, Solaris8, Slackware 10, Slax on USB, AIX, FreeBSD, WinXP, AIX, Ubuntu
Posts: 418

Rep: Reputation: 30
Try this:

Code:
NameVirtualHost *

<Virtualhost *:80>
ServerName www.serenzia.com
    ...
    ...
</Virtualhost>

<Virtualhost *:80>
ServerName redcoreclothing.com>
    ...
    ...
</Virtualhost>
This should work...
 
Old 06-23-2005, 04:49 AM   #10
stefan_nicolau
Member
 
Registered: Jun 2005
Location: Canada
Distribution: Debian Etch/Sid, Ubuntu
Posts: 529

Rep: Reputation: 32
What is different from the original configuration?
I don't think 'Listen 80 ... NameVirtualHost *' is any different from 'NameVirtualHost *:80'
Is the > in redcoreclothing.com> a typo?
 
Old 06-23-2005, 09:00 AM   #11
Satriani
Member
 
Registered: Mar 2003
Location: The Netherlands
Distribution: Red Hat 7.3, Red Hat 9, Solaris8, Slackware 10, Slax on USB, AIX, FreeBSD, WinXP, AIX, Ubuntu
Posts: 418

Rep: Reputation: 30
Sorry , my boo... typo indeed that >
The difference is, that when you use SSL and virtualhosting, you get to have two different points: Namebased virtual hosting, and portnumbers...
So, NamevirtualHost * just means use namebased virtual hosts.

Specify the portnumber in the different VirtualHosts, like

<VirtualHost *:80> or <VirtualHost *:443>

Another thing that Might be of influence, although I am not completely sure, is UseCanonicalNames. You could try to set this Directive to Off, see if that will solve it...
 
  


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
Apache Issue Jukas Linux - Software 3 07-14-2005 01:33 PM
Is this an apache issue? opsraja Linux - Networking 1 03-02-2005 11:03 PM
Don't shoot me, CD-4 question Wakim Mandriva 4 01-02-2005 09:17 PM
shoot the newbie... Tisch Debian 2 01-17-2004 05:30 PM
apache issue... Robin01 Linux - Newbie 3 09-21-2003 06:12 AM

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

All times are GMT -5. The time now is 11:51 PM.

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