Apache and Nginx/shaare/kgztrA
Apache Web Server
dnf install httpdnano /etc/httpd/conf/httpd.confnano /var/www/html/index.htmlsystemctl restart httpdsystemctl stop firewalld
NGINX
→ Web proxy → MTM between client backend servers
→ Web server
dnf install nginx -ysystemctl start nginxsystemctl enable nginxlsof -i :80→ check port 80systemctl stop firewalldsystemctl disable firewalld-
nano /etc/nginx/nginx.conf- server { ... }
-
nano /etc/nginx/conf.d/myconf.conf- server { ... }
mkdir -p /var/www/mywebserver/htmlnano index.htmlnginx -t→ check is everything oksystemctl restart nginx
NGINX Reverse Proxy
On server → setup nginx as before
-
403 error →
sestatus(selinux status tool)- current mode → enforcing
- fix:
chcon -R -t httpd_sys_content_t /var/html/→ fix permission
On client
-
nano /etc/nginx/conf.d/myconf.confserver { location / { proxy_pass http://192.168.0.202; # server ip proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } }
(97)