gcc是一个开源编译器集合,用于处理各类各样的语言:C、C++、Java、Ada等,在linux世界中是最通用的编译器,支持大量处理器:x8六、AMD6四、PowerPC、ARM、MIPS等。
首先肯定系统是否安装gcchtml
[root@localhost ~]# gcc
若输出如下消息则已经安装gcc:
若输出如下消息则未安装gcc:
使用包管理器yum安装gcc:linux
[root@localhost ~]# yum -y install gcc
nginx的Rewrite模块和HTTP核心模块会使用到PCRE正则表达式语法,所以nginx编译须要使用PCRE(Perl Compatible Regular Expression)库,须要安装pcre和pcre-devel,pcre提供编译版本的库,pcre-devel提供开发阶段的头文件和编译项目的源代码。
使用yum安装:nginx
[root@localhost ~]# yum -y install pcre pcre-devel
zlib库提供了压缩算法,在nginx的各类模块中须要使用gzip压缩,所以须要安装zlib库和zlib-devel(zlib源代码)。正则表达式
[root@localhost ~]# yum -y install zlib zlib-devel
yum安装openssl和openssl-devel算法
[root@localhost ~]# yum -y install openssl openssl-devel
[root@localhost src]# wget http://nginx.org/download/nginx-1.13.12.tar.gz [root@localhost src]# tar zxvf nginx-1.13.12.tar.gz [root@localhost src]# cd nginx-1.13.12
##配置选项 linux下建立一个应用程序分为三步,配置源代码、编译、安装编译,配置步骤能够选择更多选项,这些选项在程序安装完成后不可编辑,配置即添加某些开关选项(switch)到配置(configure)脚本, 能够激活的开关类型有三种。 ###**容易的安装方法** 不加任何配置参数直接编译安装nginx ;因为咱们这里要添加nginx用于支持grpc的模块因此须要添加俩个模块(with-http_ssl_module ,with-http_v2_module)。安全
[root@localhost nginx-1.13.12]# ./configure --with-http_ssl_module --with-http_v2_module [root@localhost nginx-1.13.12]# make&&make install
[root@localhost nginx-1.13.12]#/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
默认启动后在外部访问服务器的80端口看时候能够访问,若是没办法在外部访问能够在内部执行bash
[root@localhost nginx-1.13.12]# curl 127.0.0.1
出现以下结果:服务器
至此安装完成。curl
参考博客:工具
https://blog.csdn.net/zsl10/article/details/52181748
https://www.colabug.com/2739346.html