(summary) CentOS 6.x uses Yum to quickly install Apache+php+tomcat (JSP) +mysql

Source: Internet
Author: User
Tags install php ldap odbc pack pear php mysql phpinfo

(summary) CentOS 6.x uses Yum to quickly install Apache+php+tomcat (JSP) +mysql

PS: This is lazy yum quick-install method for development and test environments is convenient for production environments with no special requirements. Special requirements or you have to compile the installation bar ~ ~

1. Install Apahce, PHP, MySQL, and PHP to connect to MySQL database package:
# yum -y install httpd php mysql mysql-server php-mysql

2. Install Apache Common Expansion pack:
# yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql

3. Install PHP Common Expansion pack:
# yum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-devel

4. Install MySQL's Common expansion pack:
# yum -y install mysql-connector-odbc mysql-devel libdbi-dbd-mysql

5. Install TOMCAT6 Related packages:
# yum -y install tomcat6 tomcat6-webapps tomcat6-admin-webapps tomcat6-docs-webapp tomcat6-javadoc
Description: If the CentOS 5.x,yum is installed with the TOMCAT5 version, the following:
# yum -y install tomcat5 tomcat5-webapps tomcat5-admin-webapps tomcat5-docs-webapp tomcat5-javadoc

6. All packages one-click installation commands are as follows:
yum -y install httpd php mysql mysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-devel mysql-connector-odbc mysql-devel libdbi-dbd-mysql tomcat6 tomcat6-webapps tomcat6-admin-webapps tomcat6-docs-webapp

7. Configure Apache, MySQL, Tomcat service boot from:

# chkconfig httpd on
# chkconfig mysqld on
# chkconfig tomcat6 on

8. Restart Apache, MySQL, Tomcat services:

# /etc/init.d/httpd restart
# /etc/init.d/mysqld restart
# /etc/init.d/tomcat6 restart

Description

Apache configuration file is in/etc/httpd/conf/.
Modules put it in/usr/lib/httpd/.
PHP configuration files in/etc/php.d/and/etc/php.ini
PHP modules put in/usr/lib/php/modules.
MySQL config file in/etc/my.cnf
TOMCAT6 installation directory is located in/user/share/tomcat6/
TOMCAT6 's configuration file is located in/etc/tomcat6/.

9, in the Apache Web site root directory (default is/var/www/html/) to build a PHP Environment test page:
# vim phpinfo.php
Input:
<?php
phpinfo();
?>

In the browser access phpinfo.php, as shown in:

10, in the browser input http://Your ip:8080, you can see the Apache Software Foundation page, if you do not see, please check whether firewall problems. As shown in the following:

11, Apache and Tomcat integration:

If the site requires simultaneous integration between Apache and Tomcat, you can use the JK or proxy mode to edit the proxy_ajp.conf file using vim:
# vim /etc/httpd/conf.d/proxy_ajp.conf

Enter the following:
ProxyPass /tomcat/ ajp://localhost:8009

Restart Apache and Tomcat services after saving:

# /etc/init.d/httpd restart
# /etc/init.d/tomcat6 restart

12, in the browser input http://Your ip/tomcat/, you can see the Apache Software Foundation page.

13. Tomcat Manager User Management settings:
# Vim/etc/tomcat6/tomcat-users.xml
Put this section of configuration:

<tomcat-users><!--  <role rolename= "Tomcat"/>  <role rolename= "Role1"/>  <user Username= "Tomcat" password= "Tomcat" roles= "Tomcat"/>  <user username= "Both" password= "Tomcat" roles= " Tomcat,role1 "/>  <user username=" Role1 "password=" Tomcat "roles=" Role1 "/>--><!--the host manager WebApp is restricted to users with role "admin"--><!--<user name= "tomcat" password= "password" roles= "admin"/> ;--><!--the manager WebApp is restricted to users with role "manager"--><!--<user name= "Tomcat" password= "Password" roles= "manager"/>--></tomcat-users>

Modify it as shown in the following:

It means to add Administrator Role Manager, as well as admin Account admin and password 888888.
When you finally restart the Tomcat service and then access the admin page, use admin Account Admin and password 888888 to log on successfully, as shown in:

(summary) CentOS 6.x uses Yum to quickly install Apache+php+tomcat (JSP) +mysql

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.