LNMP环境搭建-nginx

  • 时间:2025-10-21 03:06 作者: 来源: 阅读:4
  • 扫一扫,手机访问
摘要:搭建开胃菜本次搭建都是个人自己理解进行的操作,如在搭建过程中存在疑问,请留言使用的软件版本nginx-1.4.2.tar.gzmysql-5.6.13.tar.gzphp-5.4.17.tar.gz1 安装依赖包 (思考不在这里出发 不执行下面语句 留到后来用)[sourcecode language=”plain”]yum -y install gcc p


搭建开胃菜

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

使用的软件版本

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/

  • 全部评论(0)
最新发布的资讯信息
【系统环境|】Spring Boot3 中实现按模板导出 Word 文档合同的技术指南(2025-10-30 16:04)
【系统环境|】openPangu-Ultra-MoE-718B-V1.1今日正式开源,部署指南来啦!(2025-10-30 16:03)
【系统环境|】Ubuntu + vLLM + DeepSeek 本地部署完全指南(2025-10-30 16:03)
【系统环境|】如何用公众号AI编辑器实现一键排版?一份完整的5步指南(2025-10-30 16:02)
【系统环境|】Spring Boot 与 Nacos 完美整合指南(2025-10-30 16:01)
【系统环境|】Rust MCP开发指南:让AI与应用对话的桥梁(2025-10-30 16:00)
【系统环境|】MCP Server 开发实战指南(2025-10-30 15:59)
【系统环境|】入门指南:使用 Playwright MCP Server 为你的 AI Agent 赋予能力(2025-10-30 15:58)
【系统环境|】一个IT女搬砖工的情人节爱心礼物指南及衍伸 v16.02.14(2025-10-30 15:57)
【系统环境|】百元矿渣显卡淘金全指南(2025-10-30 15:57)
手机二维码手机访问领取大礼包
返回顶部