Debian Apache2
Zur Navigation springen
Zur Suche springen
Grundinstallation
Hier wird Apache2 und zahlreiche Erweiterungen wie PHP5 und Python instaliert.
Für dieses Unterfangen sind unter Debian zahlreiche Pakete erforderlich:
apt-get install apache2 apache2-doc apache2-mpm-prefork apt-get install apache2-utils apache2-suexec libexpat1 ssl-cert
Erweiterungen installieren
apt-get install libapache2-mod-php5 libapache2-mod-ruby libapache2-mod-python libapache2-mod-perl2 apt-get install php5 php5-common php5-curl php5-dev php5-xcache php5-xsl apt-get install php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt apt-get install php5-memcache php5-mhash php5-ming php5-pspell php5-recode apt-get install php5-snmp php5-sqlite php5-suhosin php5-tidy php5-xmlrpc
Konfiguration
Editieren der Datei/etc/apache2/mods-available/dir.conf…
vi /etc/apache2/mods-available/dir.conf
Zeile DirectoryIndex ändern:
<IfModule mod_dir.c>
#DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml
</IfModule>
SSL Konfiguration:
Damit per SSL auf den Server zugegriffen werden kann, muss folgende Konfiguration durchgeführt werden:
vi /etc/apache2/sites-enabled/000-default
Folgende Zeilen am Ende anfügen:
<VirtualHost *:443>
ServerAdmin webmaster@domain.org
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
</VirtualHost>
Module aktivieren
a2enmod ssl a2enmod rewrite a2enmod suexec a2enmod include
Apache neustarten:
/etc/init.d/apache2 restart