How to configure apache2 + PhP5 + mysql5 + GD library in centos Linux

Source: Internet
Author: User

First install the MySQL server
Decompress MySQL and copy all files to/usr/local/MySQL.
[Root @ bleach USR] # groupadd MySQL
[Root @ bleach USR] # useradd-G MySQL
[Root @ bleach MySQL] # cd/usr/local/MySQL
[Root @ bleach MySQL] # SCR limit pts/mysql_install_db -- user = MySQL
[Root @ bleach MySQL] # chown-r root.
[Root @ bleach MySQL] # chown-r Mysql Data
[Root @ bleach MySQL] # chgrp-r MySQL.
[Root @ bleach MySQL] #./bin/mysqld_safe -- user = MySQL &
[Root @ bleach MySQL] #./bin/mysqladmin-u Root Password MySQL
[Root @ bleach MySQL] # cp./support-files/MySQL. Server/etc/init. d/MySQL
[Root @ bleach MySQL] # cd/etc/rc3.d/
[Root @ bleach rc3.d] # ln-S/etc/init. d/MySQL s85mysql
[Root @ bleach rc3.d] # ln-S/etc/init. d/MySQL k85mysql

Install basic GD library package
# Rpm-IVH gd-devel-1.8.4-11.i386.rpm
Install XPM support
# Rpm-IVH xpm-3.4k-2.i386.rpm
Install libxml2 (remember php5.1.1 only supports libxml2-2.6.11 or above)
# Tar zxvf libxml2-2.6.11.tar.gz
# Cd libxml2-2.6.11
#./Configure
# Make
# Make install

Start to install GD library support
-------------------------------------------------------
Install the GD basic RPM package first
# Rpm-IVH gd-devel.rpm

Zlib
#./Configure
# Make
# Make install

Jpegsrc
#./Configure -- enable-shared
# Make
# Make install-lib
# Make install

Libpng
# Cp SCR implements pts/makefile. STD makefile
# Make
# Make install

Last is gd2 .*
#./Configure -- With-PNG =/usr/local -- With-JPEG =/usr/local -- With-FreeType =/usr
# Make
# Make install

----------------------------------------------
If everything above is successful, GD will be successfully installed. If there is a problem, it should be a lack of support packages. In short, if there is nothing to download

Install it.

Next, install apahche2 and PhP5.
#./Configure -- prefix =/usr/local/apache2 -- enable-module = so
# Make
# Make install

PhP5
#./Configure -- prefix =/usr/local/PHP -- with-apxs2 =/usr/local/apache2/bin/apxs -- With-JPEG-

Dir =/usr/local -- With-PNG-Dir =/usr/local -- With-Gd =/usr/local -- enable-trace-vars ---

Zlib-Dir =/usr/local-with-mysql =/usr/local/MySQL -- enable-mbstring = all
# Make
# Make install

Copy the php. ini file to the correct location.
Run in the PHP Directory
# Cp PHP. ini-Dist/usr/local/PHP/lib/PHP. ini

Edit the Apache configuration file httpd. conf.
# Vi/usr/local/apache2/CONF/httpd. conf

You need to modify the following items:
Generally
# Addtype application/X-tar. tgz
Add a row below
Addtype application/X-httpd-PHP. php

Search
Index.html
Add index.htm index. php to make index. php a response page.

Find
# Servername
Remove # and change the IP address to your IP address.

Find
"/Usr/local/apache2/htdocs"
Change "/usr/local/apache2/htdocs" to the path where your webpage files are stored.

Save the httpd. conf file.

Start it
#/Usr/local/apache2/bin/apachectl start
If no error occurs, write a test page and put it in your webpage directory.
Phpinfo ();
?>
Save. Try IP address in the tester to view the phpinfo page.

Add apache2 to System Service
# Cd/etc/init. d
# Cp/usr/local/Apache/bin/apachectl./httpd
Edit httpd in text
Add in the header
# Chkconfig: 345 79 15
# Descr restart ption: activates/deactivates Apache Web Server
# Processname: httpd
# Chkconfig -- add httpd

Installing ZendOptimizer-2.5.3 acceleration PHP
#./Install. Sh

--------------------------------------------------------------------
Now, the server has been set up. Let's take a look at the following.

Random startup of peanut shells
Use RedHat Linux and add a line of content to the/etc/rc. d/rc. Local file/usr/local/phlinux-d

By default, it should be fine.

Shared ADSL
# Echo "1">/proc/sys/NET/IPv4/ip_forward
# Iptables-T Nat-A postrouting-O ppp0-J Masquerade

Save User/group password and other configuration file paths

1) configuration files related to users;
/Etc/passwd Note: user configuration file;
/Etc/shadow Note: User shadow password file;

2) configuration files related to user groups;
/Etc/group Note: User Group configuration file;
/Etc/gshadow Note: shadow file of the user group;

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.