lamp 网站服务器
=====================
iptables & selinux disabled
yum remove php* httpd* mysql*
tar zxf mysql-*.tar.gz
yum install make cmake gcc gcc-c++ ncurses-devel bison openssl-devel zlib-devel
cd mysql-*
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/lamp/mysql \
-DMYSQL_DATADIR=/usr/local/lamp/mysql/data \
-DMYSQL_UNIX_ADDR=/usr/local/lamp/mysql/data/mysql.sock \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci
make && make install
如果编译失败 再次编译需要执行make clean
rm -f CmakeCache.txt
mysql config
useradd -s /sbin/nologin -M mysql
cd /usr/local/lamp/
cp support-files/my-medium.cnf /etc/my.cnf #根据服务器配置选择适合的配置文件
cp support-files/mysql.server /etc/init.d/mysqld
chown -R mysql.mysql .
./scripts/mysql_install_db --basedir=/usr/local/lamp/mysql/ --datadir=/usr/local/lamp/mysql/data/ --user=mysql
chown -R root .
chown -R mysql data/ data 目录必须mysql用户
nginx
tar zxf nginx-*
cd nginx-*
yum install openssl-devel pcre-devel
cd /root/nginx-1.0.8/auto/cc
vim gcc
modify
find /-g
# debug
#CFLAGS="$CFLAGS -g"
cd /root/nginx-1.0.8/src/core
vim nginx.h
modify
#define NGINX_VER "nginx"
/configure --user=nginx --group=nginx --prefix=/usr/local/lamp/nginx --with-http_ssl_module --with-http_stub_status_module
nginx web wiki.nginx.org
php
tar zxf libiconv-1.13.1.tar.gz
#加强系统对支持字符编码转换的功能
cd libiconv-1.13.1/
./configure --libdir=/usr/local/lib64
make && make install
tar jxf libmcrypt-2.5.8.tar.bz2
# mcrypt mhash是php加密算法扩展库
cd libmcrypt-2.5.8
./configure –libdir=/usr/local/lib64
make && make install
cd libltdl
./configure –libdir=/usr/local/lib64 –enable-ltdl-install
make && make install
tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9
./configure –libdir=/usr/local/lib64
make && make install
ldconfig /usr/local/lib64
tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
./configure --libdir=/usr/local/lib64
make && make install
#./configure时可能会报这个错:/bin/rm: cannot remove `libtoolT’: No such file or
directory 直接忽略
yum install net-snmp-devel curl-devel libxml2-devel libpng-devel libjpeg-devel freetype-
devel gmp-devel openldap-devel -y
useradd -M -s /sbin/nologin nginx
yum install net-snmp-devel curl-devel libxml2-devel libpng-devel libjpeg-devel freetype-devel gmp-devel openldap-devel -y
tar jxf php-5.3.6.tar.bz2
cd php-5.3.6
./configure --prefix=/usr/local/lamp/php --with-config-file-path=/usr/local/lamp/php/etc --with-mysql=/usr/local/lamp/mysql/ --with-openssl --with-snmp --with-gd --with-zlib --with-curl --with-libxml-dir --with-png-dir --with-jpeg-dir --with-freetype-dir --without-pear --with-gettext --with-gmp --enable-inline-optimization --enable-soap --enable-ftp --enable-sockets --enable-mbstring --with-mysqli=/usr/local/lamp/mysql/bin/mysql_config --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-libdir=lib64 --with-mcrypt --with-mhash
make ZEND_EXTRA_LIBS='-liconv'
make install
阅读(793) | 评论(0) | 转发(0) |