View the Most Wanted LQ Wiki articles.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 07-28-2004, 07:07 PM   #1
LQ Newbie
Registered: Jun 2004
Location: Washington DC, US
Distribution: Debian, Kubuntu
Posts: 23

Rep: Reputation: 15
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 *>
DocumentRoot /var/www

<VirtualHost *>
DocumentRoot /var/www/squirrelmail

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

How can I tell apache2 to goto DocumentRoot /var/www/squirrelmail when somebody types into their browser?
Old 07-29-2004, 06:22 AM   #2
Senior Member
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
NameVirtualHost *:80

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

<VirtualHost *:80>
ServerName mail.egemen
ServerAlias mail.*
ServerAdmin postmaster@egemen
DocumentRoot /var/www/html/webmail/
Old 07-29-2004, 10:51 AM   #3
LQ Newbie
Registered: Jun 2004
Location: Washington DC, US
Distribution: Debian, Kubuntu
Posts: 23

Original Poster
Rep: Reputation: 15
Thanks, the NameVirtualHost *:80 did the trick.

I added that on top of the VirtualHosts and started working just fine.
Old 09-20-2012, 06:07 AM   #4
LQ Newbie
Registered: Sep 2012
Posts: 1

Rep: Reputation: Disabled
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..


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
C compiler cannot create executables [PHP5/Apache2] colabus Linux - Software 4 11-23-2005 04:26 PM
How do I create certificates in Apache2 pjon SUSE / openSUSE 2 05-19-2005 07:54 AM
How to disable all subdomain on apache2? gepesz Linux - Networking 3 08-01-2004 05:52 PM
how to uninstall apache2 which is installed by emerge apache2 flybirdlong Linux - Software 1 07-17-2004 12:46 PM
Subdomain help DoobyWho Linux - General 3 04-14-2003 07:51 PM

All times are GMT -5. The time now is 10:11 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration