FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


apache httpd.conf setup for subdomains





mike_phi
I there I have an apache server running on linux I would like to be able to set up subdomains to point to a particular directory i.e. a user directory.

at the momment I am able to access my index page by means of using the ip address of the machine I would like to be enable users to have their own directoy and access thier own directory.


e.g. me

http://xx.xx.xx.xx --------------------> ./myDirectory/index.html

what I want is to be able to have a user subdomain

http://UserDomain.xx.xx.xx.xx ------------------->./MrUser/index.html

I think all I need is th http.conf settins, please give detailed information as I have tried virtualhost setup but did not work, I probably did something wrong so even a detailed explination on this would be great !!!

cheers
silverdown
Problem

You want to host several different domains on a single Apache server

Solution

Use Apache's VirtualHost directives to set up name-based virtual host support. Here is a sample httpd.conf entries


NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.MAINSITE.com
ServerAlias www.MAINSITE.com
DocumentRoot /var/www/myDirectory ** Dont add a trailing / **
ServerAdmin admin@SOMESITE.com
</VirtualHost>


<VirtualHost *:80>
ServerName www.MAINSITE.com
ServerAlias *SUBDOMAIN.MAINSITE.com
DocumentRoot /var/www/MrUser ** Dont add a trailing / **
ServerAdmin admin@SOMESITE.com
</VirtualHost>


Hope this helps
Related topics
Auto redirect your visitors to a different page
installing apache,mysql and php on windows
Installing Apache Php and MySQL [newbie tutorial]
Tutorial For Beginners
new guy needs help
Simple PHP question...
Is there a Python Hello World using Apache?
Configuring Apache...
General .htaccess tutorial.
Need help with httpd.conf and .htaccess
Apache and PHP configuration
Apache
PHP5 MySQL Config on XP
Edit httpd.conf?
Reply to topic    Frihost Forum Index -> Computers -> Software

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.