---restore content starts---
- First, the system environment
- System Platform: CentOS 6.5 (Final)
- Apache version: httpd-2.2.31.tar.gz (latest version 2015-07-16)
- Mysql version: mysql-5.0.41.tar.gz
- PHP Version: php-5.2.6.tar.gz
- Second, pre-installation preparation
- 1. Library File Preparation
- Before you install PHP, you should install the latest version library files that PHP5 requires, such as LIBXML2, Libmcrypt, and GD2 libraries. The GD2 library is installed to allow PHP5 to support GIF, PNG, and JPEG picture formats, so you will need to install the latest zlib, libpng, FreeType, and JPEGSRC library files before installing the GD2 library. And the middle will also be interspersed with some software installed, the reader can be installed in the order provided in this section.
- Autoconf-2.61.tar.gz
- Freetype-2.3.5.tar.gz
- Gd-2.0.35.tar.gz
- Jpegsrc.v6b.tar.gz
- Libmcrypt-2.5.8.tar.gz
- Libpng-1.5.27.tar
- Libxml2-2.6.30.tar.gz
- Zlib-1.2.8.tar.gz
- Zendoptimizer-3.2.6-linux-glibc21-i386.tar.gz
- Phpmyadmin-3.0.0-rc1-all-languages.tar.gz
- 2. Install GCC, gcc-c++ compiler
- Use the GCC-V command to check for the existence of the compilation work used during installation
- If the system is not installed, use yum install gcc and yum install gcc-c++ installation in the case of system networking
- 3. Uninstall the default low-version environment
- In the current release of the Linux operating system version, if you choose to install all by default, you have installed the lamp environment, but the version is relatively low. We can install another lamp environment and the original coexistence, but this is not necessary, because at the same time can only open a lamp environment. All we need to do before installing, we should first check whether the system has installed a low version of the environment, if it has been installed, stop the original service operation, or the original environment uninstall.
- A. Uninstalling Apache
# Rpm-qa | grep httpd
Description: Check if the HTTPD package is installed
If so, use Rpm-e Httpd-2.2.3-63.el5.centos--nodeps
Description: Uninstall the package,--nodeps if there is a connection, also force uninstall
# cd/etc/httpd/
# RM-RF *
Description: Delete all of its installation directories and files to the original Apache installation directory
B. Uninstall MySQL
# Rpm-qa | grep MySQL
# rpm-e mysql-5.0.77-4.el5_4.2--nodeps
Description: Uninstall MySQL
C. Uninstalling PHP
# Rpm-qa | grep php
# rpm-e Php-common-5.1.6-27.el5--nodeps
# rpm-e Php-ldap-5.1.6-27.el5--nodeps
# rpm-e Php-cli-5.1.6-27.el5--nodeps
# rpm-e Php-5.1.6-27.el5--nodeps
Description: Uninstalling PHP
4. Clear firewall Rules
4. Turn off SELinux
Vi/etc/selinux/config
Third, install lamp
1, installation Zlib
Tar zxvf zlib-1.2.8.tar.gz
CD zlib-1.2.8
./configure
Make && make install
Zlib specified installation directory may cause libpng installation failure, it is not specified, for uninstall convenience, it is recommended that make install execution results output to the installation log file, easy to uninstall later.
2, installation libxml2wget Http://xmlsoft.org/sources/old/libxml2-2.6.32.tar.gztar ZXVF libxm2-2.6.32.tar.gz
CD Libxml2-2.6.32./configure--PREFIX=/USR/LOCAL/LIBXML2
Make && make install
3, Installation Libmcrypt
Tar zxvf libmcrypt-2.5.8.tar.gz
CD Libmcrypt-2.5.8./configure--prefix=/usr/local/libmcryp
Make && make install
4. Installing libpng
Tar zxvf Libpng-1.5.27.tar
CD Libpng-1.5.27.tar
./configure--prefix=/usr/local/libpngmake && make install
5. Install the JPEG librarywget https://sourceforge.net/projects/libjpeg/files/libjpeg/6b/jpegsrc.v6b.tar.gz/downloadmkdir/usr/local/ Jpeg6mkdir/usr/local/jpeg6/binmkdir/usr/local/jpeg6/libmkdir/usr/local/jpeg6/includemkdir-p/usr/local/jpeg6/ Man/man1./configure--prefix=/usr/local/jpeg6/--enable-shared--enable-staticmake && make The install--enable-shared and--enable-static parameters are used for building shared libraries and static libraries, respectively Libtool
6. Install FreeType fontsTar zxvf freetype-2.6.1.tarcd freetype-2.6.1./configure--prefix=/usr/local/freetypemake && make install
7, installation autoconfTar zxvf autoconf-2.69.tarcd autoconf-2.69./configure && make && make install
Error message missing Perl, using Yum-y install Perl
Then compile the installation (following the successful one)
8. Install GD librarywget Https://bitbucket.org/libgd/gd-libgd/downloads/libgd-2.1.1.tar.gztar zxvf LIBGD-2.1.1.TAR.GZCD ibgd-2.1.1./ Configure--prefix=/usr/local/gd2/--with-jpeg=/usr/local/jpep6/--with-freetype=/usr/local/freetype--with-png=/ Usr/local/libpngmake && make Install
9, install CMake (MySQL starting from 5.5 compile to compile with Cmkae, so to install CMake)
Tar zxvf Cmake-2.8.12.2.tar
CD cmake-2.8.12.2
./bootstrap
Gmake
Gmake Install
10. Installing Apache
./configure--prefix=/usr/local/apache2 \
--sysconfdir=/usr/local/apache2/etc/\
--WITH-INCLUDED-APR \
--ENABLE-DAV \
--ENABLE-SO \
--enable-deflate=shared \
--enable-expires=shared \
--enable-rewrite=shared
Make && make install
Test if the apache2 is installed successfully
/USR/LOCAL/BIN/APACHETCL Start Apache2
If you don't want to see the bottom line, go to the/etc/httpd.conf file
See if Port 80 is turned on
# Netstat-tnl|grep 80
Accessing the Apache server
Adding a self-starter
# echo "/usr/local/apache2/bin/apachectl start &>/dev/null" >>/etc/rc.d/rc.local
Install MySQL.
1. Installing Ncur
Yum-y Install ncur* Bison
2. Add the MySQL user to the MySQL groupuseradd-r-s/sbin/nologin MySQLmkdir-pv/usr/local/mysql/data3. Downloading MySQL and compiling the installationwgetHttp://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.32.tar.gztar ZXVF MYSQL-5.6.32.TAR.GZCD mysql-5.7.14cmake-dcmake_install_prefix=/usr/local/mysql \
-dmysql_datadir=/usr/local/mysql/data \
-DSYSCONFDIR=/USR/LOCAL/MYSQL/ETC/MY.CNF \
-dmysql_user=mysql \
-dwith_myisam_storage_engine=1 \
-dwith_innobase_storage_engine=1 \
-dwith_archive_storage_engine=1 \
-dwith_memory_storage_engine=1 \
-dwith_readline=1 \
-dmysql_unix_addr=/usr/local/mysql/data/mysql.sock \
-dmysql_tcp_port=3306 \
-denabled_local_infile=1 \
-denabled_downloads=1 \
-dwith_partition_storage_engine=1 \
-dextra_charsets=all \
-ddefault_charset=utf8 \
-DDEFAULT_COLLATION=UTF8_GENERAL_CI \
-dwith_debug=0 \
-dmysql_maintainer_mode=1 \
-dwith_ssl:string=bundled \
-dwith_zlib:string=bundled
Make && make install
RM-RF/ETC/MY.CNFCP SUPPORT-FILES/MY-DEFAULT.CNF/ETC/MY.CNFCP Support-files/mysql.server/etc/init.d/mysqldchmod 755/etc/init.d/mysqld chown-r mysql.mysql/usr/local/mysql/# #初始化数据库chmod +x scripts/mysql_install_dbscripts/mysql_ install_db--user=mysql--basedir=/usr/local/mysql/--datadir=/usr/local/mysql/data/ln-s/usr/local/mysql/bin/*/ Usr/bin/ln-s/usr/local/mysql/lib/*/usr/lib/ln-s/usr/local/mysql/man/man1/*/usr/share/man/man1ln-s/usr/local/ mysql/man/man8/*/usr/share/man/man8ln-s/usr/local/mysql/libexec/*/usr/local/libexec 4, start the MySQL service and join the boot service Mysqld startchkconfig mysqld On5, verifying that the MySQL service is starting NETSTAT-TULNP | grep 3306mysql
install php1. Install Libtool and Libtool-ltdl*wgettar ZXVFCD./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/ Php/etc--with-apxs2=/usr/local/apache2/bin/apxs--with-mysql=/usr/lib/mysql--enable-fpm--with-mcrypt-- Enable-mbstring--disable-pdo--with-curl--disable-debug--disable-rpath--enable-inline-optimization--with-bz2-- With-zlib--enable-sockets--enable-sysvem--enable-sysvshm--enable-pcntl--enable-mbregex--with-mhash--enable-zip --with-pcre-regex--with-mysql--with-mysqli--with-gd--with-jpeg-dirmake && make install
CentOS 6.5 under source installation lamp (linux+apache+mysql+php) environment