CentOSyum install Apache + PHP + MySQL + Tomcat

Source: Internet
Author: User
Tags php mysql
1. install Apahce, PHP, MySQL, and php to connect to the mysql Library components. # Yum-yinstallhttpdphpmysqlmysql-serverphp-mysql2. install apache extension # yum-yinstallhttpd-manualmod_sslmod_perlmod_auth_mysq...

1. install Apahce, PHP, MySQL, and php to connect to the mysql Library components.
# Yum-y install httpd php mysql-server php-mysql


2. install apache extension

# Yum-y install httpd-manual mod_ssl mod_perl mod_auth_mysql


3. install php extension
# Yum-y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc

4. install MySQL extension

# Yum-y install mysql-connector-odbc mysql-devel libdbi-dbd-mysql

5. configure the startup service
#/Sbin/chkconfig httpd on [set the startup of the httpd service on the apache server]
#/Sbin/service httpd start [start the httpd service, which has nothing to do with startup]
#/Sbin/service mysqld start [start the mysqld service, which has nothing to do with startup]

 

The apache configuration file is under/etc/httpd/conf.
Place modules in/usr/lib/httpd
The php configuration file is under/etc/php. d/and/etc/php. ini
Put the php modules under/usr/lib/php/modules.

 

6. install Tomcat 5

# Yum-y install tomcat5 tomcat5-webapps tomcat5-admin-webapps

 

7. start Tomcat 5

# Service tomcat5 start

 

8. enter http://www.2cto.com: 8080/in the browser, you can see the Apache SoftWare Foundation page, if not, please confirm whether it is a firewall problem

 

You can use the service tomcat5 stop command to stop tomcat.

You can use the chkconfig tomcat5 on command to start tomcat at startup.
The installation directory of Tomcat5 is located at/user/share/tomcat5.

 

9. Integration of Apache and Tomcat

 

If the website needs to be integrated with Apache and Tomcat, JK or Proxy can be used.

Use VI to edit the proxy_ajp.conf file

# Vi/etc/httpd/conf. d/proxy_ajp.conf

Enter the following content

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

After the file is stored, restart Apache

# Service httpd restart

 

10. enter http: // your IP address/tomcat/in the browser to view the Apache SoftWare Foundation page.

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.