2 documentroots set up possible

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jersay Ballot

    2 documentroots set up possible

    Find answers to Using alias for two documentroot from the expert community at Experts Exchange


    I found the link but it doesn't seem to help at all.
    I'd like to use 2 directories as root ones at the same time. If this is
    possible please explain how, I am grateful.

  • Kim André Akerø

    #2
    Re: 2 documentroots set up possible

    Jersay Ballot wrote:
    Find answers to Using alias for two documentroot from the expert community at Experts Exchange

    >
    I found the link but it doesn't seem to help at all.
    I'd like to use 2 directories as root ones at the same time. If this
    is possible please explain how, I am grateful.
    This is actually more of an Apache configuration issue, and doesn't
    have anything to do with PHP. However, your httpd.conf (or wherever the
    virtual host configuration for your hostname(s) are in your Apache
    configuration files) has to have something like this for your virtual
    host:

    <VirtualHost 192.168.0.1:80>
    ServerName example.com
    DocumentRoot /www/example.com
    Alias /root /var/localhost/htdocs
    <Directory /www/example.com>
    Order allow, deny
    Allow from all
    AllowOverride All
    </Directory>
    <Directory /var/localhost/htdocs>
    Order allow, deny
    Allow from all
    AllowOverride None
    </Directory>
    </VirtualHost>

    Please note that this is just an example on how to do this. In the
    above example, files for http://example.com/ are physically located in
    /www/example.com, while files for http://example.com/root/ are located
    in /var/localhost/htdocs on your server.

    You can also do the same outside the <VirtualHostblo ck, but then the
    Alias'ed directory will be available on all virtual hosts on that
    server.

    This can only be done inside the main Apache configuration (global) and
    inside a <VirtualHostblo ck (local to a virtual host), and not from a
    ..htaccess file, ie. you will need access to the main Apache
    configuration.

    If you don't have access to the Apache configuration, the only option
    left would be to set up a symbolic link if you have the FollowSymLinks
    option set.

    --
    Kim André Akerø
    - kimandre@NOSPAM betadome.com
    (remove NOSPAM to contact me directly)

    Comment

    Working...