This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Eigene Eintwicklungsumgebung mit Ubuntu Server 20.04 LTS 64 Bit Version - Teil 8
#1
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:

   

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.

   

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

   

Verzeichnisauflistung ist aber noch aktiv:

   

Verzeichnisauflistung deaktivieren:

root@sliplady:/etc/apache2# nano apache2.conf

   

<Directory /var/www/html>

        AllowOverride All
        Options -Indexes
        ServerSignature off
        Require all granted

</Directory>

   

Auslesen von sensiblen Daten und Einschleusen verhindern.

WordPress REST API noch abschalten!

Sprachlos - Keine Worte mehr:

http://192.168.178.21/wp-json

   

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

   

Clean:

   


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


Coffee
Zitieren


Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste