Say you want to host 2 projects called foo and bar in resin. Let us assume their war names are foo.war and bar.war.
- Create folders called foo and bar inside your resin folder.
- Create a folder called webapps inside the above created folders.
War files are deployed in the above created webapps folder.
Now add the following elements under the server tag of resin.conf file.
<host regexp="foo\.com"> <host-name>foo.com</host-name> <root-directory>foo</root-directory> <web-app id="/" document-directory="webapps/foo"> <session-config> <cookie-domain>foo.com</cookie-domain> </session-config> </web-app> </host> <host regexp="bar\.com"> <host-name>bar.com</host-name> <root-directory>bar</root-directory> <web-app id="/" document-directory="webapps/bar"> <session-config> <cookie-domain>bar.com</cookie-domain> </session-config> </web-app> </host>
In the above document-directory=”webapps/bar”, the part after webapps has to match your war file name.
Add the following to your hosts file:
127.0.0.1 foo.com
127.0.0.1 bar.com
Now you are all set to go.
Wonderful goods from you, man. I’ve be aware your stuff prior to and you’re simply too great.
I really like what you have acquired here, certainly like what you are
stating and the way wherein you say it. You’re making
it entertaining and you continue to care for to keep
it smart. I can not wait to read far more from you. This is really a great web site.
Very good information. Lucky me I recently found your blog by accident
(stumbleupon). I have book-marked it for later!