0

I have Centos 7 , Httpd Apache 2.4 and Tomcat 8 my goal is to connect to my site1.com which is on tomcat throw 80 port. Now if I go to site1.com I am redirected to site2.com which is on httpd apache server. site1.com:8080 - work correct.

/etc/httpd/sites-available/site1.com.config

<VirtualHost *:80>
 ServerName site1.com
 ProxyPass / ajp://localhost:8009/
 ProxyPassReverse / ajp://localhost:8009/
</VirtualHost>

/etc/httpd/sites-available/site2.com.config

<VirtualHost *:80>
  ServerName site2.com
  DocumentRoot /var/www/html/site2
</VirtualHost>
Edgaras Karka
  • 111
  • 1
  • 5
  • Most likely your redirect is coming from the application running in Tomcat. – Florin Asăvoaie Apr 07 '16 at 06:09
  • 1. Make sure both config files you mentioned in above question is included in httpd.conf 2. add NameVirtualHost *:80 in apache config 3. It's possible that your tomcat application redirecting to site2.com. – Vaibhav Panmand Apr 07 '16 at 06:11
  • stop tomcat,then if you get an error for site 1 = everything fine, if you get redirected to site 2, you know there is no tomcat redirect. – Dennis Nolte Apr 07 '16 at 08:19
  • It was not tomcat redirect. I added ServerAlias and after apache restart start work corectly – Edgaras Karka Apr 07 '16 at 08:51

0 Answers0