Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

2 Answers 2

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):

/etc/httpd/conf.d/cms.conf

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

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

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               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

 
discard

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.