## 1.1 gcc环境html
yum install gcc-c++前端
(Perl Compatible Regular Expressions)是一个Perl库,包括 perl 兼容的正则表达式库。nginx的http模块使用pcre来解析正则表达式,因此须要在linux上安装pcre库。
pcre-devel是使用pcre开发的一个二次开发库。nginx也须要此库linux
yum install -y pcre pcre-develnginx
zlib库提供了不少种压缩和解压缩的方式,nginx使用zlib对http包的内容进行gzip,因此须要在linux上安装zlib库。c++
yum install -y zlib zlib-devel正则表达式
OpenSSL 是一个强大的安全套接字层密码库,囊括主要的密码算法、经常使用的密钥和证书封装管理功能及SSL协议,并提供丰富的应用程序供测试或其它目的使用。算法
nginx不只支持http协议,还支持https(即在ssl协议上传输http),因此须要在linux安装openssl库。api
yum install -y openssl openssl-devel安全
[root@hzzchy software]# tar -zxvf nginx-1.14.0.tar.gz测试
[root@hzzchy software]# cp -r nginx-1.14.0 /data
[root@hzzchy data]# mv nginx-1.14.0 nginx
vi /etc/orifile 添加 export PATH=$PATH:/usr/local/nginx/sbin
nginx
nginx -s reload
nginx -s stop
vi /usr/local/nginx/conf/nginx.conf
server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root /data/dist; try_files $uri $uri/ /index.html; index index.html index.htm; } location /api{ proxy_pass http://192.168.0.111:8090;
[root@hzzchy nginx]# firewall-cmd --permanent --zone=public --add-service=http success [root@hzzchy nginx]# firewall-cmd --permanent --zone=public --add-service=https success [root@hzzchy nginx]# firewall-cmd --reload