0
votes

I connected Apache with Tomcat, so the server can run both jsp and php files.

It worked, but I don't want to show the port number, just like any other web sites.

So I changed Tomcat's to 80, and Apache's to 8080.

I checked both servers are on, and accessable, but php files didn't work.

So I tried to make it run, and figured out that only when Apache uses the port number 80, mod_jk works.

Is there good way to running Tomcat at 80, and making Apache to run only php files?

Or, can I make it to access Tomcat's ROOT project when I accessed to Apache and only php files be run from Apache?

Thank you.

1

1 Answers

0
votes

You don't have to change Apache's and Tomcat's ports. You can configure Apache as a reverse proxy for the specific domain, so it can handle and pass the requests to Tomcat.

For example:

   ProxyRequests Off

    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ProxyPass / http://domain.tld:8080/
    ProxyPassReverse / http://domain.tld:8080/