LAMP Quick installation
LAMP Quick installation
1. Introduction to the version
Linux:CentOS release 6.6 (Final)
Apache: httpd-2.2.31
Mysql:mysql-5.5.48
Php:php-5.3.27
2. Apache installation
Yum install-y zlib zlib-devel openssl-develmkdir / server/tools-pcd / server/tools/wget http://mirrors.sohu.com/apache/httpd-2.2.31.tar.gztar zxvf httpd-2.2.31.tar.gzcd httpd-2.2.31./configure\-- prefix=/application/apache2.2.31\-- enable-deflate\-enable-expires\-- enable-headers\-- enable-modules=most\-- enable-so\-- with-mem=worker\-- enable -rewritemakemake installln-s / application/apache2.2.31/ / application/apachesed-I 's@#ServerName www.example.com:80@ServerName 127.0.0.1 application/apachesed 80g' / application/apache/conf/httpd.conf/application/apache/bin/apachectl-t / application/apache/bin/apachectl start netstat-lntup | grep 80lsof-I: 80ps-ef | grep httpd3. Install mysql-5.5.48
Installation dependency
Yum install ncurses-devel libaio-devel-ycd / server/tools/wget https://cmake.org/files/v2.8/cmake-2.8.8.tar.gztar zxf cmake-2.8.8.tar.gzcd cmake-2.8.8./configuregmakegmake install
Install mysql
Useradd mysql- s / sbin/nologin-Mcd / server/tools/wget http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.48.tar.gztar zxvf mysql-5.5.48.tar.gzcd mysql-5.5.48cmake.-DCMAKE_INSTALL_PREFIX=/application/mysql-5.5.48\-DMYSQL_DATADIR=/application/mysql-5.5.48/data\-DMYSQL_UNIX_ADDR=/application/mysql-5.5.48/tmp/mysql. Sock\-DDEFAULT_CHARSET=utf8\-DDEFAULT_COLLATION=utf8_general_ci\-DEXTRA_CHARSETS=gbk Gb2312,utf8,ascii\-DENABLED_LOCAL_INFILE=ON\-DWITH_INNOBASE_STORAGE_ENGINE=1\-DWITH_FEDERATED_STORAGE_ENGINE=1\-DWITH_BLACKHOLE_STORAGE_ENGINE=1\-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1\-DWITHOUT_PARTITION_STORAGE_ENGINE=1\-DWITH_FAST_MUTEXES=1\-DWITH_ZLIB=bundled\-DENABLED_LOCAL_INFILE=1\-DWITH_EMBEDDED_SERVER=1\-DWITH_DEBUG=0make & & make installln-s / application/mysql-5.5.48/ / application/mysql
Initialize the database
Cd / server/tools/mysql-5.5.48/support-files//bin/cp my-small.cnf / etc/my.cnfchown-R mysql.mysql / application/mysql/application/mysql/scripts/mysql_install_db--basedir=/application/mysql-- datadir=/application/mysql/data-- user=mysqlcd / server/tools/mysql-5.5.48/support-files/cp mysql.server / etc/init.d/mysqldchmod + x / etc/init.d/mysqldchkconfig-- add mysqldchkconfig mysqld on/application/ Mysql/bin/mysqld_safe & sleep 1echo 'exportPATH= "$PATH:/application/mysql/bin/" > / etc/profilesource / etc/profilemysqladmin-u root password' 123456'
4. Install PHP php-5.3.27
Installation dependency
Yum install zlib-devel libxml2-devellibjpeg-turbo-devel libiconv-devel-yyum install freetype-devel libpng-devel gd-devellibcurl-devel libxslt-devel libtool-ltdl-devel openssl-devel-ycd / server/tools/wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gztar zxvf libiconv-1.14.tar.gzcd libiconv-1.14./configure-- prefix=/usr/local/libiconvmakemake installcdwget-O / etc/yum.repos.d/epel.repo http://mirrors .aliyun.com/repo/epel-6.repols / etc/yum.repos.d/yum install-y libmcrypt-develyum install mhash mhash-devel mcrypt- y
Install php-5.3.27
Cd / server/tools/wget http://cn2.php.net/distributions/php-5.3.27.tar.gztar zxvf php-5.3.27.tar.gzcd php-5.3.27./configure\-- prefix=/application/php5.3.27\-- with-apxs2=/application/apache/bin/apxs\-- with-mysql=/application/mysql\-- with-xmlrpc\-- with-openssl\-- with-zlib\-- with-mcrypt\-- with-mhash\- With-mcrypt\-- with-mhash\-- with-freetype-dir\-- with-gd\-- with-jpeg-dir\-- with-png-dir\-- with-iconv-dir=/usr/local/libiconv\-- enable-short-tags\-- enable-sockets\-- enable-zend-multibyte\-- enable-soap\-- enable-mbstring\-- enable-static\-enable-gd-native-ttf\-with-curl\-- with-xsl\-- enable- Ftp\-with-libxml-dirmakemake installln-s / application/php5.3.27 / application/phpcp php.ini-production / application/php/lib/php.ini5. LAMP integration
N check the Apache configuration file after installing php and find that Apache has loaded the php module
[root@liwenbin etc] # grep libphp5/application/apache/conf/httpd.confLoadModule php5_module modules/libphp5.so
N add support for php parsing
Vi / application/apache/conf/httpd.conf + 310AddType application/x-httpd-php .php .htmlAddType application/x-httpd-php-source .phps
N modify the running user of Apache
Useradd-s / sbin/nologin-M apachevi / application/apache/conf/httpd.conf + 67User apacheGroup apache
N modify the home file
DirectoryIndex index.php index.html
6.LAMP integration testing
N apache and php integration testing
Vi / application/apache/html/blog/phpinfo.php
N Apache, mysql and php integration testing
Vi / application/apache/html/blog/test_mysql.php