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!

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Yeah uncomment both those lines. You might also want to take a look at #Include conf/extra/httpd-vhosts.conf as it most likely has some vhost examples.

 

As for your ip, you don't need one if you use named vhosts as shown in my example.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.