Setting up Apache on Linux Servers: Quick Deployment of Websites
### Apache Web Server Setup Guide Apache is an open-source, free, and mainstream web server suitable for Linux, Windows, and other systems, making it the first choice for beginners in website building. The setup process is as follows: **Prerequisites**: A Linux server (e.g., Alibaba Cloud CentOS/Ubuntu), basic command-line operation skills, and root/sudo privileges. **Installation**: For CentOS, use `sudo yum install httpd -y`; for Ubuntu, use `sudo apt install apache2 -y`. **Start and Enable Auto-Start**: On CentOS, run `sudo systemctl start httpd` and `enable` it for boot auto-start; Ubuntu uses `apache2` instead. Check the running status with `systemctl status` (success if it shows `active (running)`). **Firewall Configuration**: Open port 80 (default for HTTP). For CentOS: `firewall-cmd --add-port=80/tcp --permanent` and reload. For Ubuntu: `ufw allow 80/tcp`. **Website Deployment**: The website root directory is `/var/www/html`. Create `index.html` (e.g., with content "Hello, Linux Server!"). After restarting Apache, access the server IP via a browser. **Advanced**: Virtual hosts enable multi-site hosting, requiring configuration of `/etc
Read More