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: Virtual host
Author
timahri



Joined: 23 Dec 2008
Posts: 4

PostPosted: Sun 28 Dec '08 5:35    Post subject: Virtual host Reply with quote

i have apache 2.2 up and running under domain.com . i would like to configure apache to host other sub domains on the same ip address.

i have read so much that i am either confused or cannot understand anything.

my question is where exactly in the config file do i have to put the virtual host script and what script exactly i would have to put there.

my main site doc root is in the ........apache....////htdocs directory and i have made another doc root in ........apache...///subdomain.

i ahve tried everything possible but everytime i go to my sub.domain.com it brings up my domain.com page..



i need some help badly.
Back to top
mkhalemi



Joined: 25 Dec 2008
Posts: 8
Location: Malaysia

PostPosted: Sun 28 Dec '08 6:39    Post subject: Reply with quote

hello,

read the conf/extra/httpd-vhost.conf
configure DNS or hostfile properly

Thanks
Back to top
timahri



Joined: 23 Dec 2008
Posts: 4

PostPosted: Mon 29 Dec '08 5:56    Post subject: Reply with quote

do i need to modify my httpd config file for virtual host?? so that apache needs to look into v-host config file??
Back to top
mkhalemi



Joined: 25 Dec 2008
Posts: 8
Location: Malaysia

PostPosted: Mon 29 Dec '08 6:24    Post subject: Reply with quote

[httpd.conf]

LoadModule vhost_alias_module modules/mod_vhost_alias.so

# Virtual hosts
Include conf/extra/httpd-vhosts.conf


[httpd-vhost.conf]

NameVirtualHost *:80

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "/httpd-2.2-x64/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "/httpd-2.2-x64/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>


and configure you hostfile or DNS properly
there are plenty of tutorial on the inet.
Back to top


Reply to topic   Topic: Virtual host View previous topic :: View next topic
Post new topic   Forum Index -> Apache