Saturday, December 22, 2012

Wednesday, December 05, 2012

page redirection on apache2 | mailarchiva:8090

Just finish setup my ubuntu vm box to host mailarchiva. It is running on tomcat it is running on port 8090 and with subfolder /mailarchiva. Since i'm using it in a domain i'm thinking why i don't just make a subdomain for it so it will be easier for the user to remember the URL.

Now it is currently hosted as 10.8.8.50:8090/mailarchiva it would be just nice if the user can visit the site just by mylarchiva.domain.com

I've set in the AD in the DNS host(A) to point myarchiva.domain.com to point to 10.8.8.50 in both reverse and forward lookup zone.
Install apache2 in the server so you can have it redirect to the tomcat server.

** installing apache2

sudo apt-get install apache2

Edit the apache2 httpd.conf (located at /etc/apache2/) to set the redirection.

sudo vi /etc/apache2/httpd.conf   

This command will use the vi editor to edit the httpd.conf file
press I to insert the redirect roles, type in

Redirect / http://myarchiva.domain.com:8090/mailarchiva

press esc once you have finish edit and pres : and follow by wq! to save   (w denote write & q denote quite)
** if you have done something wrong just press : follow by q!  to quit and not saving

restart the apache server !

/etc/init.d/apache2 restart


Now when you type in myarchiva.domain.com in your browser it should redirect you to http://myarchiva.domain.com:8090/mailarchiva