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
Need help with httpd.conf and .htaccess
Edit httpd.conf?
installing apache,mysql and php on windows
General .htaccess tutorial.
Auto redirect your visitors to a different page
Tutorial For Beginners
PHP5 MySQL Config on XP
Apache
Installing Apache Php and MySQL [newbie tutorial]
new guy needs help
Simple PHP question...
Is there a Python Hello World using Apache?
Configuring Apache...
Apache and PHP configuration
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.