pointing the website from tomcat to the Apache server
I have a website website1.com on Apache server developed using PHP and deployed in Apache Server.
Now I have implemented a new features/modules in Java and JSP technologies and deployed in Tomcat server. Now what ever I have implemented in Java J2EE techologies should point to the subdomain of actual website website1.com and it should look like subdomain1.website1.com
Both Apache Tomcat and Apache S开发者_开发知识库erver resides in the Same machine.
Is that possible? if yes can you please help me how to do that ?
All the environment is set up on LINUX based Server.
You can try using a virtual host with a proxy pass rule. Core of the configuration would be:
NameVirtualHost *:80
# Default host to handle PHP and static content
<VirtualHost *:80>
DocumentRoot /var/www/www.website1.com
ServerName www.website1.com
# Other directives here
</VirtualHost>
# Tomcat redirector
<VirtualHost *:80>
DocumentRoot /var/www/subdomain1.website1.com
ServerName subdomain1.website1.com
# Other directives here
ProxyPass / ajp://website1.com:8009
</VirtualHost>
Assuming you have enabled AJP connecter within your Tomcat configuration and that its running on port 8009.
精彩评论