-
-
Notifications
You must be signed in to change notification settings - Fork 2
Linux Apache Guide
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to Apache HTTP Server on Linux, covering Arch Linux, CachyOS, and other distributions including installation, configuration, and virtual hosts.
Arch/CachyOS:
# Install Apache
sudo pacman -S apache
# Enable service
sudo systemctl enable --now httpd
# Check status
systemctl status httpdDebian/Ubuntu:
sudo apt install apache2
sudo systemctl enable apache2Fedora:
sudo dnf install httpd
sudo systemctl enable httpdTest Apache:
# Check if running
curl http://localhost
# Or open browser
# http://localhostEdit config:
# Edit main config
sudo vim /etc/httpd/conf/httpd.conf
# Or Debian/Ubuntu
sudo vim /etc/apache2/apache2.confCommon settings:
ServerName localhost
DocumentRoot /srv/http
Listen 80
Apache (Arch):
# Edit virtual hosts
sudo vim /etc/httpd/conf/extra/httpd-vhosts.confAdd:
<VirtualHost *:80>
ServerName example.com
DocumentRoot /srv/http/example
</VirtualHost>
Debian/Ubuntu:
# Create site
sudo vim /etc/apache2/sites-available/example.com.conf
# Enable site
sudo a2ensite example.com
sudo systemctl reload apache2Arch/CachyOS:
# Edit config
sudo vim /etc/httpd/conf/httpd.conf
# Uncomment modules
LoadModule rewrite_module modules/mod_rewrite.soDebian/Ubuntu:
# Enable module
sudo a2enmod rewrite
sudo systemctl reload apache2Check logs:
# Check service
systemctl status httpd
# Check logs
journalctl -u httpd
# Or error log
sudo tail -f /var/log/httpd/error_logValidate config:
# Test configuration
sudo apachectl configtest
# Or
sudo httpd -tThis guide covered Apache installation, configuration, and virtual hosts for Arch Linux, CachyOS, and other distributions.
- Web Servers - Web server setup
- Networking - Network setup
- Apache: https://httpd.apache.org/
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.