LNMP环境搭建-nginx
来源:     阅读:3
易浩激活码
发布于 2025-10-21 03:06
查看主页


搭建开胃菜

本次搭建都是个人自己理解进行的操作,如在搭建过程中存在疑问,请留言

使用的软件版本

nginx-1.4.2.tar.gz

mysql-5.6.13.tar.gz

php-5.4.17.tar.gz

1 安装依赖包 (思考不在这里出发 不执行下面语句 留到后来用)

[sourcecode language="plain"]

yum -y install gcc pcre pcre-devel gcc-c++ autoconf libxml2

libxml2-devel zlib zlib-devel glibc libjepg libjepg-devel

libpng libpng-devel glibc-devel glib2 glib2-devel ncurses

ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel

openssl openssl-devel openldap openldap-devel nss_ldap

openldap-clients openldap-servers make

[/sourcecode]

2.安装nginx

自行创建一个用户和用户组分配给nginx

[sourcecode language="plain"]

groupadd -r nginx

useradd -r -g nginx -s /bin/false -M nginx

[/sourcecode]

[sourcecode language="plain"]

// 安装一个yum 源包 如果不行 先下载

rpm -ivh <span><a href="
http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm">
http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm</a>(适用 </span>geoip geoip-devel)

yum install pcre pcre-devel openssl openssl-devel libxslt-devel gd-devel geoip geoip-devel

./configure --prefix=/usr/local/nginx-1.4.2 --with-http_ssl_module --with-http_realip_module --with-http_sub_module --with-http_mp4_module --with-http_gzip_static_module --with-http_gunzip_module --with-http_stub_status_module --with-http_ssl_module --with-http_spdy_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_dav_module --with-http_flv_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module

make && make install

[/sourcecode]

顺利到达此处表明nginx已经安装完毕,下面配置nginx相关信息

配置nginx快速启动

nginx启动文件下载地址
http://7xsaxb.dl1.z0.glb.clouddn.com/nginx

把下载nginx 拷贝到/etc/init.d 目录下

[sourcecode language="plain"]

chmod +x /etc/init.d/nginx

chkconfig --add nginx

chkconfig nginx on

service nginx restart (重启有一个关闭的过程,在关闭之后 请求会失败)

平滑启动


/usr/local/nginx/sbin/nginx -s reload(reload则不会影响请求)

[/sourcecode]

如果启动正常 表明nginx 已经安装完毕

第一次写文章感觉还不是很适应,所以先写到这 后续mysql和php的安装会记录跟进,谢谢大家

原文地址:
http://www.58maisui.com/2016/03/17/lnmp/

免责声明:本文为用户发表,不代表网站立场,仅供参考,不构成引导等用途。 系统环境
相关推荐
Hive 子进程死循环问题排查
精选家庭安防好助手--叮咚mini可视门铃评测
历经 4 面,60w “跳”进字节!(附面试流程和真题)
Ubuntu 22.04 Tesla V100s显卡驱动,CUDA,cuDNN,MiniCONDA3 环境的安装
爬取一个福利站
首页
搜索
订单
购物车
我的