-
Notifications
You must be signed in to change notification settings - Fork 0
Web Server Local Hosting
Set up a local environment with AlmaLinux machine as the server with multiple websites, reverse proxy, forward proxy, and load balancing, follow these steps:
1. Install Apache HTTP Server (httpd):
sudo dnf install httpd
2. Create Virtual Hosts for Multiple Websites: Create configuration files for each virtual host under /etc/httpd/conf.d/ directory.
-
/etc/httpd/conf.d/site1.conf

-
/etc/httpd/conf.d/site2.conf

3. Create directories for website files:
3.1 Make directory under /var/www/html/ directory.
sudo mkdir /var/www/site1
sudo mkdir /var/www/site2
3.2 Set permissions
sudo chown -R apache:apache /var/www/site1
sudo chown -R apache:apache /var/www/site2
3.3 Create an index.html for both site1 and site2
echo "WELcum to SITE1 bugga" > /var/www/site1/index.html
echo "WELcum to SITE2 bugga" > /var/www/site1/index.html
4. Add servers in hosts file

5.Enable and start Apache modules:
sudo systemctl enable httpd
sudo systemctl start httpd
6. Verify it using curl

1. Configure Reverse Proxy:
Create a virtual host configuration file for proxy

2. Add rp.local to /etc/hosts

3. Restart httpd and verify it using curl
sudo systemctl start httpd

1. Configure Load Balancer

<Proxy balancer://mycluster> defines a load balancer named mycluster with two backend members: site1.local and site2.local
2. Add rp.local to /etc/hosts

3. Restart httpd and verify it using curl
sudo systemctl start httpd

1. Configure forward proxy

2. Add fp.local to /etc/hosts

3. Restart httpd and verify it using curl
sudo systemctl start httpd

1. Install Apache HTTP Server (httpd):
sudo dnf install nginx
2. Create Virtual Hosts for Multiple Websites: Create configuration files for each virtual host under /etc/nginx/conf.d/ directory.
-
/etc/nginx/conf.d/site1.conf
-
/etc/httpd/conf.d/site2.conf