今日学习记录:LNMP源码安装
安装编译工具及库文件
yum install -y apr autoconf automake bison bzip2 bzip2 compat cpp curl curl-devel fontconfig fontconfig-devel freetype freetype freetype-devel gcc gcc-c++ gd gettext gettext-devel glibc kernel kernel-headers keyutils keyutils-libs-devel krb5-devel libcom_err-devel libpng libpng-devel libjpeg libsepol-devel libselinux-devel libstdc++-devel libtool libgomp libxml2 libxml2-devel libXpm libtiff libtiff make mpfr ncurses ntp openssl openssl-devel patch pcre-devel perl php-common php-gd policycoreutils telnet t1lib t1lib nasm nasm* wget zlib-devel
1.1安装cmake编译工具
cd /usr/local/src
ls
tar xzvf cmake-2.8.11.2.tar.gz
cd cmake-2.8.11.2/
./configure
make
make install
3 安装PCRE
cd /usr/local/src
mkdir /usr/local/pcre
tar xzvf pcre-8.35.tar.gz
cd pcre-8.35
./configure --prefix=/usr/local/pcre
make
make install
3.1安装openssl服务程序
cd /usr/local/src
mkdir /usr/local/openssl
tar xzvf openssl-1.0.1h.tar.gz
cd openssl-1.0.1h
./config --prefix=/usr/local/openssl
make
make install
3.2把openssl服务程序命令目录添加到环境变量中(永久生效):
vim /etc/profile
//将配置文件最下面的参数追加参数为:
export PATH=$PATH:/usr/local/mysql/bin:/usr/local/openssl/bin
source /etc/profile
3.3安装zlib数据压缩函数库
cd /usr/local/src
mkdir /usr/local/zlib
tar xzvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure --prefix=/usr/local/zlib
make
make install
3.4创建用于执行nginx服务的用户:
tar xzvf nginx-1.6.0.tar.gz
cd nginx-1.6.0/
./configure --prefix=/usr/local/nginx --without-http_memcached_module --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-openssl=/usr/local/src/openssl-1.0.1h --with-zlib=/usr/local/src/zlib-1.2.8 --with-pcre=/usr/local/src/pcre-8.35
make
make install
3.5创建nginx程序脚本
vim /etc/rc.d/init.d/nginx
chmod 755 /etc/rc.d/init.d/nginx
3.6重启nginx服务程序并添加到开机启动项:
/etc/rc.d/init.d/nginx restart
Restarting nginx (via systemctl): [ OK ]
chkconfig nginx on
转载于:https://blog.51cto.com/13956297/2176324