SUSE Linux Enterprise Server
or SLES
is the recommended version of SUSE
for server deployment though the installation and related documentations are not as polished as other Linux
distributions.
Apache
web server can be installed on both openSUSE
and SLES
using zypper
from the command line and requires some further configuration before being usable.
zypper
package list. > sudo zypper refresh [sudo] password for root: Repository 'Main Repository (NON-OSS)' is up to date. Repository 'Main Repository (OSS)' is up to date. Repository 'Main Update Repository' is up to date. Repository 'openSUSE-20191225-0' is up to date. All repositories have been refreshed.
apache2
package using zypper
. > sudo zypper install --no-confirm apache2 Loading repository data... Reading installed packages... Resolving package dependencies... The following 6 NEW packages are going to be installed: apache2 apache2-prefork apache2-utils libgc1 system-user-wwwrun w3m The following recommended package was automatically selected: w3m 6 new packages to install. Overall download size: 2.5 MiB. Already cached: 0 B. After the operation, additional 7.7 MiB will be used. Continue? [y/n/v/...? shows all options] (y): y
Apache
options as necessary.> sudo vi /etc/apache2/httpd.conf
Apache
options for errors. > sudo apachectl configtest AH00558: httpd-prefork: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message Syntax OK
apache2
service once you're done with yur configuration. > sudo systemctl restart apache2
apache2
service to automatically start during system 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.
http
) and 443 (https
) if firewall is enabled. > sudo firewall-cmd --permanent --add-service=http --add-service=https success
> sudo firewall-cmd --reload success
DirectoryIndex
file to DocumentRoot
folder. > sudo vi /srv/www/htdocs/index.html
DocumentRoot
folder has correct ownership. > sudo chown --recursive wwwrun:wwwrun /srv/www/
Apache
web server is up and running. > curl 127.0.0.1 <h1>Your Apache service is up and running</h1> Congratulation.
Comment anonymously. Login not required.