In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Today, the editor will share with you the relevant knowledge points about how to deploy Nginx Web services in RHEL8. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look.
Environment
Red Hat Enterprise Linux release 8.0 VMware Workstation Pro 14
Set up step [root@localhost ~] # systemctl stop httpd # stop httpd Prevent it from affecting Nginx [root@localhost ~] # yum install-y nginx [root@localhost ~] # systemctl start nginx [root@localhost ~] # iptables-F [root@localhost ~] # systemctl stop firewalld [root@localhost ~] # systemctl disable firewalld [root@localhost ~] # setenforce 0 [root@localhost ~] # ifconfigens33: flags=4163 mtu 1500 inet 192.168.10.118 netmask 255.255.255.0 broadcast 192.168.10.255 inet6 fe80::e09a:769b:83f0:8efa Prefixlen 64 scopeid 0x20 ether 00:50:56:34:0d:74 txqueuelen 1000 (Ethernet) RX packets 2908 bytes 1777392 (1.6MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1800 bytes 244006 (238.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6:: 1 prefixlen 128 scopeid 0x10 loop txqueuelen 1000 (Local Loopback) RX packets 0 bytes 0 (0.0B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0virbr0: flags=4099 mtu 1500 inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255 ether 52:54:00:9c:ef:c6 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0 .0B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Enter 192.168.10.118 in the browser to view the status of the Nginx Web server
View the file list of the nginx package
[root@localhost ~] # rpm-ql nginx/etc/logrotate.d/nginx/etc/nginx/fastcgi.conf/etc/nginx/fastcgi.conf.default/etc/nginx/fastcgi_params/etc/nginx/fastcgi_params.default/etc/nginx/koi-utf/etc/nginx/koi-win/etc/nginx/mime.types/etc/nginx/mime.types.default/etc/nginx/nginx.conf/etc/nginx/nginx.conf.default... Omit part of the content.
Customize the home page content
[root@localhost ~] # echo "HLLO RHEL8" > / usr/share/nginx/html/index.html [root@localhost ~] # systemctl restart nginx
Enter 192.168.10.118 in the browser to view
Set up file sharing service
[root@localhost ~] # mv / usr/share/nginx/html/* / var/lib/nginx/tmp/ [root@localhost ~] # touch / usr/share/nginx/html/file {1.. 10} [root@localhost ~] # ls / usr/share/nginx/html/file1 file10 file2 file3 file4 file5 file6 file7 file8 file9 [root@localhost ~] # systemctl restart nginxRHEL 8 build Nginx Web Service RHEL 8 build Nginx Web Service
An error of 403 Forbidden is encountered because the configuration file is not configured properly. The solution is as follows:
[root@localhost html] # grep-v "#" / etc/nginx/nginx.confuser nginx;worker_processes auto;error_log / var/log/nginx/error.log;pid / run/nginx.pid;include / usr/share/nginx/modules/*.conf;events {worker_connections 1024 } http {log_format main'$remote_addr-$remote_user [$time_local] "$request"'$status $body_bytes_sent "$http_referer"'"$http_user_agent"$http_x_forwarded_for"; access_log / var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on Keepalive_timeout 65; types_hash_max_size 2048; include / etc/nginx/mime.types; default_type application/octet-stream; include / etc/nginx/conf.d/*.conf; server {listen 80 default_server; listen [:]: 80 default_server; server_name localhost; root / usr/share/nginx/html Include / etc/nginx/default.d/*.conf; location / {index index.html index.htm; autoindex on; autoindex_exact_size on; autoindex_localtime on; charset utf-8;}
Make changes with reference to the above configuration
[root@localhost ~] # vim / etc/nginx/nginx.conf [root@localhost ~] # systemctl restart nginx
Enter 192.168.10.118 in the browser to view the file sharing status
Set Port Mappin
View the host IP
Test the status of the file sharing service by typing 192.168.0.7Rom 118 in the browser
The Nginx Web service installed with yum on RHEL8 has better support for Chinese.
[root@localhost ~] # touch / usr/share/nginx/html/ Hello Red Hat 8.txt [root@localhost ~] # systemctl restart nginx is all the content of this article "how to deploy Nginx Web Services in RHEL8". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.