LNMP环境搭建-nginx

搭建开胃菜

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

使用的软件版本

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 style="font-family: Consolas,Bitstream Vera Sans Mono,Courier New,Courier,monospace;"><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/

相关文章

在CentOS7系统源码安装Nginx+MySQL+PHP+Go

以下安装说明仅供参考,请根据实际情况修改配置,进行软件编译安装软件安装也可以参考阿里云/腾讯云的建站教程:https://help.aliyun.com/zh/ecs/use-cases/build-...

MySQL8安装 八: 使用phpMyadmin客户端

MySQL8安装 一 : 源码安装MySQL8安装 二 : 二进制安装MySQL8安装 三: 二进制安装配置多实例MySQL8安装 四: docker安装MySQL8安装 五: 安装包安装MySQL8...

ubuntu超级简单一键安装LNMP环境

很多刚刚接触Linux系统的朋友(大牛和高手可以忽略我这篇文章)都在为配置LNMP运行环境发愁,在网上也有很多lnmp环境搭建的教程,但是大都是源码安装或者Nginx、MySQL、PHP等单独安装并...

宝塔服务器搭建超详细教程:打造高效网站托管环境

宝塔服务器搭建超详细教程:打造高效网站托管环境在当今数字化时代,拥有一个稳定、高效的服务器对于网站运营至关重要。宝塔面板因其强大的功能和简洁的操作界面,成为众多站长和开发者的首选服务器管理工具。本文将...

私有云搭建ubuntu+php7.2+nginx+mysql+nextcloud

私有云服务器搭建,解决空间限制,适合小公司或者个人使用,nextcloud是开源的项目。搭建相对简单,下面就说说搭建步骤。一、必备技能搭建私有云服务需要一点专业知识,nextcloud是php开发的开...

Docker部署web服务器之Nginx与PHP联合篇(三)

内容回顾,前面两节,已经介绍了docker的安装,nginx的安装,还有PHP的安装。这一小节则是要介绍,怎么让这三个毫无关联的软件,给关联上。前两节内容如下:《Docker部署web服务器之Ngin...