29.06.2021, 10:55
Die Splash mit Wordpress zu machen, mag nicht jedem auf Grund von php und Hackerangriffen gefallen. Ein Server wird nicht sicher, nur weil man auf Wordpress verzichtet.
Wegen der Hacking-Attacken halte ich allerdings ein Auslagern der Splash auf eine andere Maschine mit Wordpress für richtig.
Diesen 80er Port von Apache lasse ich auf 80 - Egal in meinem LAN.
Apache Default Page: It works im Viewer:
[attachment=42]
Wordpress benötigt:
sudo apt install php-soap php-intl php-zip php-curl php-gd php-mbstring php-xmlrpc php-xml
Notwendiger Eintrag in die Apache default.conf:
root@sliplady:/etc/apache2/sites-available# nano 000-default.conf
<Directory /var/www/html/>
AllowOverride All
</Directory>
Die 000-default.conf abspeichern und verlassen.
Rewrite-Modul aktivieren:
sudo a2enmod rewrite
In das tmp Verzeichnis wechseln und Wordpress laden:
cd /tmp
curl -O https://wordpress.org/latest.tar.gz
Auspacken:
tar xzvf latest.tar.gz
touch /tmp/wordpress/.htaccess
mkdir /tmp/wordpress/wp-content/upgrade
sudo cp -a /tmp/wordpress/. /var/www/html
Eigentum festlegen:
sudo chown -R www-data:www-data /var/www/html
Berechtigungen festlegen:
sudo find /var/www/html/ -type d -exec chmod 750 {} \;
sudo find /var/www/html/ -type f -exec chmod 640 {} \;
WordPress Secret Key Generator aufrufen und Werte in die wp-congfig schreiben:
curl -s https://api.wordpress.org/secret-key/1.1/salt/
root@sliplady:/home/lordsniefnase# cd /var/www/html
root@sliplady:/var/www/html# ls
index.html - readme.html - wp-blog-header.php - wp-config.phpcd - wp-includes - wp-login.php - wp-signup.php
index.php - wp-activate.php - wp-comments-post.php - wp-content - wp-links-opml.php - wp-mail.php - wp-trackback.php
license.txt - wp-admin - wp-config-sample.php - wp-cron.- php wp-load.php - wp-settings.php - xmlrpc.php
root@sliplady:/var/www/html#
index.html löschen:
root@sliplady:/var/www/html# rm index.html
Umbenennen wp-config-sample.zu php wp-config.php:
root@sliplady:/var/www/html# mv wp-config-sample.php wp-config.php
root@sliplady:/var/www/html# nano wp-config.php
Schlüssel kopieren und in die wp-config speichern.
[attachment=40]
Werte abspeichern, Editor verlassen und das Setup von Wordpress über Server IP ausführen.
Nun wird Wordpress im Firestorm Viewer auch angezeigt. Version for Open Simulator: 6.4.13 (63251)
Notwendige Konfigurationen folgen:
REST API, UFW, Apache, php.ini, ServerSignature Off, TraceEnable off, ServerSignature Off, ServerTokens Prod, Options -Indexes
[attachment=41]
Verzeichnisauflistung ist aber noch aktiv:
[attachment=43]
Verzeichnisauflistung deaktivieren:
root@sliplady:/etc/apache2# nano apache2.conf
[attachment=44]
<Directory /var/www/html>
AllowOverride All
Options -Indexes
ServerSignature off
Require all granted
</Directory>
[attachment=45]
Auslesen von sensiblen Daten und Einschleusen verhindern.
WordPress REST API noch abschalten!
Sprachlos - Keine Worte mehr:
http://192.168.178.21/wp-json
[attachment=47]
In die functions.php-File vom Theme:
add_filter( 'rest_authentication_errors', function( $result ) {
if ( ! empty( $result ) ) {
return $result;
}
if ( ! is_user_logged_in() ) {
return new WP_Error( 'restx_logged_out', 'Funktion nicht erlaubt.', array( 'status' => 401 ) );
}
return $result;
});
root@sliplady:/var/www/html/wp-content/themes/hello-hv# nano functions.php
[attachment=48]
Clean:
[attachment=49]
Apache starten:
sudo /etc/init.d/apache2 start
Apache stoppen:
sudo /etc/init.d/apache2 stop
Apache neu starten:
sudo /etc/init.d/apache2 restart
Status abfragen:
sudo systemctl status apache2
Module anzeigen lassen:
apachectl -t -D DUMP_MODULES
Wegen der Hacking-Attacken halte ich allerdings ein Auslagern der Splash auf eine andere Maschine mit Wordpress für richtig.
Diesen 80er Port von Apache lasse ich auf 80 - Egal in meinem LAN.
Apache Default Page: It works im Viewer:
[attachment=42]
Wordpress benötigt:
sudo apt install php-soap php-intl php-zip php-curl php-gd php-mbstring php-xmlrpc php-xml
Notwendiger Eintrag in die Apache default.conf:
root@sliplady:/etc/apache2/sites-available# nano 000-default.conf
<Directory /var/www/html/>
AllowOverride All
</Directory>
Die 000-default.conf abspeichern und verlassen.
Rewrite-Modul aktivieren:
sudo a2enmod rewrite
In das tmp Verzeichnis wechseln und Wordpress laden:
cd /tmp
curl -O https://wordpress.org/latest.tar.gz
Auspacken:
tar xzvf latest.tar.gz
touch /tmp/wordpress/.htaccess
mkdir /tmp/wordpress/wp-content/upgrade
sudo cp -a /tmp/wordpress/. /var/www/html
Eigentum festlegen:
sudo chown -R www-data:www-data /var/www/html
Berechtigungen festlegen:
sudo find /var/www/html/ -type d -exec chmod 750 {} \;
sudo find /var/www/html/ -type f -exec chmod 640 {} \;
WordPress Secret Key Generator aufrufen und Werte in die wp-congfig schreiben:
curl -s https://api.wordpress.org/secret-key/1.1/salt/
root@sliplady:/home/lordsniefnase# cd /var/www/html
root@sliplady:/var/www/html# ls
index.html - readme.html - wp-blog-header.php - wp-config.phpcd - wp-includes - wp-login.php - wp-signup.php
index.php - wp-activate.php - wp-comments-post.php - wp-content - wp-links-opml.php - wp-mail.php - wp-trackback.php
license.txt - wp-admin - wp-config-sample.php - wp-cron.- php wp-load.php - wp-settings.php - xmlrpc.php
root@sliplady:/var/www/html#
index.html löschen:
root@sliplady:/var/www/html# rm index.html
Umbenennen wp-config-sample.zu php wp-config.php:
root@sliplady:/var/www/html# mv wp-config-sample.php wp-config.php
root@sliplady:/var/www/html# nano wp-config.php
Schlüssel kopieren und in die wp-config speichern.
[attachment=40]
Werte abspeichern, Editor verlassen und das Setup von Wordpress über Server IP ausführen.
Nun wird Wordpress im Firestorm Viewer auch angezeigt. Version for Open Simulator: 6.4.13 (63251)
Notwendige Konfigurationen folgen:
REST API, UFW, Apache, php.ini, ServerSignature Off, TraceEnable off, ServerSignature Off, ServerTokens Prod, Options -Indexes
[attachment=41]
Verzeichnisauflistung ist aber noch aktiv:
[attachment=43]
Verzeichnisauflistung deaktivieren:
root@sliplady:/etc/apache2# nano apache2.conf
[attachment=44]
<Directory /var/www/html>
AllowOverride All
Options -Indexes
ServerSignature off
Require all granted
</Directory>
[attachment=45]
Auslesen von sensiblen Daten und Einschleusen verhindern.
WordPress REST API noch abschalten!
Sprachlos - Keine Worte mehr:
http://192.168.178.21/wp-json
[attachment=47]
In die functions.php-File vom Theme:
add_filter( 'rest_authentication_errors', function( $result ) {
if ( ! empty( $result ) ) {
return $result;
}
if ( ! is_user_logged_in() ) {
return new WP_Error( 'restx_logged_out', 'Funktion nicht erlaubt.', array( 'status' => 401 ) );
}
return $result;
});
root@sliplady:/var/www/html/wp-content/themes/hello-hv# nano functions.php
[attachment=48]
Clean:
[attachment=49]
Apache starten:
sudo /etc/init.d/apache2 start
Apache stoppen:
sudo /etc/init.d/apache2 stop
Apache neu starten:
sudo /etc/init.d/apache2 restart
Status abfragen:
sudo systemctl status apache2
Module anzeigen lassen:
apachectl -t -D DUMP_MODULES