欢迎访问 生活随笔!

凯发k8官方网

当前位置: 凯发k8官方网 > 运维知识 > nginx >内容正文

nginx

centos8中一键安装nginx -凯发k8官方网

发布时间:2024/9/30 nginx 16 豆豆
凯发k8官方网 收集整理的这篇文章主要介绍了 centos8中一键安装nginx 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

1:检查是否安装

[root@aa ~]# nginx -v -bash: nginx: command not found

2:一键安装yum install -y nginx

[root@aa ~]# yum install -y nginx last metadata expiration check: 0:43:45 ago on sun 29 aug 2021 09:40:34 am cst. dependencies resolved. ===============================================================================================================================================================================================================package architecture version repository size =============================================================================================================================================================================================================== installing:nginx x86_64 1:1.14.1-9.module_el8.0.0 184 e34fea82 appstream 570 k installing dependencies:gd x86_64 2.2.5-7.el8 appstream 144 kjbigkit-libs x86_64 2.1-14.el8 appstream 55 klibxpm x86_64 3.5.12-8.el8 appstream 58 klibjpeg-turbo x86_64 1.5.3-10.el8 appstream 156 klibtiff x86_64 4.0.9-18.el8 appstream 188 klibwebp x86_64 1.0.0-3.el8_4 appstream 272 klibxslt x86_64 1.1.32-6.el8 baseos 250 knginx-all-modules noarch 1:1.14.1-9.module_el8.0.0 184 e34fea82 appstream 23 knginx-filesystem noarch 1:1.14.1-9.module_el8.0.0 184 e34fea82 appstream 24 knginx-mod-http-image-filter x86_64 1:1.14.1-9.module_el8.0.0 184 e34fea82 appstream 35 knginx-mod-http-perl x86_64 1:1.14.1-9.module_el8.0.0 184 e34fea82 appstream 45 knginx-mod-http-xslt-filter x86_64 1:1.14.1-9.module_el8.0.0 184 e34fea82 appstream 33 knginx-mod-mail x86_64 1:1.14.1-9.module_el8.0.0 184 e34fea82 appstream 64 knginx-mod-stream x86_64 1:1.14.1-9.module_el8.0.0 184 e34fea82 appstream 85 k enabling module streams:nginx 1.14 transaction summary =============================================================================================================================================================================================================== install 15 packagestotal download size: 2.0 m installed size: 5.2 m downloading packages: (1/15): libxpm-3.5.12-8.el8.x86_64.rpm 4.8 mb/s | 58 kb 00:00 (2/15): jbigkit-libs-2.1-14.el8.x86_64.rpm 4.2 mb/s | 55 kb 00:00 (3/15): gd-2.2.5-7.el8.x86_64.rpm 7.2 mb/s | 144 kb 00:00 (4/15): libjpeg-turbo-1.5.3-10.el8.x86_64.rpm 8.9 mb/s | 156 kb 00:00 (5/15): libtiff-4.0.9-18.el8.x86_64.rpm 8.5 mb/s | 188 kb 00:00 (6/15): libwebp-1.0.0-3.el8_4.x86_64.rpm 12 mb/s | 272 kb 00:00 (7/15): nginx-all-modules-1.14.1-9.module_el8.0.0 184 e34fea82.noarch.rpm 370 kb/s | 23 kb 00:00 (8/15): nginx-filesystem-1.14.1-9.module_el8.0.0 184 e34fea82.noarch.rpm 312 kb/s | 24 kb 00:00 (9/15): nginx-1.14.1-9.module_el8.0.0 184 e34fea82.x86_64.rpm 5.5 mb/s | 570 kb 00:00 (10/15): nginx-mod-http-image-filter-1.14.1-9.module_el8.0.0 184 e34fea82.x86_64.rpm 491 kb/s | 35 kb 00:00 (11/15): nginx-mod-http-perl-1.14.1-9.module_el8.0.0 184 e34fea82.x86_64.rpm 633 kb/s | 45 kb 00:00 (12/15): nginx-mod-http-xslt-filter-1.14.1-9.module_el8.0.0 184 e34fea82.x86_64.rpm 480 kb/s | 33 kb 00:00 (13/15): libxslt-1.1.32-6.el8.x86_64.rpm 17 mb/s | 250 kb 00:00 (14/15): nginx-mod-mail-1.14.1-9.module_el8.0.0 184 e34fea82.x86_64.rpm 818 kb/s | 64 kb 00:00 (15/15): nginx-mod-stream-1.14.1-9.module_el8.0.0 184 e34fea82.x86_64.rpm 1.1 mb/s | 85 kb 00:00 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- total 7.2 mb/s | 2.0 mb 00:00 running transaction check transaction check succeeded. running transaction test transaction test succeeded. running transactionpreparing : 1/1 installing : libjpeg-turbo-1.5.3-10.el8.x86_64 1/15 installing : libxslt-1.1.32-6.el8.x86_64 2/15 running scriptlet: nginx-filesystem-1:1.14.1-9.module_el8.0.0 184 e34fea82.noarch 3/15 installing : nginx-filesystem-1:1.14.1-9.module_el8.0.0 184 e34fea82.noarch 3/15 installing : libwebp-1.0.0-3.el8_4.x86_64 4/15 installing : libxpm-3.5.12-8.el8.x86_64 5/15 installing : jbigkit-libs-2.1-14.el8.x86_64 6/15 running scriptlet: jbigkit-libs-2.1-14.el8.x86_64 6/15 installing : libtiff-4.0.9-18.el8.x86_64 7/15 installing : gd-2.2.5-7.el8.x86_64 8/15 running scriptlet: gd-2.2.5-7.el8.x86_64 8/15 installing : nginx-mod-http-perl-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 9/15 running scriptlet: nginx-mod-http-perl-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 9/15 installing : nginx-mod-http-xslt-filter-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 10/15 running scriptlet: nginx-mod-http-xslt-filter-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 10/15 installing : nginx-mod-mail-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 11/15 running scriptlet: nginx-mod-mail-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 11/15 installing : nginx-mod-stream-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 12/15 running scriptlet: nginx-mod-stream-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 12/15 installing : nginx-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 13/15 running scriptlet: nginx-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 13/15 installing : nginx-mod-http-image-filter-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 14/15 running scriptlet: nginx-mod-http-image-filter-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 14/15 installing : nginx-all-modules-1:1.14.1-9.module_el8.0.0 184 e34fea82.noarch 15/15 running scriptlet: nginx-all-modules-1:1.14.1-9.module_el8.0.0 184 e34fea82.noarch 15/15 verifying : gd-2.2.5-7.el8.x86_64 1/15 verifying : jbigkit-libs-2.1-14.el8.x86_64 2/15 verifying : libxpm-3.5.12-8.el8.x86_64 3/15 verifying : libjpeg-turbo-1.5.3-10.el8.x86_64 4/15 verifying : libtiff-4.0.9-18.el8.x86_64 5/15 verifying : libwebp-1.0.0-3.el8_4.x86_64 6/15 verifying : nginx-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 7/15 verifying : nginx-all-modules-1:1.14.1-9.module_el8.0.0 184 e34fea82.noarch 8/15 verifying : nginx-filesystem-1:1.14.1-9.module_el8.0.0 184 e34fea82.noarch 9/15 verifying : nginx-mod-http-image-filter-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 10/15 verifying : nginx-mod-http-perl-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 11/15 verifying : nginx-mod-http-xslt-filter-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 12/15 verifying : nginx-mod-mail-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 13/15 verifying : nginx-mod-stream-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 14/15 verifying : libxslt-1.1.32-6.el8.x86_64 15/15 installed:gd-2.2.5-7.el8.x86_64 jbigkit-libs-2.1-14.el8.x86_64 libxpm-3.5.12-8.el8.x86_64 libjpeg-turbo-1.5.3-10.el8.x86_64 libtiff-4.0.9-18.el8.x86_64 libwebp-1.0.0-3.el8_4.x86_64 libxslt-1.1.32-6.el8.x86_64 nginx-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 nginx-all-modules-1:1.14.1-9.module_el8.0.0 184 e34fea82.noarch nginx-filesystem-1:1.14.1-9.module_el8.0.0 184 e34fea82.noarch nginx-mod-http-image-filter-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 nginx-mod-http-perl-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 nginx-mod-http-xslt-filter-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 nginx-mod-mail-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 nginx-mod-stream-1:1.14.1-9.module_el8.0.0 184 e34fea82.x86_64 complete! [root@aa ~]# nginx -v nginx version: nginx/1.14.1

3:查看安装的编译模块

[root@aa ~]# nginx -v nginx version: nginx/1.14.1 built by gcc 8.2.1 20180905 (red hat 8.2.1-3) (gcc) built with openssl 1.1.1 fips 11 sep 2018 (running with openssl 1.1.1c fips 28 may 2019) tls sni support enabled configure arguments: --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-http_auth_request_module --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-debug --with-cc-opt='-o2 -g -pipe -wall -werror=format-security -wp,-d_fortify_source=2 -wp,-d_glibcxx_assertions -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --with-ld-opt='-wl,-z,relro -wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -wl,-e'

4:启动nginx

[root@aa ~]# systemctl start nginx.service [root@aa ~]# netstat -lntp active internet connections (only servers) 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 45194/nginx: master tcp6 0 0 :::80 :::* listen 45194/nginx: master

5:开机自动运行

[root@aa ~]# systemctl enable nginx.service created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /usr/lib/systemd/system/nginx.service.

总结

以上是凯发k8官方网为你收集整理的centos8中一键安装nginx的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得凯发k8官方网网站内容还不错,欢迎将凯发k8官方网推荐给好友。

网站地图