CentOS-6.5-x86_64-minimal-httpd-2.4.12-mysql-5.6.23-php-5.6.8
------------------------------ 软件准备
http://mirror.bit.edu.cn/apache/apr/apr-1.5.2.tar.gz
http://mirror.bit.edu.cn/apache/apr/apr-util-1.5.4.tar.gz
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.gz
http://www.memcached.org/files/memcached-1.4.24.tar.gz
http://pecl.php.net/get/memcache-3.0.8.tgz
http://mirrors.hust.edu.cn/apache/httpd/httpd-2.4.12.tar.gz
ftp://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.6/mysql-5.6.23.tar.gz
http://cn2.php.net/get/php-5.6.8.tar.gz/from/this/mirror
[[email protected] ~]# ls /usr/local/src/
apr-1.5.2.tar.gz
apr-util-1.5.4.tar.gz
pcre-8.37.tar.gz
httpd-2.4.12.tar.gz
mysql-5.6.23.tar.gz
php-5.6.8.tar.gz
memcache-3.0.8.tgz // php extension
memcached-1.4.24.tar.gz
yum install gcc gcc-c++ cmake lynx autoconf bison automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* -y
wget http://mirror.bit.edu.cn/apache/apr/apr-1.5.2.tar.gz
./configure --prefix=/usr/local/apr
wget http://mirror.bit.edu.cn/apache/apr/apr-util-1.5.4.tar.gz
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.gz
./configure --prefix=/usr/local/pcre
------------------------------ apache install
[[email protected] httpd-2.4.12]# ./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre --enable-so
[[email protected] httpd-2.4.12]# make && make install
[[email protected] ~]# /usr/local/apache/bin/apachectl start
[[email protected] ~]# cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
[[email protected] ~]# vim /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
[[email protected] ~]# services iptables restart
------------------------------ mysql install
[[email protected] mysql-5.6.23]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=utf8,gbk -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/usr/local/mysql/data -DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306
[[email protected] mysql-5.6.23]# make && make install
[[email protected] ~]# groupadd mysql
[[email protected] ~]# useradd -r -g mysql mysql
[[email protected] ~]# chown -R mysql /usr/local/mysql
[[email protected] ~]# chgrp -R mysql /usr/local/mysql
[[email protected] ~]# chmod 775 /usr/local/mysql
[[email protected] ~]# /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
[[email protected] ~]# chown -R root /usr/local/mysql
[[email protected] ~]# chown -R mysql /usr/local/mysql/data
[[email protected] ~]# cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
[[email protected] ~]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
[[email protected] ~]# /etc/init.d/mysqld start
Starting MySQL... SUCCESS!
[[email protected] ~]# ln -s /usr/local/mysql/bin/mysql /usr/bin
[[email protected] ~]# /usr/local/mysql/bin/mysqladmin -u root password ‘root‘
mysql> select host,user,password from user;
mysql> delete from user where password=‘‘;
mysql> grant all privileges on *.* to [email protected]‘%‘ identified by "123456";
mysql> flush privileges;
[[email protected] ~]# vim /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
[[email protected] ~]# services iptables restart
------------------------------ php install
[[email protected] php-5.6.8]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql
[[email protected] php-5.6.8]# make && make install
修改apache配置文件 /usr/local/apache/conf/httpd.conf
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php 或者
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
通过phpinfo(); 找到php.ini 和 extension 的目录
/usr/local/apache/htdocs/phpinfo.php
Configuration File (php.ini) Path /usr/local/php/lib
Loaded Configuration File /usr/local/php/lib/php.ini
extension_dir /usr/local/php/lib/php/extensions/no-debug-zts-20131226
[[email protected] ~]# cp /usr/local/src/php-5.6.8/php.ini-development /usr/local/php/lib/php.ini
------------------------------ 总结
[[email protected] ~]# /usr/local/apache/bin/apachectl start
[[email protected] ~]# /etc/rc.d/init.d/httpd start
[[email protected] ~]# /etc/init.d/mysqld start
配置开机启动 vim /etc/rc.d/rc.local加入
/etc/init.d/httpd start
/etc/init.d/mysqld start
svnserve -d -r /data/svn
------------------------------ php install extension
[[email protected] ~]# wget http://pecl.php.net/get/memcache-3.0.8.tgz
[[email protected] ~]# tar zxf memcache-3.0.8.tgz
[[email protected] memcache-3.0.8]# /usr/local/php/bin/phpize --with-php-config=/usr/local/php/bin/php-config
[[email protected] memcache-3.0.8]# ./configure --with-php-config=/usr/local/php/bin/php-config
[[email protected] memcache-3.0.8]# make && make install
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-zts-20131226/
[[email protected] memcache-3.0.8]# vim /usr/local/php/lib/php.ini
extension=/usr/local/php/lib/php/extensions/no-debug-zts-20131226/memcache.so