The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
S-118: Apache httpd Vulnerabilities iBot Security Advisories (RSS) 0 01-15-2008 08:10 PM
Python & httpd.conf settings thumper UNIX for Dummies Questions & Answers 0 12-12-2007 11:43 AM
Apache 2 httpd.conf empty sspirito Ubuntu 2 08-06-2007 11:09 AM
httpd.conf - stumped Cameron IP Networking 2 04-25-2002 05:31 AM
defaults httpd.conf macdonto IP Networking 5 09-25-2001 05:21 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-01-2003
Spetnik Spetnik is offline
Registered User
  
 

Join Date: Jul 2002
Posts: 34
Apache httpd.conf <VirtualHost> issue

I have just configured httpd.conf on a new Redhat 9 install. Below are my additions to httpd.conf. Everything works fine except that when typing http://spetnik.d2g.com into my web browser, I am sent to the "Default catch all" site. Any clues?

Code:
NameVirtualHost *:80

#Default catch all 
<VirtualHost *:80>
    ServerAdmin aspetner@spetnik.com
    DocumentRoot /var/www/html/
    ErrorDocument 404 /errors/notfound.html
</VirtualHost>

#spetnik.d2g.com
<VirtualHost *:80>
    ServerName spetnik.d2g.com
    ServerAlias spetnik.d2g.com www.spetnik.d2g.com
    ServerAdmin aspetner@spetnik.com
    DocumentRoot /var/www/spetnik/html/
    ErrorDocument 404 /errors/notfound.html
    TransferLog logs/spetnik

    <Directory /var/www/spetnik/html>
        AllowOverride All
    </Directory>
</VirtualHost>

#e-feedback.org
<VirtualHost *:80>
    ServerName e-feedback.org
    ServerAlias e-feedback.org www.e-feedback.org
    ServerAdmin e-feedback@spetnik.com
    DocumentRoot /var/www/e-feedback/html
    ErrorDocument 404 /errors/notfound.html
    TransferLog logs/e-feedback

    <Directory /var/www/e-feedback/html>
        AllowOverride All
    </Directory>
</VirtualHost>
Thanks,
Aaron
  #2 (permalink)  
Old 07-01-2003
oombera's Avatar
oombera oombera is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2002
Location: Cleveland, OH
Posts: 804
I assume that's your website then... you need to create the webpage you want users to see when they visit your website - create a basic html file and name it "index.html" and place it in the main directory of your site, probably /var/www/html/.
  #3 (permalink)  
Old 07-01-2003
Spetnik Spetnik is offline
Registered User
  
 

Join Date: Jul 2002
Posts: 34
I don't think you understand. Both e-feedback.org and www.e-feedback.org display the index.html file from /var/www/e-feedback/html. www.spetnik.d2g.com also displays /var/www/spetnik/html/index.html, but if I take out the www (just spetnik.d2g.com), I get the catch all directory (/var/www/html).
  #4 (permalink)  
Old 07-01-2003
oombera's Avatar
oombera oombera is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2002
Location: Cleveland, OH
Posts: 804
Now I see what you're saying..

Looking at the documentation, I can't figure out what's wrong, but I'm sure someone else will know.
  #5 (permalink)  
Old 07-01-2003
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
In your first virtual host, you specify your domain as spetnik.d2g.com. I don't have a way to test this, but to my way of thinking, this would be a host.domain.com. (Your other one works because it is has only a domain - e-feedback.org )

<VirtualHost *:80>
ServerName spetnik.d2g.com
ServerAlias spetnik.d2g.com www.spetnik.d2g.com
ServerAdmin aspetner@spetnik.com
DocumentRoot /var/www/spetnik/html/

Part of the documentation states:
Quote:
Many servers want to be accessible by more than one name. This is possible with the ServerAlias directive, placed inside the <VirtualHost> section. For example if you add this to the first <VirtualHost> block above

ServerAlias domain.tld *.domain.tld
then requests for all hosts in the domain.tld domain will be served by the www.domain.tld virtual host.
Since you probably can't change servername to d2g.com, try the following instead (found in the FAQ section of Apache's documentation):
Quote:
There are two techniques to implement canonical hostnames:

Use mod_rewrite as described in the "Canonical Hostnames" section of the URL Rewriting Guide.
Use name-based virtual hosting:
NameVirtualHost *

<VirtualHost *>
ServerName www.example.net
ServerAlias example.com
Redirect permanent / http://www.example.com/
</VirtualHost>

<VirtualHost *>
ServerName www.example.com
DocumentRoot /usr/local/apache/htdocs
</VirtualHost>
Worth a shot, anyway.
  #6 (permalink)  
Old 07-01-2003
Spetnik Spetnik is offline
Registered User
  
 

Join Date: Jul 2002
Posts: 34
Nevermind, I figured it out. I had "ServerName spetnik.d2g.com:80" set at the top of my httpd.conf file. I changed it to "ServerName linuxsrv:80" (linuxsrv is the machine name) and it now works fine.

Thanx for the help anyway .
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 05:57 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0