1

I have my web server set up running multiple sites and host them all in ~/sites/, outside apache document root (~/www), as follows:

+-~/
  +-sites/
    +-project1/
    | +-system/
    | +-application/
    | +-public_html/
    |   +-images/
    |   +-css/
    |   +-index.php
    +-project2/
    | +-system/
    | +-application/
    | +-public_html/
    |   +-images/
    |   +-css/
    |   +-index.php

I order to make sites available via the web I create a symlink in ~/www/, as below:

+-~/
  +-www/
    +-project1 -> ~/sites/project1/public_html
    +-project2 -> ~/sites/project2/public_html

With this set up I end up with domain.com/project1 and domain.com/project2 pointing to my ~/sites/projectx directories and can easily change where they point to take a site offline.

The problem I'm having is how to host domain.com outside the document root; I can't set up a symlink like the others because the symlink would have to be ~/www/ which obviously can't be used.

TLDR; I want to set up ~/sites/domain/public_html to be served when domain.com is requested.

Matt
  • 322
  • 1
  • 3
  • 11

2 Answers2

2

Create it as a virtualhost. I do this all the time. My documentroot is /var/www/HTML but I host some sites under /home/

sdot257
  • 3,039
  • 5
  • 29
  • 38
  • I can't create a virtual host, I'm on a shared server and do not have access to `httpd.conf` – Matt Sep 27 '10 at 20:23
0

You can use a virtualhost. Here you have an example of this:

DocumentRoot "/home/httpd/sites/site1"
ServerName   site1.com

<Directory "/home/httpd/sites/site1">
    Options -Indexes +FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

Remember include the file in your httpd.conf