Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Tomcat and Apache installed in CentOS 5. They're integrated with a help of mod_jk.so.

They both display the same in http://www.tource.com/cms/admin and http://www.tource.com:8080/cms/admin

But I'd like to make the context cms displayed only when I access with address below. http://cms.tource.com/

How could the context "www.tource.com/cms" turn into "cms.tource.com" ?

share|improve this question

Do you have an apache config for this site? If so, please post it so we can get a better idea of how you have your site set up.

Here is one way to do it (with mod_proxy and mod_rewrite):


<VirtualHost *>
        ServerName cms.tource.com
        RewriteEngine On
        ProxyPass / http://tource.com:8080/cms/admin
        ProxyPassReverse / http://tource.com:8080/cms/admin

Proxy setting in Tomcat $TOMCAT_HOME/conf/server.xml

<Connector port="8080" protocol="HTTP/1.1"
               redirectPort="8443" proxyPort="80" />

Restart apache and visit cms.tource.com to see if its working for you.

share|improve this answer

In the web server config of www.tource.com add the following line:

Redirect /cms http://cms.tource.com

For more information , refer to apache documentation at http://httpd.apache.org/docs/2.2/mod/mod_alias.html

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.