Question

I currently have a small team (2 people) working on project one of my site:

http://www.example.com/one/

I want to be able to assign more teams to future projects, such as team 2 for project two:

http://www.example.com/two/

It's sort of like how big corporate sites such as Microsoft.com is being built and managed, different sub-directory (projects) for different teams. Each of the teams has the privileges to run and manage their own project as a sub-directory of the root domain.

After some searches, I came about the mod_proxy module of Apache. It seems a perfect fit. However as I currently only has one team, or there might be other projects for more teams but the overall traffic is not so much as to need a whole new other server, my question is, how to relay the requests to another directory in the same server?

I know I can just set up different directories under different users but I want to be easily scaling out when the traffic actually takes off so I'd prefer using mod_proxy for this because I can actually add more servers when I need to.

ProxyRequests Off
ProxyPass /foo http://internal/bar
ProxyPassReverse /foo http://internal/bar

Wherein internal/bar is located at /home/team1/public_html

Is this possible? How to make this happen?

Or as per my need, is there any way that's fundamentally better than the mod_proxy approach?

Was it helpful?

Solution

There are a few ways to do this but you probably don't have to use reverse proxy unless your keen on having the projects on different ports/host names and don't want the user to know. Other wise just use Alias

  1. If using mod_proxy you would want to put the reverseproxy directives in a www.example.com vhost entry, you could also specify a document root for it. Then setup more vhosts for each of your projects, e.g. one.example.com. Each vhost can have a different DocumentRoot specified. Note you could accomplish something similar to reverseproxy via Redirect permanent however this would require a dns being setup for the subdomains. With your mod_proxy solution you can just add the subdomains to the hosts file.

  2. Use one of the methods mentioned here: https://httpd.apache.org/docs/1.3/urlmapping.html Alias directive, ScriptAliasMatch, User Directories with AliasMatch

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top