1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

A rather unique problem with apache and sub-domains

Discussion in 'Apache' started by hunterhdolan, Jun 12, 2010.

  1. #1
    Hello I need some help with apache and sub-domains. My server setup is very unique and I will try to describe it as best as I can. I am running freebsd 8.0 with the latest version of Apache 2. I have one user in a jail (kind of like a virtual server just a little different) and it is running the same software as the base system. I have one ip address on the server and was able to get both servers (The physical and the jail) working on separate domains. I have configured the dns for a subdomain (for the jail) but I can't get apache to work with it.

    Here is my current httpd-vhost.conf

    NameVirtualHost *:80
    <VirtualHost www.crystalwebmail.com:80>
        ServerAdmin webmaster@crystalwebmail.com
        DocumentRoot /usr/local/www/site
        DirectoryIndex index.html index.php
        ServerName www.crystalwebmail.com
        Errorlog /var/log/www.crystalwebmail.com-error.log
        CustomLog /var/log/www.crystalwebmail.com-access.log common
    
        <Directory /usr/local/www/site>
            Order allow,deny
            AllowOverride None
            Allow from all
            Options -Indexes
        </Directory>
    
    	Alias /trunk /usr/local/www/project/trunk
        <Directory /usr/local/www/project/trunk>
            Order allow,deny
            Allow from all
        </Directory>
    </VirtualHost>
    
    
    <VirtualHost forum.crystalwebmail.com:80>
    ServerName forum.crystalwebmail.com
    ServerAlias forum.*
    ServerAdmin webmaster@crystalwebmail.com
    DocumentRoot /usr/local/www/forum
    </VirtualHost>
    Code (markup):
    I am trying to get the forum.crystalwebmail.com to point to /usr/local/www/forum but all that happens is I get my original site. Any ideas? Thanks! :confused:

    -HD
     
    hunterhdolan, Jun 12, 2010 IP
  2. madaboutlinux

    madaboutlinux Member

    Messages:
    250
    Likes Received:
    7
    Best Answers:
    2
    Trophy Points:
    43
    #2
    This should work, however, have you tried changing the DocumentRoot of the sub-domain inside of the main domain i.e. move the forums inside the main site and change the DocumentRoot accordingly.
     
    madaboutlinux, Jun 13, 2010 IP
  3. oxyhosts2010

    oxyhosts2010 Peon

    Messages:
    11
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I just tried to take the URL "http://forum.crystalwebmail.com" in my browser and it came up nicely. So, I think the problem is resolved.
     
    oxyhosts2010, Jun 13, 2010 IP
  4. hunterhdolan

    hunterhdolan Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    No that is my current domian. I am trying this a on test server and test domain. I want to keep the domain secret though because I have information about my new product on this server. @madaboutlinux that didn't seem to work.... :(. Any other ideas? Thanks!
    -HD
     
    hunterhdolan, Jun 13, 2010 IP
  5. hunterhdolan

    hunterhdolan Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks! It was an combination of the httpd.conf, vhosts.conf and simple file permissions.
     
    hunterhdolan, Jun 14, 2010 IP