LNMP编译安装

1. LNMP编译安装

1.1. 安装依赖包

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 curl curl-devel e2fsprogs e2fsprogs-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers python-devel libicu-devel chrpath nspr-devel readline-devel ncurses-devel boost boost-devel pcre-devel js-devel git tcsh js js-devel libevent libevent-devel subversion git-core tcsh tcl net-snmp net-snmp-devel net-snmp-utils cmake postgresql-devel libxslt-devel

1.2. Nginx 1.11.13

1.2.1. 下载Nginx

wget http://nginx.org/download/nginx-1.11.13.tar.gz

1.2.2. 添加www用户组

/usr/sbin/groupadd -f www
/usr/sbin/useradd -g www www

1.2.3. 建立安装目录

mkdir -p /usr/local/webserver/nginx

1.2.4. 编译安装

./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-pcre
make && make install

1.2.5. 修改Nginx配置文件

vi /usr/local/webserver/nginx/conf/fastcgi_params
fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

vi /usr/local/webserver/nginx/conf/nginx.conf
worker_processes  4;
events {
    use epoll;
    worker_connections  8192;
}
gzip  on;

1.2.6. 添加service

vi /etc/init.d/nginx
#!/bin/bash
# nginx Startup script for the Nginx HTTP Server
# it is v.0.0.2 version.
# chkconfig: - 85 15
# description: Nginx is a high-performance web and proxy server.
#              It has a lot of features, but it's not for everyone.
# processname: nginx
# pidfile: /usr/local/webserver/nginx/logs/nginx.pid
# config: /usr/local/webserver/nginx/conf/nginx.conf
nginxd=/usr/local/webserver/nginx/sbin/nginx
nginx_config=/usr/local/webserver/nginx/conf/nginx.conf
nginx_pid=/usr/local/webserver/nginx/logs/nginx.pid
RETVAL=0
prog="nginx"
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] &
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值