LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-25-2004, 02:58 AM   #1
Adam H
LQ Newbie
 
Registered: Feb 2004
Distribution: Redhat/Fedora
Posts: 14

Rep: Reputation: 0
apache virthost goes to main server page


I have setup the virthost stanzas in httpd.conf, but the domain redirects to the main servers site, the docroot is /home/username/public_html, and the /~ function works, but when you go to the actual domain name configured at that vhost it just redirects, any ideas?
 
Old 07-25-2004, 03:29 AM   #2
Pete M
Member
 
Registered: Aug 2003
Location: UK
Distribution: Redhat 9 FC 3 SUSE 9.2 SUSE 9.3 Gentoo 2005.0 Debian Sid
Posts: 657

Rep: Reputation: 32
Adam H

Two observations

You should have a virtual host entry for your main domain

Secondly by default the directories Apache has access to is very restrictive so you specifically have to allow access

Heres my virtual host section

NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /var/www/html
ServerName www.maindomain.com
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /var/www/html2
ServerName www.virtualhost.com
ServerAlias virtualhost.com
ServerAdmin admin@virtualhost.com
<Directory "/var/www/html2">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

The 'Directory' part allows Apache access to var/www/html2 overriding the default configuration

Pete
 
Old 07-26-2004, 12:01 AM   #3
Adam H
LQ Newbie
 
Registered: Feb 2004
Distribution: Redhat/Fedora
Posts: 14

Original Poster
Rep: Reputation: 0
I tried using the dir override, but it still does the same problem.
 
Old 07-26-2004, 02:28 AM   #4
Pete M
Member
 
Registered: Aug 2003
Location: UK
Distribution: Redhat 9 FC 3 SUSE 9.2 SUSE 9.3 Gentoo 2005.0 Debian Sid
Posts: 657

Rep: Reputation: 32
Adam H

As you are using /home/username/public_html for your document root perhaps this part of httpd.conf will help

Otherwise try moving your document root to a different location

<IfModule mod_userdir.c>
#
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
#
UserDir disable

#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disable" line above, and uncomment
# the following line instead:
#
#UserDir public_html

</IfModule>

Pete
 
Old 07-30-2004, 03:45 AM   #5
Adam H
LQ Newbie
 
Registered: Feb 2004
Distribution: Redhat/Fedora
Posts: 14

Original Poster
Rep: Reputation: 0
I have that enabled, still i get nothing, i tried changing the docroot to /var/www/username and still just goes to the main page......im baffled why its doing this.
 
Old 07-30-2004, 02:46 PM   #6
Adam H
LQ Newbie
 
Registered: Feb 2004
Distribution: Redhat/Fedora
Posts: 14

Original Poster
Rep: Reputation: 0
I was able to somewhat get it working, when i have vhosts on(i made an include file for all vhosts) the vhost domain works fine, but when you go the main server domain, it shows the vhost content.........can somebody please help me?
 
Old 07-30-2004, 05:20 PM   #7
rjcrews
Member
 
Registered: Apr 2004
Distribution: Debian
Posts: 193

Rep: Reputation: 30
post your vhosts file?
 
Old 07-30-2004, 05:31 PM   #8
Adam H
LQ Newbie
 
Registered: Feb 2004
Distribution: Redhat/Fedora
Posts: 14

Original Poster
Rep: Reputation: 0
# VOLKNET.COM
<VirtualHost 66.98.178.43>
ServerAdmin root@contractorsunleashed.com
ServerName www.volknet.com
ServerAlias volknet.com
ServerAdmin root@volknet.com
DocumentRoot /home/volknet/public_html/
<Directory "/home/volknet/public_html">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost 66.98.178.43:443>
# General setup for the virtual host
DocumentRoot /var/www/html
ServerName contractorsunleashed.com
ServerAdmin root@contractorsunleashed.com
ErrorLog /var/log/httpd/error_log
TransferLog /var/log/httpd/access_log

SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/contractorsunleashed.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/contractorsunleashed.key
SSLVerifyClient none
SSLVerifyDepth 10
SSLOptions +FakeBasicAuth
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
</VirtualHost>

# VOLKNETENTERPRISES.COM
<VirtualHost 66.98.178.43>
ServerAdmin root@contractorsunleashed.com
DocumentRoot /home/ve/public_html/
ServerName www.volknetenterprises.com
ServerAlias volknetenterprises.com
ScriptAlias /cgi-local/ /home/ve/public_html/cgi-local/
<Directory "/home/ve/public_html">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

# CONTRACTORGROUP.NET
<VirtualHost 66.98.178.43>
ServerAdmin root@contractorsunleashed.com
DocumentRoot /home/cgnet/public_html/
ServerName www.contractorgroup.net
ServerAlias contractorgroup.net
ScriptAlias /cgi-local/ /home/cgnet/public_html/cgi-local/
<Directory "/home/cgnet/public_html">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
 
Old 07-30-2004, 05:36 PM   #9
rjcrews
Member
 
Registered: Apr 2004
Distribution: Debian
Posts: 193

Rep: Reputation: 30
which ports are you listening on?

all of mine are like this:

<VirtualHost *:80>
ServerName www.zoast.com
ServerAlias zoast.com *.zoast.com
DocumentRoot /var/www/html
ErrorLog logs/zoast.com-error_log
TransferLog logs/zoast.com-access_log
</VirtualHost>

all mine are in this format with the server name and doc root changed...noticed u have one on 443, which ports you listening on? may also try changin the serverAlias line..
 
Old 07-31-2004, 03:30 AM   #10
Adam H
LQ Newbie
 
Registered: Feb 2004
Distribution: Redhat/Fedora
Posts: 14

Original Poster
Rep: Reputation: 0
Well, i think i narrowed down the problem..........
when i was trying to get the vhost stuff working, i was trying to ln -s /var/www/ to /home/username/public_html and somehow i got the main server linked to the vhost content.................the thing is i removed the symlinks the other day using the rm command, and not unlink...........so they dont appear now, but its still linking.....how can i get rid of this?
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Page counter on apache server dranobob Linux - Newbie 1 08-29-2005 07:05 PM
Sysinfo link on web server main page hrp2171 Slackware 0 10-13-2004 06:10 PM
apache web server default page link tuxrules Linux - Newbie 9 07-10-2004 06:22 PM
I cant change the default test page in apache server to add my page.y nhemapriya Linux - Newbie 3 05-13-2004 01:35 PM
MAIN PAGE eraser LQ Suggestions & Feedback 6 09-13-2000 07:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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