Trace: haproxy_lab

HAProxy lab

Webapp

export IP='192.168.0.39'
nmcli con mod enp0s3 ipv4.method manual ipv4.addresses $IP/24 ipv4.gateway 192.168.0.1 ipv4.dns 8.8.8.8
hostnamectl set-hostname webapp3
yum install php php-fpm epel-release policycoreutils-python -y
yum install nginx -y
mkdir -p /var/www/webapp
echo '<?php' > /var/www/webapp/index.php
echo 'echo gethostname(); // may output e.g,: sandie' >> /var/www/webapp/index.php
echo '?>' >> /var/www/webapp/index.php
echo '192.168.0.30 haproxy' >> /etc/hosts
echo '192.168.0.35 webapp1' >> /etc/hosts
echo '192.168.0.37 webapp2' >> /etc/hosts
echo '192.168.0.39 webapp3' >> /etc/hosts
systemctl enable nginx
systemctl enable php-fpm
systemctl start nginx
systemctl start php-fpm
firewall-cmd --add-port=80/tcp --permanent
firewall-cmd --reload
semanage fcontext -a -t httpd_sys_content_t '/var/www(/.*)?'
restorecon -Rv /var/www
vi /etc/nginx/nginx.conf
vi /etc/php-fpm.d/www.conf
haproxy_lab.txt · Last modified: 2023/02/21 14:06
Public Domain Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain