LinuxQuestions.org
Help answer threads with 0 replies.
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
 
LinkBack Search this Thread
Old 11-19-2006, 03:40 PM   #1
spy_X
LQ Newbie
 
Registered: Oct 2006
Posts: 7

Rep: Reputation: 0
Virtual Host problem.


Hey all,

I am having a problem with my virtual host with apache. I do think i have everything right
and is working as far as the virtual setup goes.. (port 80 is blocked by ISP, using 81)
Also, im using Apache, 1.3.37.

example:

http://webmail.domain.net:81 --> goes right to /var/www/htdocs/webmail
http://www.domain.net:81 --> goes right to /var/ww/htdocs (main page)

but the problem is... when i use the following,

http://domain.net:81 --> it goes right to the same page as webmail.

Im not sure what i can do to fix it.
I have included parts of the httpd.conf, can someone
please check it over and see if i made any typo's that would
stop the http://domain.net/ from going to the http root dir.

Thanks in advance!!

----------------cut--------------
### Section 1: Global Environment
ServerType standalone
ServerRoot "/usr"
PidFile /var/run/httpd.pid
ScoreBoardFile /var/run/httpd.scoreboard
TimeOut 300
KeepAlive on
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150
MaxRequestsPerChild 0
Listen 81

### Section 2: 'Main' server configuration
Port 81
User nobody
Group nobody
ServerAdmin admin@domain.net
ServerName www.domain.net
DocumentRoot "/var/www/htdocs"
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/var/www/htdocs">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule mod_userdir.c>
UserDir public_html
</IfModule>
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
<IfModule mod_dir.c>
DirectoryIndex index.html index.htm index.shtml index.shtm index.php
</IfModule>
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

### Section 3: Virtual Hosts
NameVirtualHost *:81

<VirtualHost *>
ServerName webmail.domain.net
DocumentRoot /var/www/htdocs/webmail
</VirtualHost>

<VirtualHost *>
ServerName www.domain.net
DocumentRoot /var/www/htdocs/
</VirtualHost>
-----------------/cut----------------------------
 
Old 11-19-2006, 06:54 PM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,121

Rep: Reputation: 121Reputation: 121
You need to make this:

<VirtualHost *>
ServerName www.domain.net
DocumentRoot /var/www/htdocs/
</VirtualHost>


Look like this or add this:

<VirtualHost *>
ServerName domain.net
ServerAlias www.domain.net
DocumentRoot /var/www/htdocs/
</VirtualHost>

And I usually always put the config for the main domain.net first, then any virtual or subdomains after it.
 
Old 11-19-2006, 07:53 PM   #3
spy_X
LQ Newbie
 
Registered: Oct 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks trickykid,

Worked like a charm!!
I figured it would be something simple!

Thanks again for the reply!.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Virtual Host problem Seventh Linux - Software 2 03-19-2005 06:33 PM
Virtual Host Problem tictocdoc Linux - Networking 7 05-12-2004 09:08 PM
Apache 2.0 Virtual Host Problem frankd99 Linux - Software 3 02-16-2004 12:23 PM
Name Based Virtual Host problem helios007 Linux - Networking 6 12-21-2003 03:41 PM
virtual host problem Michele Linux - Newbie 5 08-18-2003 11:05 AM


All times are GMT -5. The time now is 07:09 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration