All developers can use the same domain and a port 80.
Developers should be able to access their own workspace through a single domain.
http://test.server.io/
cookie:tom +--------+
Developer1 | |
Tom +-------------> | Apache | +----------> /home/tom/project1
| |
| |
| |
cookie:jane | |
+-------------> | | +----------> /home/jane/project1
Developer2 | |
Jane | |
cookie:jane2 | |
+-------------> | | +----------> /home/jane/project2
| |
+--------+
+ ^
| |
v + docroot.map
+------------------------------+
| tom /home/tom/project1 |
| jane /home/jane/project1 |
| jane2 /home/jane/project2 |
+------------------------------+
This case has a constraint that delvelopers can not use different domains or ports. Using an alias cookie, multiple developers can access their own workspace through the same domain and a port.
!) Replace 'test.server.io' to your domain.
<VirtualHost *:80>
ServerName test.server.io
DocumentRoot /var/www/stage
RewriteEngine On
## SET Cookie
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
## SET alias
RewriteRule ^\/SET\/([^\/]+) - [CO=guru:$1:.server.io:86400:/,R=200,L]
## ERASE alias
RewriteRule ^\/ERASE\/([^\/]+) - [CO=guru:$1:.server.io:0:/,R=200,L]
RewriteMap docroot txt:/etc/httpd/conf/docroot.map
RewriteCond %{HTTP_COOKIE} guru=([^;]+)
RewriteRule ^/(.*) ${docroot:%1}/$1
</VirtualHost>
#
# Syntax:
# alias docroot
#
tom /home/tom/project1
jane /home/jane/project1
jane2 /home/jane/project2
]# httpd -t
Syntax OK
]# killall -USR1 httpd
Write http://test.server.io/SET/tom in the address bar of a browser. (Replace test.server.io to your domain)
If set cookie is well, OK message will be shown.
OK
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@timeticket.co.kr and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Done!