Aufsetzen des Apache-Servers

Aus Lawsuit - Wiki
Version vom 7. März 2018, 17:48 Uhr von Hedele (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „{{Knowledge| *[https://de.opensuse.org/Portal:Tumbleweed Tumbleweed] *[https://de.opensuse.org/Portal:42.3 Leap 42.3] *[https://de.opensuse.org/Portal:42.2 Lea…“)

(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche
Kompatibilität mit openSUSE openSUSE-Themen Weiterführende Artikel Suse.png


Einführung

Diese Dokument gibt eine rasche Einführung, wie ein Apache-Server auf dem lokalen Rechner aufgesetzt werden kann, der die Lawsuit-Programmteile bereitstellt.


Warnung!
Die Kurzanleitung geht nicht vertieft auf mögliche Experten-Einstellungen des Servers ein. Insbesondere bleiben hier Sicherheitseinstellungen unberücksichtigt, die für den Betrieb als öffentlich zugänglicher Netzserver unumgänglich wären. Die nachfolgenden Schritte sind für Anwender gedacht, die Lawsuit intern auf dem Kanzleirechner hinter einer Firewall betreiben möchten.



Allgemeine Rechner-Konfiguration

Die Software benötigt eine funktionierende Netzwerkumgebung. Einstellungen hierzu können Sie mit YaST unter der Rubrik "Netzwerkeinestellungen" vornehmen. Achten Sie insbesondere bei der Nutzung von DHCP darauf, dass weitere Rechner der Kanzlei von YaST tatsächlich im selben Nummernraum wie der Rechners eingetragen wurden, auf dem Apache nun installiert werden soll. Ansonsten können diese Rechner später nicht auf die Kanzleisoftware zugreifen.

Als Zweites sollte der PC auf dem aktuellen Softwarestand sein. Prüfen Sie diesen gegebenenfalls mit YaST in der Sektion Online update nach .

Installation der Apache-Pakete

The Apache web server can be installed by using zypper. Open a terminal and become root. Type the below command:

# zypper in apache2


Firewall Adjustments

By default the firewall configuration blocks all traffic coming on port 80 to your machine. So if you need to allow access so that the web server can be accessed from within a LAN we need to fine tune the firewall configuration. The below step needs to be performed as root user. The supplied configurations are called apache2 and apache2-ssl. They can be enabled via YaST, by adding them to FW_CONFIGURATIONS_EXT in /etc/sysconfig/SuSEfirewall2

# sysconf_addword /etc/sysconfig/SuSEfirewall2 FW_CONFIGURATIONS_EXT apache2
# sysconf_addword /etc/sysconfig/SuSEfirewall2 FW_CONFIGURATIONS_EXT apache2-ssl
# rcSuSEfirewall2 restart


Starting Server

Start the server and configure it to automatically start at boot time.

# rcapache2 start
# chkconfig -a apache2


Apache Modules

To enable required Apache Modules we can edit APACHE_MODULES in /etc/sysconfig/apache2. Modules can also be enabled/disabled/listed with the commands below. Any such operation requires a restart of the service and of course needs root privileges.

# a2enmod php5
# a2enmod -l
# rcapache2 restart


Virtual Hosts

The directory for virtual host configurations is /etc/apache2/vhosts.d/. As you can see there are two sample configuration files - one with ssl; one without ssl. We use the template without ssl. Only files ending with ".conf" are automatically included to the apache configuration.

Vorabhinweis
In the following instructions, please replace {DOMAINNAME} with an IP or an domain-name you want.


  • Plan your website infrastructure. It's helpful to use a directory (/srv/www/vhosts) including one subdirectory for each virtual host.
You have to decide which sort of virtual host you need, based on the following options:
  • Copy the sample configuration file vhost.template to {DOMAINNAME}.conf and create the subdirectory for this virtual host.
# cd /etc/apache2/vhosts.d
# cp vhost.template {DOMAINNAME}.conf
# mkdir -p /srv/www/vhosts/{DOMAINNAME}/


  • Now edit the copied configuration file and adjust the following as needed:
  • Change the document root for your virtual host: DocumentRoot /srv/www/vhosts/{DOMAINNAME}
  • You also need to change corresponding directory directive: <Directory "/srv/www/vhosts/{DOMAINNAME}">
  • <VirtualHost *:80> It is possible to replace the "*" with an IP addess and "80" with a non standard http port. See Apache Documentation.
  • Restart Apache
# /etc/init.d/apache2 restart


Custom Configuration

Add/edit configuration for all virtual hosts to /etc/apache2/default-server.conf. Edit APACHE_CONF_INCLUDE_FILES in /etc/sysconfig/apache2 to include configurations from external files. To understand the hierarchy and layout of all include files, read the comments at the top of httpd.conf The old, single, 40K, monolithic configuration file is available in /usr/share/doc/packages/apache2/httpd-std.conf-prefork.

Trouble Shooting

Read any error messages when you start the service. Reproduce what is not working and see how it is reflected in the logs. The log files can be monitored in a root shell with the following command:

# tail -F /var/log/apache2/*


If you suspect a bug, please report it

See also

Related articles

  • SuSE Firewall
  • Package documentation and example configuration files in /usr/share/doc/packages/apache2/

External links