logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: apache2 virtualhosts subdomains
Author
disc



Joined: 03 Aug 2006
Posts: 3

PostPosted: Thu 03 Aug '06 2:57    Post subject: apache2 virtualhosts subdomains Reply with quote

hey all,
first post... Confused

I currently have apache2, php5, mysql5 running on my server 2003 box.

I have two domains running in virtual host configuration out of the httpd.conf file.

How would i go about adding subdomains to the already exsisting virtual hosts...

thanks for your help!!
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3057
Location: Hilversum, NL, EU

PostPosted: Thu 03 Aug '06 8:04    Post subject: Reply with quote

Please give an example what you want to achieve.

Guessing, maybe you can use Server Alias , see http://httpd.apache.org/docs/2.2/mod/core.html#serveralias

Steffen
Back to top
disc



Joined: 03 Aug 2006
Posts: 3

PostPosted: Thu 03 Aug '06 20:51    Post subject: Reply with quote

i have two virtualhosts

mydomain1.com

mydomain2.com

both are virtual hosts....

i want to add subdomains to those domains

so ie:

mail.mydomain1.com goes to a subdirectory /mail on domain1.com

mail.mydomain2.com goes to sub /mail on domain2.com
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3057
Location: Hilversum, NL, EU

PostPosted: Thu 03 Aug '06 21:11    Post subject: Reply with quote

Easiest is just make two vhost of the mail domains:

For example:

<VirtualHost *>
ServerName www.mydomain1.com
DocumentRoot c:/xxx/
</VirtualHost>
<VirtualHost *>
ServerName www.mydomain2.com
DocumentRoot c:/yyy/
</VirtualHost>
<VirtualHost *>
ServerName mail.mydomain1.com
DocumentRoot c:/xxx/mail
</VirtualHost>
<VirtualHost *>
ServerName mail.mydomain2.com
DocumentRoot c:/yyy/mail
</VirtualHost>

Steffen
Back to top
disc



Joined: 03 Aug 2006
Posts: 3

PostPosted: Thu 03 Aug '06 22:03    Post subject: Reply with quote

thought so...


thanks a lot!
Back to top


Reply to topic   Topic: apache2 virtualhosts subdomains View previous topic :: View next topic
Post new topic   Forum Index -> Apache