CentOS yum install Apache + PHP + Tomcat7 + MySQL

You can refer to the following to install Apache + PHP + Tomcat7 + MySQL on CentOS.


Linux The most used web environment on the platform is php, Java and MySQL, we will build this environment, you can Run many open source programs.

As a programmer, although you don't need to be proficient in operation and maintenance, it is better to master the basic Linux environment construction, and it is also convenient for you to debug some codes and programs.

There are lamp and lnmp one-click packages for php, which can easily install the environment with one click. If you are running Java Web application, you need to use Tomcat.

In fact, under Linux, it is easy to manually install and configure these software by yourself. Instead of compiling and installing from source code, we use yum commands to complete.

Let's take the most commonly used Linux systems CentOS5.x and 6.x as examples to talk about the installation steps. According to this operation, you can also build a php+java+MySQL environment by yourself!

After remote ssh login into the system, first

  1. Install Apahce, PHP, MySQL, and PHP to connect to the mysql library component

yum -y install httpd php mysql mysql-server php-mysql //here "-y" parameter means silent installation, no prompts and interaction will appear

  1. Install apache extension

yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql

  1. Install common extensions of php

yum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc

  1. Install MySQL extension

yum -y install mysql-connector-odbc mysql-devel libdbi-dbd-mysql

  1. Configure boot service

/sbin/chkconfig httpd on [Set the apache httpd service to start on boot]

  1. Install Tomcat7

yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel

wget http://mirrors.hust.edu.cn/apache/tomcat/tomcat-7/v7.0.42/bin/apache-tomcat-7.0.42.tar.gz

tar -zxvf apache-tomcat-7.0.42.tar.gz

mv apache-tomcat-7.0.42 /usr/local/tomcat7

  1. Start Tomcat7
    #. /usr/local/tomcat7/bin/startup.sh

  2. Enter http://your IP:8080/ in the browser address bar, you can see the start page of Apache Tomcat, if you can’t see it, please confirm whether it is a firewall problem.

  3. Apache and Tomcat integration
    Here we use a simple Proxy method to integrate Apache and Tomcat

vi /etc/httpd/conf.d/proxy_ajp.conf

Add ProxyPass / ajp://localhost:8009/ (If you already have this file, just delete the comment symbol # before the corresponding content)

/////////////////////////////////////////////////////////////////////

Using ProxyPass / ajp://localhost:8009/ will cause applications installed under Apache (httpd) to be inaccessible.

The directories can be distinguished by the following methods

ProxyPass /tomcat/ ajp://localhost:8009/

Enter http://your IP/tomcat/ in the browser address bar, you can see the start page of Apache Tomcat

/////////////////////////////////////////////////////////////////////
After saving the changes, restart Apache

service httpd restart

  1. Enter http://your IP/ in the address bar of the browser, if you see the start page of Apache Tomcat, congratulations, the integration of Apache and Tomcat has been successful!

The software files and configuration paths installed above are as follows:

The apache configuration file is under /etc/httpd/conf
Apache's modules are placed under /usr/lib/httpd
The php configuration file is under /etc/php.d/ and /etc/php.ini
PHP modules are placed under /usr/lib/php/modules
The installation directory of Tomcat7 is located at /usr/local/tomcat7

Through the above simple steps, you can also configure the web environment commonly used under Linux.

reference:

http://my.oschina.NET/vikingz/blog/153469

http://www.xianren.org/system/centos6-4-yum-mysql-jdk-tomcat.html

Recommended Posts

CentOS yum install Apache + PHP + Tomcat7 + MySQL
CentOS 7.2 Yum install MySQL 5.6
centos install mysql through yum
Centos7 uses yum to install Apache, mariadb, PHP
CentOS 7 yum install PHP7.3 tutorial
Centos compile and install LAMP (apache-2.4.7 + mysql-5.5.35 + php 5.5.8) + Redis
CentOS7 yum install and start mysql
CentOS 7 install Nginx, PHP, MySQL packages
CentOS7 yum install and start mysql
Centos yum install mysql5.6 or above
CentOS7.2 install Mysql5.7.13
Centos6.5 install Tomcat
CentOS install mysql
CentOS install PHP
CentOS7 install mysql
CentOS 7 install MySQL 5.6
CentOS8 install MySQL8.0
CentOS7 install mysql8
CentOS7 install MySQL8
centos 7.5 install mysql5.7.17
Linux environment construction: CentOs + Apache + MySQL + PHP
CentOS7 system yum way to install MySQL5.7
CentOS6.5 offline install MySQL5.6.26
Install MySQL5.7 in centos7
Install php in centos
Install mysql5.7 under CentOS7
Centos7 install Mysql8 tutorial
CentOS7 install JDK8, tomcat8
Centos manually install mysql8
Install mysql under Centos 7
Centos7 install Mysql database
Centos7 YUM install MariaDB 10.0
Install mysql5.1 under CentOS6.5
Install mysql online on centos
Centos7.6 method to install Tomcat-8.5.39
CentOS6.5 install Java 8 and Tomcat8
Install MySQL 8.0.16 on Linux Centos
Install PHP in yum under CentOS, configure php-fpm service
Install MySQL under Linux (CentOS 7)
CentOS6.5 install Java 8 and Tomcat8
Centos6 install mysql 5.7.x series
CentOS6.5 install Java 8 and Tomcat8
CentOS8 install MySQL8 (pro test)
How to install MySQL on CentOS 8
How to install PHP7.4 in CentOS
Install MySql with Docker in CentOS7
Install java in yum mode in Centos
Install MySQL on Linux CentOS7 (Windows)
How to install Tomcat 9 on CentOS 8
Centos7 and centos8 install mysql5.6 5.7 8.0 so simple
centos7 .*tar package to install MySQL5.7
Centos install php73 fast cgi + nginx
How to install Apache on CentOS 8
How to install PHP on CentOS 8
virtualBox install centos, and build tomcat
1.5 Install Centos7
CentOS7.5 source code compile and install mysql5.7.29
How to install Apache Maven on CentOS 8
Install mysql8.0.13 version under Linux CentOS7 system
How to install Apache Kafka on CentOS 7
Centos7 compile and install MySQL8 problem record