1

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" ?

2 Answers 2

0

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.

0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .