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>
  • Most likely your redirect is coming from the application running in Tomcat. – Florin Asăvoaie Apr 7 '16 at 6: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 7 '16 at 6: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 7 '16 at 8:19
  • It was not tomcat redirect. I added ServerAlias and after apache restart start work corectly – Edgaras Karka Apr 7 '16 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.