CentOS Linux To configure the APACHE2+PHP5+MYSQL5+GD library method _linux

Source: Internet
Author: User
Tags phpinfo centos
Install MySQL server first
Extract MySQL, copy all files to/usr/local/mysql
[Root@bleach usr]# Groupadd MySQL
[Root@bleach usr]# useradd-g MySQL MySQL
[Root@bleach mysql]# Cd/usr/local/mysql
[Root@bleach mysql]# scrī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 the GD Library Base pack
#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 version)
#tar ZXVF libxml2-2.6.11.tar.gz
#cd libxml2-2.6.11
#./configure
#make
#make Install

Start loading GD library support
-------------------------------------------------------
Install 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ĪPTS/MAKEFILE.STD Makefile
#make
#make Install

And finally, gd2.*.
#./configure--with-png=/usr/local--with-jpeg=/usr/local--with-freetype=/usr
#make
#make Install

----------------------------------------------
The above everything is very smooth, GD even if the successful installation. If there is a problem, it should be a lack of support package, in short what is less to download what

Shilai on installation.


Follow down and start installing 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--with-

Zlib-dir=/usr/local-with-mysql=/usr/local/mysql--enable-mbstring=all
#make
#make Install

Copy php.ini file to correct location
Run in PHP directory
#cp Php.ini-dist/usr/local/php/lib/php.ini

Edit Apache configuration file httpd.conf
#vi/usr/local/apache2/conf/httpd.conf

There are several places to change:
are generally in
#AddType Application/x-tar. tgz
Add one line to the next
AddType application/x-httpd-php. php

Find
Index.html
In the back add index.htm index.php Let it make index.php as the default page

and find
#ServerName
Remove the # and change the IP back to your IP.

Found it
"/usr/local/apache2/htdocs"
Change the two "/usr/local/apache2/htdocs" to the path where you store the Web page file

Save the httpd.conf file.

Start it
#/usr/local/apache2/bin/apachectl Start
If nothing goes wrong, write a test page and put it in your web directory, and mine is the/WWW
Phpinfo ();
?>
Save. Try playing IP in the tester and you can see the Phpinfo page.

Adding Apache2 to System services
#cd/ETC/INIT.D
#cp/usr/local/apache/bin/apachectl./httpd
Editing httpd with text
Join in the head
#chkconfig: 345 79 15
#descrīption: activates/deactivates Apache Web Server
# PROCESSNAME:HTTPD
#chkconfig--add httpd


Install ZendOptimizer-2.5.3 to accelerate PHP
#./install.sh

--------------------------------------------------------------------
At this point, the server has been set up, the following, you can look at random

Let the peanut shells start randomly
With Redhat Linux, add a single line of content to the/etc/rc.d/rc.local file/usr/local/phlinux/phlinux-d

All the way down to the default should be good.

Shared ADSL
#echo "1" >/proc/sys/net/ipv4/ip_forward
#iptables-T nat-a postrouting-o Ppp0-j Masquerade




Save user/Group password configuration file path

1 configuration files related to user (users);
/ETC/PASSWD Note: User's configuration file;
/etc/shadow Note: Users (user) shadow password file;

2 configuration files related to user groups (group);
/etc/group Note: User groups (group) configuration file;
/etc/gshadow Note: Shadow files for user groups (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.