Molet

CENTOS 5下安装NGINX-1.0.0 PHP-5.3.6 MYSQL-5.5.13

Molet linux 2023-01-25 492浏览 0

用yum升级一些必备的程序:

# yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers

安装前准备:

# tar zxvf libiconv-1.13.1.tar.gz
# cd libiconv-1.13.1
# ./configure --prefix=/usr/local
# make
# make install

# tar -zxvf libmcrypt-2.5.8.tar.gz
# cd libmcrypt-2.5.8/
# ./configure
# make
# make install
# /sbin/ldconfig
# cd libltdl/
# ./configure --enable-ltdl-install
# make
# make install

# tar zxvf mhash-0.9.9.9.tar.gz
# cd mhash-0.9.9.9/
# ./configure
# make
# make install

# ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la
# ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so
# ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
# ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8
# ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a
# ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la
# ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so
# ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
# ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1

# tar zxvf mcrypt-2.6.8.tar.gz
# cd mcrypt-2.6.8/
# /sbin/ldconfig
# ./configure
# make
# make install

安装cmake

# tar zxvf cmake-2.8.4.tar.gz
# cd cmake-2.8.4/
# ./configure  --prefix=/usr
# gmake
# gmake install

# tar zxvf bison-2.4.3.tar.gz
# cd bison-2.4.3
# ./configure
# make
# make install

安装mysql5.8.13

# groupadd mysql
# useradd -g mysql mysql
# cmake -DMYSQL_USER=mysql -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql/data -DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_SSL=yes -DWITH_DEBUG=0
# make
# make install
# /usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql/ --datadir=/data/mysql/data --user=mysql
# cd /usr/local/mysql/support-files/
# cp my-innodb-heavy-4G.cnf /etc/my.cnf
# cp mysql.server /etc/rc.d/init.d/mysql
# chown mysql:mysql /etc/rc.d/init.d/mysql
# chmod +w /etc/rc.d/init.d/mysql
# chown -R mysql:mysql /data/mysql

安装php-5.3.6

# groupadd www
# useradd -g www www
# yum install net-snmp-devel  net-snmp net-snmp-utils
# tar -zxvf php-5.3.6.tar.gz
# cd php-5.3.6
# ln -s /usr/local/mysql/lib/libmysqlclient.a /usr/lib/libmysqlclient_r.a
# ln -s /usr/local/mysql/lib/libmysqlclient.so /usr/lib/libmysqlclient_r.so
# ln -s /usr/local/mysql/lib/libmysqlclient.so /usr/lib/libmysqlclient_r.so.18
# ln -s /usr/local/mysql/lib/libmysqlclient.so /usr/lib/libmysqlclient_r.so.18.0.0
# ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib/libmysqlclient.so
# ln -s /usr/local/mysql/lib/libmysqlclient.so.18.0.0 /usr/lib/libmysqlclient.so.18
# ln -s /usr/local/mysql/lib/libmysqlclient.so.18.0.0 /usr/lib/libmysqlclient.so.18.0.0
# ln -s /usr/local/mysql/lib/libmysqlservices.a /usr/lib/libmysqlservices.a
# ln -s /usr/local/mysql/lib/libmysqlclient.a /usr/lib/libmysqlclient.a
# ln -s /usr/lib64/libpng.so /usr/lib/libpng.so
# ln -s /usr/lib64/libjpeg.so /usr/lib/libjpeg.so
# ldconfig -v
# ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql/ --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql/ --with-iconv-dir=/usr/local --enable-fpm  --disable-phar --enable-safe-mode --with-fpm-user=www --with-fpm-group=www --with-pcre-regex --with-zlib --with-bz2 --enable-calendar --with-curl --enable-dba --with-libxml-dir --enable-ftp --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --enable-gd-native-ttf --enable-gd-jis-conv --with-mhash --enable-mbstring --with-mcrypt   --enable-pcntl  --enable-xml --disable-rpath  --enable-shmop --enable-sockets --enable-sqlite-utf8 --enable-zip --enable-bcmath --with-snmp
# make ZEND_EXTRA_LIBS='-liconv'
# make install
# cp php.ini-production /usr/local/php/etc/php.ini
# cd /usr/local/php/etc/
# cp php-fpm.conf.default php-fpm.conf

安装NGINX-1.0.0

# tar -zxvf pcre-8.12.tar.gz
# cd pcre-8.12
# ./configure --prefix=/usr/local
# make
# make install

# tar -zxvf nginx-1.0.0.tar.gz
# cd nginx-1.0.0
# ./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --without-http_rewrite_module --with-http_ssl_module --with-pcre --with-http_realip_module
# make
# make install

继续浏览有关 LINUX技术 的文章
发表评论