· 9 years ago · Feb 01, 2017, 03:16 PM
1Here are my configs:
2
3NOTE: If you find some misconfigurations which are not related to my problem, leave them out.
4
5apache2.conf
6
7# This is the main Apache server configuration file. It contains the
8# configuration directives that give the server its instructions.
9# See http://httpd.apache.org/docs/2.4/ for detailed information about
10# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
11# hints.
12#
13#
14# Summary of how the Apache 2 configuration works in Debian:
15# The Apache 2 web server configuration in Debian is quite different to
16# upstream's suggested way to configure the web server. This is because Debian's
17# default Apache2 installation attempts to make adding and removing modules,
18# virtual hosts, and extra configuration directives as flexible as possible, in
19# order to make automating the changes and administering the server as easy as
20# possible.
21
22# It is split into several files forming the configuration hierarchy outlined
23# below, all located in the /etc/apache2/ directory:
24#
25# /etc/apache2/
26# |-- apache2.conf
27# |
28— ports.conf
29# |– mods-enabled
30# | |– *.load
31# | `– *.conf
32# |– conf-enabled
33# | `– *.conf
34# `– sites-enabled
35# `– *.conf
36#
37#
38# * apache2.conf is the main configuration file (this file). It puts the pieces
39# together by including all remaining configuration files when starting up the
40# web server.
41#
42# * ports.conf is always included from the main configuration file. It is
43# supposed to determine listening ports for incoming connections which can be
44# customized anytime.
45#
46# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
47# directories contain particular configuration snippets which manage modules,
48# global configuration fragments, or virtual host configurations,
49# respectively.
50#
51# They are activated by symlinking available configuration files from their
52# respective *-available/ counterparts. These should be managed by using our
53# helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
54# their respective man pages for detailed information.
55#
56# * The binary is called apache2. Due to the use of environment variables, in
57# the default configuration, apache2 needs to be started/stopped with
58# /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
59# work with the default configuration.
60
61# Global configuration
62#
63
64#
65# ServerRoot: The top of the directory tree under which the server’s
66# configuration, error, and log files are kept.
67#
68# NOTE! If you intend to place this on an NFS (or otherwise network)
69# mounted filesystem then please read the Mutex documentation (available
70# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
71# you will save yourself a lot of trouble.
72#
73# Do NOT add a slash at the end of the directory path.
74#
75#ServerRoot “/etc/apache2â€
76
77#
78# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
79#
80Mutex file:${APACHE_LOCK_DIR} default
81
82#
83# PidFile: The file in which the server should record its process
84# identification number when it starts.
85# This needs to be set in /etc/apache2/envvars
86#
87PidFile ${APACHE_PID_FILE}
88
89#
90# Timeout: The number of seconds before receives and sends time out.
91#
92Timeout 300
93
94#
95# KeepAlive: Whether or not to allow persistent connections (more than
96# one request per connection). Set to “Off†to deactivate.
97#
98KeepAlive On
99
100#
101# MaxKeepAliveRequests: The maximum number of requests to allow
102# during a persistent connection. Set to 0 to allow an unlimited amount.
103# We recommend you leave this number high, for maximum performance.
104#
105MaxKeepAliveRequests 100
106
107#
108# KeepAliveTimeout: Number of seconds to wait for the next request from the
109# same client on the same connection.
110#
111KeepAliveTimeout 5
112
113# These need to be set in /etc/apache2/envvars
114User ${APACHE_RUN_USER}
115Group ${APACHE_RUN_GROUP}
116
117#
118# HostnameLookups: Log the names of clients or just their IP addresses
119# e.g., http://www.apache.org (on) or 204.62.129.132 (off).
120# The default is off because it’d be overall better for the net if people
121# had to knowingly turn this feature on, since enabling it means that
122# each client request will result in AT LEAST one lookup request to the
123# nameserver.
124#
125HostnameLookups Off
126
127# ErrorLog: The location of the error log file.
128# If you do not specify an ErrorLog directive within a <VirtualHost>
129# container, error messages relating to that virtual host will be
130# logged here. If you *do* define an error logfile for a <VirtualHost>
131# container, that host’s errors will be logged there and not here.
132#
133ErrorLog ${APACHE_LOG_DIR}/error.log
134
135#
136# LogLevel: Control the severity of messages logged to the error_log.
137# Available values: trace8, …, trace1, debug, info, notice, warn,
138# error, crit, alert, emerg.
139# It is also possible to configure the log level for particular modules, e.g.
140# “LogLevel info ssl:warnâ€
141#
142LogLevel warn
143
144# Include module configuration:
145IncludeOptional mods-enabled/*.load
146IncludeOptional mods-enabled/*.conf
147
148# Include list of ports to listen on
149Include ports.conf
150
151# Sets the default security model of the Apache2 HTTPD server. It does
152# not allow access to the root filesystem outside of /usr/share and /var/www.
153# The former is used by web applications packaged in Debian,
154# the latter may be used for local directories served by the web server. If
155# your system is serving content from a sub-directory in /srv you must allow
156# access here, or in any related virtual host.
157<Directory />
158Options FollowSymLinks
159AllowOverride None
160Require all denied
161</Directory>
162
163<Directory /usr/share>
164AllowOverride None
165Require all granted
166</Directory>
167
168<Directory /var/www/wiki/gl>
169Options Indexes FollowSymLinks
170AllowOverride All
171Require all granted
172</Directory>
173<Directory /var/www/html>
174Options Indexes FollowSymLinks
175AllowOverride All
176Require all granted
177</Directory>
178
179#<Directory /srv/>
180# Options Indexes FollowSymLinks
181# AllowOverride None
182# Require all granted
183#</Directory>
184
185# AccessFileName: The name of the file to look for in each directory
186# for additional configuration directives. See also the AllowOverride
187# directive.
188#
189AccessFileName .htaccess
190
191#
192# The following lines prevent .htaccess and .htpasswd files from being
193# viewed by Web clients.
194#
195<FilesMatch “^\.htâ€>
196Require all denied
197</FilesMatch>
198
199#
200# The following directives define some format nicknames for use with
201# a CustomLog directive.
202#
203# These deviate from the Common Log Format definitions in that they use %O
204# (the actual bytes sent including headers) instead of %b (the size of the
205# requested file), because the latter makes it impossible to detect partial
206# requests.
207#
208# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
209# Use mod_remoteip instead.
210#
211LogFormat “%v:%p %h %l %u %t \â€%r\†%>s %O \â€%{Referer}i\†\â€%{User-Agent}i\â€â€ vhost_combined
212LogFormat “%h %l %u %t \â€%r\†%>s %O \â€%{Referer}i\†\â€%{User-Agent}i\â€â€ combined
213LogFormat “%h %l %u %t \â€%r\†%>s %O†common
214LogFormat “%{Referer}i -> %U†referer
215LogFormat “%{User-agent}i†agent
216
217# Include of directories ignores editors’ and dpkg’s backup files,
218# see README.Debian for details.
219
220# Include generic snippets of statements
221IncludeOptional conf-enabled/*.conf
222
223# Include the virtual host configurations:
224IncludeOptional sites-enabled/*.conf
225
226# vim: syntax=apache ts=4 sw=4 sts=4 sr noet`
227
228wp-config.php
229
230<?php
231/**
232 * Grundeinstellungen für WordPress
233 *
234 * Zu diesen Einstellungen gehören:
235 *
236 * * MySQL-Zugangsdaten,
237 * * Tabellenpräfix,
238 * * Sicherheitsschlüssel
239 * * und ABSPATH.
240 *
241 * Mehr Informationen zur wp-config.php gibt es auf der
242 * {@link https://codex.wordpress.org/Editing_wp-config.php wp-config.php editieren}
243 * Seite im Codex. Die Zugangsdaten für die MySQL-Datenbank
244 * bekommst du von deinem Webhoster.
245 *
246 * Diese Datei wird zur Erstellung der wp-config.php verwendet.
247 * Du musst aber dafür nicht das Installationsskript verwenden.
248 * Stattdessen kannst du auch diese Datei als wp-config.php mit
249 * deinen Zugangsdaten für die Datenbank abspeichern.
250 *
251 * @package WordPress
252 */
253
254// ** MySQL-Einstellungen ** //
255/** Diese Zugangsdaten bekommst du von deinem Webhoster. **/
256
257/**
258 * Ersetze datenbankname_hier_einfuegen
259 * mit dem Namen der Datenbank, die du verwenden möchtest.
260 */
261define('DB_NAME', 'pw');
262
263/**
264 * Ersetze benutzername_hier_einfuegen
265 * mit deinem MySQL-Datenbank-Benutzernamen.
266 */
267define('DB_USER', 'user');
268
269/**
270 * Ersetze passwort_hier_einfuegen mit deinem MySQL-Passwort.
271 */
272define('DB_PASSWORD', 'pw');
273
274/**
275 * Ersetze localhost mit der MySQL-Serveradresse.
276 */
277define('DB_HOST', 'localhost');
278
279/**
280 * Der Datenbankzeichensatz, der beim Erstellen der
281 * Datenbanktabellen verwendet werden soll
282 */
283define('DB_CHARSET', 'utf8mb4');
284
285/**
286 * Der Collate-Type sollte nicht geändert werden.
287 */
288define('DB_COLLATE', '');
289
290/**#@+
291 * Sicherheitsschlüssel
292 *
293 * Ändere jeden untenstehenden Platzhaltertext in eine beliebige,
294 * möglichst einmalig genutzte Zeichenkette.
295 * Auf der Seite {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
296 * kannst du dir alle Schlüssel generieren lassen.
297 * Du kannst die Schlüssel jederzeit wieder ändern, alle angemeldeten
298 * Benutzer müssen sich danach erneut anmelden.
299 *
300 * @since 2.6.0
301 */
302define('AUTH_KEY', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
303define('SECURE_AUTH_KEY', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
304define('LOGGED_IN_KEY', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
305define('NONCE_KEY', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
306define('AUTH_SALT', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
307define('SECURE_AUTH_SALT', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
308define('LOGGED_IN_SALT', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
309define('NONCE_SALT', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
310
311/**#@-*/
312
313/**
314 * WordPress Datenbanktabellen-Präfix
315 *
316 * Wenn du verschiedene Präfixe benutzt, kannst du innerhalb einer Datenbank
317 * verschiedene WordPress-Installationen betreiben.
318 * Bitte verwende nur Zahlen, Buchstaben und Unterstriche!
319 */
320$table_prefix = 'wp_';
321
322/**
323 * Für Entwickler: Der WordPress-Debug-Modus.
324 *
325 * Setze den Wert auf „true“, um bei der Entwicklung Warnungen und Fehler-Meldungen angezeigt zu bekommen.
326 * Plugin- und Theme-Entwicklern wird nachdrücklich empfohlen, WP_DEBUG
327 * in ihrer Entwicklungsumgebung zu verwenden.
328 *
329 * Besuche den Codex, um mehr Informationen über andere Konstanten zu finden,
330 * die zum Debuggen genutzt werden können.
331 *
332 * @link https://codex.wordpress.org/Debugging_in_WordPress
333 */
334define('WP_DEBUG', false);
335
336/* Das war’s, Schluss mit dem Bearbeiten! Viel Spaß beim Bloggen. */
337/* That's all, stop editing! Happy blogging. */
338
339/** Der absolute Pfad zum WordPress-Verzeichnis. */
340if ( !defined('ABSPATH') )
341 define('ABSPATH', dirname(__FILE__) . '/');
342
343/** Definiert WordPress-Variablen und fügt Dateien ein. */
344require_once(ABSPATH . 'wp-settings.php');
345define( 'WP_CONTENT_URL', 'https://example.com/wp-content' );
346define('WP_HOME','https://example.com');
347define('WP_SITEURL','https://example.com');
348000-default.conf
349
350#Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains;"
351
352<VirtualHost *:80>
353
354 ServerName www.example.com
355 # Redirect / https://example.com/
356 ServerAlias example.com
357 ServerAdmin webmaster@localhost
358 DocumentRoot /var/www/html
359</VirtualHost>
360
361<VirtualHost *:80>
362
363 ServerName example.com
364 ServerAlias example.com
365 # Redirect / https://example.com/
366 ServerAdmin webmaster@localhost
367 DocumentRoot /var/www/html
368</VirtualHost>
369
370<VirtualHost *:443>
371
372 ServerName www.example.com
373 ServerAdmin webmaster@localhost
374 DocumentRoot /var/www/html
375# SSLEngine on
376# SSLCertificateFile /etc/letsencrypt/live/example.com-0001/fullchain.pem
377# SSLCertificateKeyFile /etc/letsencrypt/live/example.com-0001/fullchain.pem
378</VirtualHost>
379
380<VirtualHost *:443>
381
382 ServerName example.com
383 ServerAdmin webmaster@localhost
384 DocumentRoot /var/www/html
385# SSLEngine on
386# SSLCertificateFile /etc/ssl/certs/apache.crt
387# SSLCertificateKeyFile /etc/ssl/private/apache.key
388
389</VirtualHost>
390
391<VirtualHost *:80>
392
393 ServerName wiki.example.com
394 # Redirect / https://wiki.example.com/
395 ServerAdmin webmaster@localhost
396 DocumentRoot /var/www/wiki
397</VirtualHost>
398
399<VirtualHost *:443>
400
401 ServerName wiki.example.com
402 ServerAdmin webmaster@localhost
403 DocumentRoot /var/www/wiki
404# SSLCertificateFile /etc/letsencrypt/live/wiki.example.com/fullchain.pem
405# SSLCertificateKeyFile /etc/letsencrypt/live/wiki.example.com/privkey.pem
406
407</VirtualHost>
408
409# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
410000-default-ssl.conf
411
412#Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains;"
413
414<VirtualHost *:80>
415
416 ServerName www.example.com
417# Redirect 301 / https://example.com
418 ServerAlias example.com
419 ServerAdmin webmaster@localhost
420 DocumentRoot /var/www/html
421</VirtualHost>
422
423<VirtualHost *:80>
424
425 ServerName example.com
426 ServerAlias example.com
427# Redirect 301 / https://example.com
428 ServerAdmin webmaster@localhost
429 DocumentRoot /var/www/html
430</VirtualHost>
431
432<VirtualHost *:443>
433
434 ServerName www.example.com
435 ServerAdmin webmaster@localhost
436 DocumentRoot /var/www/html
437 SSLEngine on
438 SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem
439 SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
440 SSLCertificateChainFile /etc/letsencrypt/live/example.com/fullchain.pem
441</VirtualHost>
442
443<VirtualHost *:443>
444
445 ServerName example.com
446 ServerAdmin webmaster@localhost
447 DocumentRoot /var/www/html
448# SSLEngine on
449# SSLCertificateFile /etc/ssl/certs/apache.crt
450# SSLCertificateKeyFile /etc/ssl/private/apache.key
451
452</VirtualHost>
453
454<VirtualHost *:80>
455
456 ServerName wiki.example.com
457 Redirect / https://wiki.example.com/
458 ServerAdmin webmaster@localhost
459 DocumentRoot /var/www/wiki
460</VirtualHost>
461
462<VirtualHost *:443>
463
464 ServerName wiki.example.com
465 ServerAdmin webmaster@localhost
466 DocumentRoot /var/www/wiki
467 SSLCertificateFile /etc/letsencrypt/live/wiki.example.com/cert.pem
468 SSLCertificateKeyFile /etc/letsencrypt/live/wiki.example.com/privkey.pem
469 SSLCertificateChainFile /etc/letsencrypt/live/wiki.example.com/fullchain.pem
470
471</VirtualHost>
472
473# vim: syntax=apache ts=4 sw=4 sts=4 sr noet