linux入门常用指令2.安装nginx
下载nginx包
nginx-1.10.3.tar.gz
解压
[root@localhost src]# tar -zxvf nginx-1.10.3.tar.gz
[root@localhost src]# cd nginx-1.10.3
[root@localhost nginx-1.10.3]# ./configure
checking for OS
+ Linux 3.10.0-229.el7.x86_64 x86_64
checking for C compiler ... not found
./configure: error: C compiler cc is not found
安装gcc编译环境
[root@localhost nginx-1.10.3]# yum install gcc-c++
已安装:
gcc-c++.x86_64 0:4.8.3-9.el7
作为依赖被安装:
cpp.x86_64 0:4.8.3-9.el7 gcc.x86_64 0:4.8.3-9.el7 glibc-devel.x86_64 0:2.17-78.el7
glibc-headers.x86_64 0:2.17-78.el7 kernel-headers.x86_64 0:3.10.0-229.el7 libmpc.x86_64 0:1.0.1-3.el7
libstdc++-devel.x86_64 0:4.8.3-9.el7 mpfr.x86_64 0:3.1.1-4.el7
安装依赖包
如果直接安装会包错
./configure: error: the HTTP rewrite module requires the PCRE library.
[root@localhost nginx-1.10.3]# yum install pcre pcre-devel -y
[root@localhost nginx-1.10.3]# yum install zlib zlib-devel -y
[root@localhost nginx-1.10.3]# yum install openssl openssl--devel -y
安装nginx
#配置检测 指定安装目录
[root@localhost nginx-1.10.3]# ./configure --prefix=/usr/local/nginx
Configuration summary
+ using system PCRE library
+ OpenSSL library is not used
+ using builtin md5 code
+ sha1 library is not found
+ using system zlib library
nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx modules path: "/usr/local/nginx/modules"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"
#编译
[root@localhost nginx-1.10.3]# make
#安装
[root@localhost nginx-1.10.3]# make install
启动nginx
#启动
[root@localhost /]# /usr/local/nginx/sbin/nginx
#重启
[root@localhost /]# /usr/local/nginx/sbin/nginx -s reload
#关闭
[root@localhost /]# /usr/local/nginx/sbin/nginx -s stop
#启动成功
[root@localhost nginx]# ps -axu|grep nginx
root 17003 0.0 0.0 20432 604 ? Ss 22:11 0:00 nginx: master process /usr/local/nginx/sbin/nginx
#查看防火墙状态
[root@localhost nginx]# firewall-cmd --state
#关闭防火墙服务
[root@localhost nginx]# systemctl stop firewalld
开机启动
[root@localhost nginx]# vim /lib/systemd/system/nginx.service
[Unit]
Description=nginx
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/usr/local/nginx/sbin/nginx -s quit
PrivateTmp=true
[Install]
WantedBy=multi-user.target
#设置开机启动
[root@localhost nginx]# systemctl enable nginx.service
#停止开机自启动
[root@localhost nginx]# systemctl disable nginx.service
linux入门常用指令2.安装nginx的更多相关文章
- linux入门常用指令3.安装mysql
下载安装包 MySQL-5.6.42-1.el6.x86_64.rpm-bundle_redhat [root@localhost src]# mkdir mysql [root@localhost ...
- Linux入门常用指令
linux获取硬盘和目录大小的命令 df命令 Linux下可以用df命令获取硬盘的使用情况,通过man可以获取df命令的详细情况.df命令经常用的参数为: a:显示全部的档案系统和各分割区的磁盘使用情 ...
- linux入门常用指令4.挂载数据盘
挂载硬盘 #查看当前分区情况 [root@localhost ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdb 8:16 0 5G 0 dis ...
- linux入门常用指令1.配置本地yum源
创建光盘挂载点 [root@localhost /]# mkdir /mnt/cdrom 挂载光盘 #挂载光盘 [root@localhost /]# mount /dev/cdrom /mnt/cd ...
- 在Linux和Windows系统上安装Nginx服务器的教程
在Linux和Windows系统上安装Nginx服务器的教程 1.在CentOS系统上安装Nginx 在 CentOS6 版本的 EPEL 源中,已经加入了 nginx 的 rpm 包,不过此 RP ...
- (转)Linux最常用指令及快捷键 Linux学习笔记
Linux最常用指令及快捷键 Linux学习笔记 原文:http://blog.csdn.net/yanghongche/article/details/50827478 [摘自 鸟叔的私房菜]--转 ...
- Linux文件常用指令
目录 Linux文件常用指令 1.pwd 显示当前目录 2.cd 切换目录 3.mkdir 创建目录 4.touch 修改或创建文件 5.ls 显示目录下的内容 6.cat 查看文件信息 7.echo ...
- Linux入门50指令
1, mkdir创建目录 make directory 可以带着路径,在什么位置创建什么目录 如:mkdir /etc/date 在目录etc下创建date目录 重要参数 –p 递归创建,mkdir ...
- linux软件管理之------编译安装nginx服务器并手动编写自动化运行脚本
红帽系列的 linux软件管理分为三类:1. rpm 安装软件.2. yum 安装软件.3. 源码包编译安装.前面两种会在相关专题给出详细讲解.源码包的编译安装是非常关键的,我们知道linux的相关版 ...
随机推荐
- Spring Boot连接MySQL报错“Internal Server Error”的解决办法
报错信息如下: {timestamp: "2018-06-14T03:48:23.436+0000", status: 500, error: "Internal Ser ...
- eclipse运行mapreduce的wordcount
1,eclipse安装hadoop插件 插件下载地址:链接: https://pan.baidu.com/s/1U4_6kLFNiKeLsGfO7ahXew 提取码: as9e 下载hadoop-ec ...
- 【计算机】DMA原理1
DMA原理:DMA(Direct Memory Access,直接内存存取) 是所有现代电脑的重要特色,它允许不同速度的硬件装置来沟通,而不需要依于 CPU 的大量中断负载.否则,CPU 需要从来源把 ...
- 最新 斗鱼java校招面经 (含整理过的面试题大全)
从6月到10月,经过4个月努力和坚持,自己有幸拿到了网易雷火.京东.去哪儿.斗鱼等10家互联网公司的校招Offer,因为某些自身原因最终选择了斗鱼.6.7月主要是做系统复习.项目复盘.LeetCode ...
- bootstrap基础学习【菜单、按钮、导航】(四)
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- Jquery中数组转字符串,c:foreach自动将带","字符串进行拆分赋值
1.数组转字符串,逗号分割 a.push()将元素依次添加至数组: b.join()将数组转换成字符串,里面可以带参数分隔符,默认[,] <script type = text/javascri ...
- JDBCtemplete 模板
package com.augmentum.oes.common; import java.sql.Connection; import java.sql.PreparedStatement; imp ...
- Java面试--类加载顺序
类什么时候就行初始化: 1)创建类的实例,也就是new一个对象 2)访问某个类或接口的静态变量,或者对该静态变量赋值 3)调用类的静态方法 4)反射(Class.forName(“com.fan ...
- DP_Sumsets
Farmer John commanded his cows to search for different sets of numbers that sum to a given number. T ...
- Python 【for/while循环】
循环语句for...in..循环语句 1.空房间 #元素(item) 可以当成是一个变量 for i in [1,2,3,4,5]: #变量i是“空房间” print(i) #有一群数字在排队办业务, ...