Jump to content

Virtual Host issue...


spy_X

Recommended Posts

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 httpd 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----------------------------
Link to comment
Share on other sites

It's using the webmail domain because it becomes the "default domain". The default domain is the first one specified.

Try changing it to:

--------------------------------

NameVirtualHost *:81

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

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

--------------------------------

Putting the www.domain.net virtualhost first, this would make it the default domain.

You could also add a virtualhost for servername domain.net, and it would use that, I would suggest changing the www.domain.net to be the default domain
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.