linux 安装与启动nginx
linux系统为Centos 64位
一、去http://nginx.org/download/上下载相应的版本下载nginx-1.8.0.tar.gz(注:还有更高版本的)。
二、解压 tar -zxvf nginx-1.8.0.tar.gz
三、进入nginx-1.8.0/文件夹,设置一下配置信息 ./configure --prefix=/usr/local/nginx(安装后的文件存放路径)。
四、配置的时候可能会出现类似这样的信息
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
安装pcre-devel解决问题
yum -y install pcre-devel
安装完成后再执行./configure --prefix=/usr/local/nginx
执行完后还有可能会出现这样的问题:
checking for PCRE JIT support ... not found
checking for system md library ... not found
checking for system md5 library ... not found
checking for OpenSSL md5 crypto library ... not found
checking for sha1 in system md library ... not found
checking for OpenSSL sha1 crypto library ... not found
checking for zlib library ... found
解决办法:
yum -y install openssl openssl-devel
安装完成后再执行./configure --prefix=/usr/local/nginx

出现这个说明,配置成功了!!~
五、make && make install
出现类似这样的就表示安装成功了
cp conf/nginx.conf '/usr/local/nginx/conf/nginx.conf.default'
test -d '/usr/local/nginx/logs' || mkdir -p '/usr/local/nginx/logs'
test -d '/usr/local/nginx/logs' || mkdir -p '/usr/local/nginx/logs'
test -d '/usr/local/nginx/html' || cp -R html '/usr/local/nginx'
test -d '/usr/local/nginx/logs' || mkdir -p '/usr/local/nginx/logs'
make[1]: Leaving directory `/root/setup/nginx/nginx-1.8.0'
安装完后/usr/local/nginx 后出现几个文件夹conf、html、logs、sbin
启动nginx:
./usr/nginx/sbin/nginx
查看端口:
netstat -antp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 19031/nginx
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 2771/vsftpd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 906/sshd
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2263/mysqld
nginx的80端口启动了。
访问安装nginx的服务器地址,出现如下图,说明成功了。
linux 安装与启动nginx的更多相关文章
- Linux安装ElasticSearch启动报错的解决方法
Linux安装ElasticSearch后,ElasticSearch是不能用root用户启动的,以root用户启动会报错Refer to the log for complete error det ...
- linux centos-7.2-64bit 安装配置启动nginx
1.安装依赖包yum -y install openssl openssl-develyum install pcre*yum install openssl*yum install zlib yum ...
- Linux 安装及配置 Nginx + ftp 服务器
Nginx 安装及配置 一.Nginx 简介: Nginx("engine x") 是一款是由俄罗斯的程序设计师 Igor Sysoev 所开发高性能的 Web和 反向代理服务器, ...
- linux 安装jdk以及nginx详细过程
一.安装jdk 1:首先下载jdk到本地,然后通过git 上传到linux服务器上 2:进入目录usr,并创建目录java,将jdk的压缩文件移动到该目录下 cd /usr mkdir java mv ...
- linux安装jdk tomcat nginx 以及常用命令
linux: 操作系统,应用服务器上 常用命令: cd 切换命令 cd / cd ~ cd ../../ cd xx ll 展示所有的文件 ll -h 友好的展示 mkdir 创建目录 mkdir 目 ...
- linux下docker启动nginx无法访问80端口
问题: Linux安装了docker,docker启动了一个nginx容器,通过 80 端口无法正常访问 故障排查: 1.检查 nginx 容器启动的命令或者yaml文件,查看是否有跟本机端口进行绑定 ...
- mac系统下安装和启动nginx
1.在线安装 localhost:nginx-1.17.1 mhx$ sudo brew install nginx 2.查看是否安装成功 localhost:nginx-1.17.1 mhx$ ng ...
- Linux 普通用户启动nginx
众所周知,apache的80端口为系统保留端口,如果通过其他非root用户启动,会报错如下: ()Permission denied: make_sock: could not bind to add ...
- Linux 安装、启动和卸载SSH
卸载SSH: 先停掉SSH服务:sudo stop ssh 检查SSH是否停止:ssh localhost 检查SSH是否启动: ps -e|grep ssh 卸载SSH:apt-get --purg ...
随机推荐
- Python 代码规范
命名 module_name, package_name, ClassName, method_name, ExceptionName, function_name, GLOBAL_VAR_NAME, ...
- hadoop,yarn和vcpu资源配置
Hadoop YARN同时支持内存和CPU两种资源的调度(默认只支持内存,如果想进一步调度CPU,需要自己进行一些配置),本文将介绍YARN是如何对这些资源进行调度和隔离的. 在YARN中,资源管理 ...
- [SOJ] can I post the letter?
1155. Can I Post the letter Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description I am a t ...
- 利用LibreOffice与ImageMagick将网页分享至微信
现在越来越多的内容分享都是在微信上进行了.然而,若想将电脑浏览器中看到的感兴趣的网页分享至微信,则只能以纯文本的方式粘贴超级链接,而不能直接拷贝图文混排的HTML.因此,我想到不妨借助LibreOff ...
- linux 启动 关闭 防火墙
开启防火墙: systemctl start firewalld 关闭防火墙: systemctl stop firewalld
- MAMP、wordpress安装
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; text-align: center; font: 12.0px Helvetica } p.p4 { margin: ...
- .net导出不规则Excel
using Hamp.App.BLL; using Hamp.App.Model; using Hamp.App.Model.QualityManagement; using System; usin ...
- 推荐几个好的 Maven 常用仓库网址
注意,以下内容转载自:推荐几个好的 Maven 常用仓库网址 Maven 确确实实是个好东西,用来管理项目显得很方便,但是如果是通过 Maven 来远程下载 JAR 包的话,我宿舍的带宽是4兆的,4个 ...
- 利用flashBack恢复误删除(delete)的表数据
Flashback query(闪回查询)原理 Oracle根据undo信息,利用undo数据,类似一致性读取方法,可以把表置于一个删除前的时间点(或SCN),从而将数据找回. Flashback q ...
- 1.1 java学习网站
1.http://www.rupeng.com/Courses/Index/51 2.https://www.zhihu.com/question/25255189