A working Apache setup on openSUSE or SUSE Linux Enterprise Server (SLES) provides a stable HTTP foundation for intranet sites, reverse proxies, and application front-ends. Installing it cleanly prevents common problems such as failed service starts, permission mistakes in the web root, or a server that stops responding after a reboot.
On SUSE systems, the apache2 package installs the web server and its systemd unit (apache2.service), with configuration stored under /etc/apache2/ and default site content served from /srv/www/htdocs. Configuration changes are validated with apachectl before restarting the daemon, and the service lifecycle is managed through systemctl.
Inbound traffic is typically filtered by the host firewall, so port 80 (HTTP) and port 443 (HTTPS) may need to be opened with firewalld for remote access. A missing global ServerName often triggers the AH00558 warning during syntax checks, and a single typo in /etc/apache2/ can prevent apache2 from starting at all. For internet-facing hosts, plan HTTPS certificates and virtual hosts before exposing the server publicly.
Steps to install and configure Apache on openSUSE or SLES:
- Open a terminal.
- Refresh the zypper repositories.
$ sudo zypper refresh Retrieving repository 'Main Repository' metadata ...................................[done] Building repository 'Main Repository' cache ........................................[done] ##### snipped ##### All repositories have been refreshed.
- Install the apache2 package using zypper.
$ sudo zypper install --no-confirm apache2 Loading repository data... Reading installed packages... Resolving package dependencies... The following 8 NEW packages are going to be installed: apache2 apache2-prefork apache2-utils libapr1 libapr-util1 libgc1 system-user-wwwrun w3m 8 new packages to install. Overall download size: 2.8 MiB. After the operation, additional 14.3 MiB will be used. ##### snipped #####
- Enable apache2 to start automatically on boot.
$ sudo systemctl enable apache2 Created symlink /etc/systemd/system/httpd.service → /usr/lib/systemd/system/apache2.service. Created symlink /etc/systemd/system/apache.service → /usr/lib/systemd/system/apache2.service. Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service → /usr/lib/systemd/system/apache2.service.
- Edit /etc/apache2/httpd.conf to apply required Apache settings.
$ sudo vi /etc/apache2/httpd.conf
A global ServerName suppresses the common AH00558 warning during syntax checks, for example: ServerName www.example.com.
- Test the Apache configuration for syntax errors.
$ sudo apachectl configtest AH00557: httpd-prefork: apr_sockaddr_info_get() failed for host AH00558: httpd-prefork: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message Syntax OK
Syntax OK means the configuration parsed successfully, even if the ServerName warning is shown.
- Restart the apache2 service to load the new configuration.
$ sudo systemctl restart apache2
If the restart fails, the web server may be down until the configuration is corrected.
- Confirm apache2 is active in systemd.
$ sudo systemctl status apache2 ● apache2.service - The Apache Webserver Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; vendor preset: disabled) Active: active (running) since Sat 2025-12-13 10:15:01 UTC; 6s ago ##### snipped #####Startup errors are commonly visible in journalctl -u apache2 and /var/log/apache2/error_log.
- Create or update a simple DirectoryIndex file in the default DocumentRoot.
$ sudo tee /srv/www/htdocs/index.html >/dev/null <<'EOF' <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Welcome to Apache on SUSE</title> </head> <body> <h1>It works.</h1> </body> </html> EOF
The default DocumentRoot on SUSE is typically /srv/www/htdocs.
- Verify the server responds on localhost.
$ curl -i http://127.0.0.1/ HTTP/1.1 200 OK Date: Sat, 13 Dec 2025 10:16:12 GMT Server: Apache Content-Type: text/html; charset=UTF-8 <!DOCTYPE html> <html lang="en"> <head> ##### snipped #####
If the response is 403 Forbidden, check DirectoryIndex settings and file permissions under /srv/www/htdocs.
- Allow inbound HTTP and HTTPS in firewalld when external access is required.
$ sudo firewall-cmd --permanent --add-service=http --add-service=https success
Opening http and https exposes the server to the network, including any default or test content.
- Reload firewalld to apply the rule changes.
$ sudo firewall-cmd --reload success
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
Comment anonymously. Login not required.
