Jump to content

[SOLVED] setting up subdomain to point to folder on server


LRgraham14

Recommended Posts

ok, so basically what i want to do is make forum.domain.com point to the /forum folder on my server, i can access the forum by going to domain.com/forum but i want the forum folder to be like the root folder for forum.domain.com, i know you can forward the subdomain but thats not really what i want

 

i am running my own server on windows with apache 2.2, php5 mysql and phpmyadmin, i have full access to the server (its in my house) and i have a domain through godaddy and im using their totaldns service to link my server ip to the domain

 

Any help will be great, Thanks!

You need to add a vhost to your httpd.conf file, at its simplest something like...

 

NameVirtualHost *

# This is the default host.
<VirtualHost *>
    DocumentRoot /var/www/default
</VirtualHost>

# This is the new vhost.
<VirtualHost *>
    ServerName forum.hostname.com
    DocumentRoot /var/www/forum
</VirtualHost>

under the apache config file i know i have to uncomment at least 1 things, they are #LoadModule vhost_alias_module modules/mod_vhost_alias.so and #Include conf/extra/httpd-vhosts.conf are these the only ones that need to be uncommented, and also what do i put for the subforum ip address under godaddy as it wont let me pru forum.ipaddress

 

Thanks

ok so i set up my vhost file to look like this

 

<VirtualHost *:80>

    DocumentRoot C:/webs

    ServerName www.mydomain.net

</VirtualHost>

 

<VirtualHost *:80>

    DocumentRoot C:/webs/forum

    ServerName forum.mydomain.net

</VirtualHost>

 

then i restarted apache, i have both www.mydomain.net and forum.mydomain.net pointed to the server ip on godaddy, but forum.mydomain still wont work... what am i doing wrong

 

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.