开发者

pointing the website from tomcat to the Apache server

开发者 https://www.devze.com 2023-04-09 22:47 出处:网络
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 ser

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号