How to install a server that can run JSP and PHP at the same time?
Source: Internet
Author: User
The operating system is CentOSrelease5.4 (Final). PHP + MySQL has been installed, and jsp needs to be run now. Php server path already exists: datahome has tried to install Tomcat, but after installation, the server will conflict! (Tomcat can be used all the time, but php can be used occasionally )! How can this problem be solved ~~~ The operating system is CentOS release 5.4 (Final) and PHP + MySQL has been installed. now you need to run jsp.
Php server path: data/home
I have tried to install Tomcat, but after installation, the server will conflict! (Tomcat can be used all the time, but php can be used occasionally )!
How can this problem be solved ~~~ Reply content: Solution
1. resin
2. Apache + mod_jk + mod_php
3. front-end Nginx/Apache reverse proxy, and backend Tomcat and Apache/php-fpm are started respectively. Apahce processes PHP and static files, and uses the mod_jk module to throw JSP requests to Tomcat. we can get a lot of articles about centos + apache + php + tomcat on GOOGLE or Baidu, better than the above question, the two conflicts should be caused by both services occupying port 80. You can disable both services from using port 80 (two services must use different ports to avoid conflict), and then use a third-party reverse proxy software (this software occupies port 80) for example, nginx, developed by Russians, is now available in the windows version, which is very good.
If you do not want to use third-party software, you can also change tomcat to another port so that apache can use port 80 and then use apache as the reverse proxy. In fact, it is similar to nginx. There are multiple solutions. generally, a WebServer is used as the reverse proxy to forward the corresponding requests to httpd or tomcat. Nginx performs request forwarding. apache and tomcat change the service port to the service port. you can use the Nginx proxy resin to simultaneously process jsp and phpservlet container resin's built-in php support using mod_jk configuration. The agent may be unstable.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service