Skip to main content

Apache httpd Installation Guide

This guide provides all the key information and getting-started instructions after a successful Apache HTTP Server (httpd) installation via DeploySage-CLI.

Service Management

Manage the Apache httpd service using standard systemctl commands.

# Start the service
sudo systemctl start httpd

# Stop the service
sudo systemctl stop httpd

# Restart the service
sudo systemctl restart httpd

# Reload configuration without dropping connections
sudo systemctl reload httpd

# Check the service status
sudo systemctl status httpd

# Enable the service to start on boot
sudo systemctl enable httpd

Key Directories and Files

Understanding the file structure is essential for configuration.

ItemValue
Main Configuration File/etc/httpd/conf/httpd.conf
Additional Configs/etc/httpd/conf.d/
Default Web Root/var/www/html/
Log Directory/var/log/httpd/

Diagnostics and Testing

Quick Start Example

Accessing Your Server

Use these commands to diagnose issues and test your configuration.

Create a simple "Hello World" page to verify your web server is running.

You can access your web server at http://YOUR_SERVER_IP. If you are unable to connect, ensure that your firewall is configured to allow traffic on port 80 (HTTP) and/or port 443 (HTTPS).

# Test the configuration syntax
httpd -t

# View loaded modules
httpd -M

# Check access logs in real-time
tail -f /var/log/httpd/access_log

# Check error logs in real-time
tail -f /var/log/httpd/error_log
# Create a sample index.html file
echo '<h1>Hello, Apache!</h1>' | sudo tee /var/www/html/index.html

# Restart the service to be sure
sudo systemctl restart httpd

# Test it locally
curl http://localhost