Wordpress: Unterschied zwischen den Versionen
Aus Vosp.info
F (Diskussion | Beiträge) (→apache conf) |
F (Diskussion | Beiträge) |
||
Zeile 2: | Zeile 2: | ||
== apache conf == | == apache conf == | ||
* /etc/apache2/sites-available/wpseite.de.conf | * /etc/apache2/sites-available/wpseite.de.conf | ||
− | <source lang= | + | <source lang=xml> |
<VirtualHost *:80> | <VirtualHost *:80> | ||
ServerName wpseite.de | ServerName wpseite.de | ||
Zeile 20: | Zeile 20: | ||
ServerSignature Off | ServerSignature Off | ||
− | <Directory /var/www/ | + | <Directory /var/www/wpseite.server.tld/> |
AllowOverride All | AllowOverride All | ||
Order allow,deny | Order allow,deny | ||
allow from all | allow from all | ||
</Directory> | </Directory> | ||
+ | </VirtualHost> | ||
+ | </source> | ||
+ | |||
+ | * /etc/apache2/sites-available/wpseite.server.tld.conf | ||
+ | <source lang=xml> | ||
+ | <VirtualHost *:80> | ||
+ | ServerName wpseite.server.tld | ||
+ | ServerAdmin webmaster@localhost | ||
+ | Redirect permanent / https://wpseite.server.tld/ | ||
+ | ServerSignature Off | ||
+ | |||
+ | </VirtualHost> | ||
+ | |||
+ | <VirtualHost *:443> | ||
+ | SSLEngine On | ||
+ | ServerName wpseite.server.tld | ||
+ | ServerAdmin webmaster@localhost | ||
+ | DocumentRoot /var/www/wpseite.server.tld | ||
+ | LogLevel info | ||
+ | ErrorLog ${APACHE_LOG_DIR}/error.wpseite.server.tld.log | ||
+ | CustomLog ${APACHE_LOG_DIR}/access.wpseite.server.tld.log combined | ||
+ | <Directory /var/www/wpseite.server.tld/> | ||
+ | # Options Indexes FollowSymLinks MultiViews | ||
+ | AllowOverride all | ||
+ | # | ||
+ | AuthType Basic | ||
+ | AuthName "Authentication Required" | ||
+ | AuthUserFile "/etc/htpasswd/htpasswd" | ||
+ | Require valid-user | ||
+ | Order allow,deny | ||
+ | # | ||
+ | Allow from all | ||
+ | Options -MultiViews | ||
+ | </Directory> | ||
+ | ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ | ||
+ | <Directory "/usr/lib/cgi-bin"> | ||
+ | Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch | ||
+ | Order allow,deny | ||
+ | Require all granted | ||
+ | </Directory> | ||
+ | ServerSignature Off | ||
+ | |||
+ | SSLCertificateKeyFile /etc/ssl/private/live/privkey.pem | ||
+ | SSLCertificateFile /etc/ssl/private/live/cert.pem | ||
+ | SSLCertificateChainFile /etc/ssl/private/live/chain.pem | ||
+ | |||
+ | SetEnv nokeepalive ssl-unclean-shutdown | ||
+ | ServerSignature Off | ||
+ | |||
</VirtualHost> | </VirtualHost> | ||
</source> | </source> |
Version vom 6. März 2021, 13:17 Uhr
apache conf
- /etc/apache2/sites-available/wpseite.de.conf
<VirtualHost *:80>
ServerName wpseite.de
ServerAlias www.wpseite.de
DocumentRoot /var/www/wpseite.server.tld
ErrorLog ${APACHE_LOG_DIR}/error.wpseite.de.log
CustomLog ${APACHE_LOG_DIR}/access.wpseite.de.log combined
RewriteEngine On
# ohne www erzwingen
RewriteCond %{HTTP_HOST} ^www.wpseite\.de$ [NC]
RewriteRule ^(.*)$ http://wpseite.de/$1 [R=301,L]
# backend deaktivieren
Redirect /wp-login.php /
Redirect /wp-admin /
ServerSignature Off
<Directory /var/www/wpseite.server.tld/>
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
- /etc/apache2/sites-available/wpseite.server.tld.conf
<VirtualHost *:80>
ServerName wpseite.server.tld
ServerAdmin webmaster@localhost
Redirect permanent / https://wpseite.server.tld/
ServerSignature Off
</VirtualHost>
<VirtualHost *:443>
SSLEngine On
ServerName wpseite.server.tld
ServerAdmin webmaster@localhost
DocumentRoot /var/www/wpseite.server.tld
LogLevel info
ErrorLog ${APACHE_LOG_DIR}/error.wpseite.server.tld.log
CustomLog ${APACHE_LOG_DIR}/access.wpseite.server.tld.log combined
<Directory /var/www/wpseite.server.tld/>
# Options Indexes FollowSymLinks MultiViews
AllowOverride all
#
AuthType Basic
AuthName "Authentication Required"
AuthUserFile "/etc/htpasswd/htpasswd"
Require valid-user
Order allow,deny
#
Allow from all
Options -MultiViews
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Require all granted
</Directory>
ServerSignature Off
SSLCertificateKeyFile /etc/ssl/private/live/privkey.pem
SSLCertificateFile /etc/ssl/private/live/cert.pem
SSLCertificateChainFile /etc/ssl/private/live/chain.pem
SetEnv nokeepalive ssl-unclean-shutdown
ServerSignature Off
</VirtualHost>