Configure httpd.conf alias/subdirectory point to another server

5,818

Solution 1

ProxyPass and ProxyPass Reverse is the way forward here.

Solution 2

The easiest thing to do is mount a NFS (or similar) share then point the alias directory to that mount point.

The FreeBSD Diary has instructions for NFS.
Apache has instructions for alias.

If you want to proxy the request Apache has instructions for proxy too. This is much more complicated, but may be what you're looking for. The first server passes the request to the second server, and returns the resulting page back to the original requester (it acts as a transparent proxy between client and the source server).

Share:
5,818

Related videos on Youtube

Admin
Author by

Admin

Updated on September 17, 2022

Comments

  • Admin
    Admin over 1 year

    I,m having a web server for testing purposes to host my domain http://www.domain.com which run perfectly. Below is server specs:

    • OS Freebsd 7.2
    • MySQL 5.1.33
    • Apache 2.2.11
    • PHP 5.2.9

    I can do alias directory in my httpd.conf so that my domain can have subdirectory hosting in the same server such as httpd://domain.com/subdomain1, httpd://domain.com/subdomain2 and so on. All my subdomain1 and subdomain2 directory folders reside on the same web server but only different location.

    Below is my example from httpd.conf for the alias subdomain1 block:

    Alias /subdomain1 "/usr/local/www/subdomain1"
    <Directory "/usr/local/www/subdomain1"> 
    Options +Indexes 
    AllowOverride None 
    allow from all
    </Directory>
    

    I,m looking a way in order my subdomain1 and subdomain2 directory is read from another server in my LAN but remain hosted as httpd://domain.com/subdomain1. Really appreciate anyone know how to do this.

    Thanks,