Gossamer Forum
Home : General : Internet Technologies :

Apache 1.3.26 Virtual Host

Quote Reply
Apache 1.3.26 Virtual Host
Hi everyone,

I just setup a mandrake 9 machine to work as e-mail and webserver.. I now have my website running as www.mydomain.org and my webmail at www.mydomain.org/webmail/

I would like to create a virtual host to serve my webmail as http://mail.mydomain.org, I tried several options in my Vhost.conf file, below I will give you my most recent version. The problem is that I see the exact same content when typing mail.mydomain.org or www.mydomain.org. I hope one of you has a suggestion to resolve this issue.

Alex

################# Vhosts.conf
#This is where we store the VirtualHosts configuration.
(.......)

#This is needed for Frontpage support
Port 80
ServerRoot /etc/httpd
ResourceConfig /dev/null
AccessConfig /dev/null

################# IP-based Virtual Hosts
#<VirtualHost 192.168.2.100>
#User jmdault
#Group jmdault
#DocumentRoot /home/jmdault/public_html
#ServerName test2.com
#Setenv VLOG /home/jmdault/logs
#ErrorLogs /home/jmdault/test2-error_log
#RewriteEngine On
#RewriteOptions inherit
#</VirtualHost>

################# Named VirtualHosts
#NameVirtualHost 111.222.33.44
#<VirtualHost 111.222.33.44>
#ServerName www.domain.tld
#ServerPath /domain
#DocumentRoot /web/domain
#</VirtualHost>

<VirtualHost *>
ServerName www.mydomain.org
ServerPath /var/www/html
DocumentRoot /var/www/html
</VirtualHost>

<VirtualHost *>
ServerName mail.mydomain.org
ServerPath /var/www/squirrelmail
DocumentRoot /var/www/squirrelmail
</VirtualHost>
Quote Reply
Re: [superyupkent] Apache 1.3.26 Virtual Host In reply to
You should checkout the docs at apache.org - they have a whole section on setting up virtual hosts.

http://httpd.apache.org/docs/vhosts/index.html

Last edited by:

Paul: Dec 6, 2002, 2:46 PM
Quote Reply
Re: [Paul] Apache 1.3.26 Virtual Host In reply to
Even if I change the wildcard to an IP address or name, it still doesn't change.. I already tried that before. But I did it again.. no change unfortunately.

Alex
Quote Reply
Re: [superyupkent] Apache 1.3.26 Virtual Host In reply to
does this work?

Code:
<VirtualHost XXX.XX.XXX.XX>
ServerName mail.yourdomain.com
DocumentRoot /path/to/the/index/page/
ErrorLog /dev/null
TransferLog /dev/null
</VirtualHost>

Try both your entries in that format.

r.

Last edited by:

ryel01: Dec 9, 2002, 12:07 PM
Quote Reply
Re: [ryel01] Apache 1.3.26 Virtual Host In reply to
Hi R.

Thanx for your reply, I tried to do it exactly the way you told me.. But it still doesn't work. It really doesn;t matter if I fill in: mail, www or hcddsjhvjsdvgj.mydomain.org. It all boils down to the same default webpage I created.

Thanx for the input though,

Alex
Quote Reply
Re: [superyupkent] Apache 1.3.26 Virtual Host In reply to
Hi,

Try adding "ServerAlias *.mydomain.org" as shown below

<VirtualHost *>
ServerName www.mydomain.org
ServerAlias *.mydomain.org
ServerPath /var/www/html
DocumentRoot /var/www/html
</VirtualHost>

Hope this help
Quote Reply
Re: [superyupkent] Apache 1.3.26 Virtual Host In reply to
This thread is a bit old, but I'm not sure if it's closed.

Superyupkent, I had the same problem forever with Apache. I checked the error logs eventually and it kept telling me that I had to have a NameVirtualHost. So, I named it - with my IP address. Your IP address is static, I'm assuming. Then after that, I bound all of my <VirtualHost *> tags to <VirutalHost (myIP:port80)>

e.g.

<VirtualHost 127.0.0.1:80> - I set this for every virtual host I have. 127.0.01 is local machine, not my IP. Also, and I'm sure you've done this, make sure that you have mail.youaddress.com pointing to your machine through a DNS server.

Eveything in your conf file looks fine, except the NameVirtualHost isn't defined. Anywho, that's my two cents - for what it's worth.

Hope it works.
StupidSexyFlanders *they wouldn't allow that many characters :(*
Quote Reply
Re: [superyupkent] Apache 1.3.26 Virtual Host In reply to
Hello, I guess you have found out about this problem by now, but this is how mine looks like

NameVirtualHost *

<VirtualHost *>
ServerName webmail.mydomain.org
DocumentRoot /usr/share/squirrelmail
</VirtualHost>

<VirtualHost *>
ServerName www.mydomain.org
DocumentRoot /var/www
</VirtualHost>

and this is working fine :)