LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to create apache2 subdomain? (https://www.linuxquestions.org/questions/linux-networking-3/how-to-create-apache2-subdomain-210787/)

gepesz 07-28-2004 06:07 PM

How to create apache2 subdomain?
 
Hi there,

I have apache2 http server running on my Debian box. The problem that I'm facing is how to create a subdomain.

Here is what I have in /etc/apache2/httpd.conf:

<VirtualHost *>
ServerName www.abc.com
DocumentRoot /var/www
</VirtualHost>

<VirtualHost *>
ServerName webmail.abc.com
DocumentRoot /var/www/squirrelmail
</VirtualHost>

As you can see I'm tring to setup the subdomain 'webmail' under abc.com for SquirrelMail.

How can I tell apache2 to goto DocumentRoot /var/www/squirrelmail when somebody types webmail.abc.com into their browser?

maxut 07-29-2004 05:22 AM

NameVirtualHost *:80

<VirtualHost *:80>
ServerName egemen
DocumentRoot /var/www/egemen
</VirtualHost>

<VirtualHost *:80>
ServerName mail.egemen
ServerAlias mail.*
ServerAdmin postmaster@egemen
DocumentRoot /var/www/html/webmail/
</VirtualHost>

gepesz 07-29-2004 09:51 AM

Thanks, the NameVirtualHost *:80 did the trick.

I added that on top of the VirtualHosts and started working just fine.

Renz 09-20-2012 05:07 AM

Hello there.. i just see this post when i'm searching on how to add a subdomain in a webserver..i just want to know the complete step or the first procedure on how to create a subdomain.. thanks..


All times are GMT -5. The time now is 11:02 AM.