lamp=mysql+appache+php, build lamp must follow the steps, first MySQL and then Appahe, and finally PHP
1.mysql Installation
This article MySQL uses the binary source package (provides two mirrors free download point: A:https://github.com/aminglinux/resource/wiki
B:HTTP://MIRRORS.SOHU.COM/?QQ-PF-TO=PCQQ.C2C)
First download the binary package: Mysql-5.7.11-linux-glibc2.5-x86_64.tar.gz Package (X86 is a 64-bit system, i836 is a 32-bit system according to the needs of its own system)
CD/USR/LOCAL/SRC (usually download the package here)
TAR-ZXVF mysql-5.7.11-linux-glibc2.5-x86_64.tar.gz
Generate mysql-5.7.11-linux-glibc2.5-x86_64. Directory
Useradd-s sbin/nologin-m MySQL (create account, do not allow login,-m do not generate home directory)
MV Mysql-5.7.11-linux-glibc2.5-x86_64/usr/local/mysql (move the extracted directory to/usr/local/renamed to MySQL) "MySQL default installation path in:/usr/local/ MySQL
4) initializing and assigning accounts
Mkdir-p/data/mysql
./scripts/mysql_install_db--user=mysql--datadir=/data/mysql (DataDir storage data)
Note: There are 2 OK to represent a successful
5). mysql configuration file in (/ETC/MY.CNF)
CD support-files/
CP my-large.cnf/etc/my.conf
VI my.conf
"Mysqld" is used to configure the MySQL service
Log-bin=mysql-bin (the update data will have the corresponding log)--. > master-Slave useful
CP Mysql.sever/etc/init.d/mysqld
Vi/etc/init.d/mysqld
Found it
Basedir=/usr/local/mysql
Datadir=/data/mysql
Chkconfig-add mysqld (Join system Services list)
Chkconfig mysqld on (boot start)
/etc/init.d/mysqld start
Ps-aux |grep MySQL
Netstart-lnp|grep MySQL
2.apache Installation
Download Source Package 2.2.31
After decompression, do not know how to install, can be vim install to view the installation document.
./configure--prefix=/usr/local/apache2 \ (installation path)--WITH-INCLUDED-APR \ (http lazy packet, for direct HTTP cross-platform use)--enable-so-- Enable-deflate=shared--enable-expires=shared \ Dynamic Shared mode installation--enable-rewrite=shared--with-pcre a regular-related library
/USR/LOCAL/APACHE2/BIN/APACHEETC1 start (Start Apache)
/usr/local/apache2/bin/apacheetc1-m Display module (dynamic static)
Make
Make install
The dynamic module is placed in the/usr/local/apache2/modules/when required to load the static module in/USR/LOCAL/APACHE2/BIN/HTTPD all loaded into a file/usr/local/apache2/bin/ Apacheetc1-l display static module/usr/local/apache2/bin/apacheetc1-t View configuration file There is no syntax error profile/usr/local/apache2/conf/http.conf
3.php compilation installation (typically 5.4 compiled)
./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache2/bin/apxs--with-config-file-path=/usr/local/ Php/etc--with-mysql=/usr/local/mysql--with-libxml-dir--with-gd--with-jpeg-dir--with-png-dir--with-freetype-dir --with-iconv-dir--with-zlib-dir--with-bz2--with-openssl--with-mcrypt--enable-soap--enable-gd-native-ttf-- Enable-mbstring--enable-sockets--enable-exif will encounter many errors during the compilation process because PHP relies on too many packages. You can install an extension source Makemake install
After installation you will find the Apache/usr/local/appache2/bin/apachectl-m module loaded with one more module (php_module) and then reboot Apache
Such a simple lamp environment will be built, and later write how to optimize the method and experience.
The construction of lamp environment under Linux