Server/srs30: Unterschied zwischen den Versionen

Aus Wiki StuRa HTW Dresden
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
Zeile 55: Zeile 55:
* dump und tar wegspeichern
* dump und tar wegspeichern
*: Erledigt durch Michael! :-) :-*
*: Erledigt durch Michael! :-) :-*
=== Vorbereitung ===
pauschales Aktualisieren
: <code>pkg upgrade -y</code>
----
=== Installation von WordPress ===
: mit ergänzenden (wahlobligatorischen) Komponenten
: mit passend notwendiger Konfiguration
Installieren von WordPress
: <code>pkg install -y wordpress</code>
<pre></pre>
<pre>
Message from wordpress-4.4.2,1:
**** NOTE ****
Before the first use of WordPress, copy wp-config-sample.php to wp-config.php
in /usr/local/www/wordpress and modify it to fit your MySQL.
Maybe you need 'mysqladmin create wordpress' first.
If you are upgrading from 1.x or 2.x or 3.x to 4.x, please run
http://your.site/wordpress/wp-admin/upgrade.php to upgrade to WordPress 4.x
</pre>
----
passendes Installieren von eines möglichen Webservers (Apache 2.4)
: <code>pkg install -y apache24</code>
<pre></pre>
<pre>
Message from apache24-2.4.20_1:
To run apache www server from startup, add apache24_enable="yes"
in your /etc/rc.conf. Extra options can be found in startup script.
Your hostname must be resolvable using at least 1 mechanism in
/etc/nsswitch.conf typically DNS or /etc/hosts or apache might
have issues starting depending on the modules you are using.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- apache24 default build changed from static MPM to modular MPM
- more modules are now enabled per default in the port
- icons and error pages moved from WWWDIR to DATADIR
  If build with modular MPM and no MPM is activated in
  httpd.conf, then mpm_prefork will be activated as default
  MPM in etc/apache24/modules.d to keep compatibility with
  existing php/perl/python modules!
Please compare the existing httpd.conf with httpd.conf.sample
and merge missing modules/instructions into httpd.conf!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
</pre>
: <code>sysrc apache24_enable=yes</code>
: <code>service apache24 start</code>
----
PHP meets Apache
: <code>pkg install mod_php56</code>
: <code>cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini</code>
: <code>$EDITOR /usr/local/etc/apache24/Includes/php.conf</code>
<pre>
<IfModule dir_module>
    DirectoryIndex index.php index.html
    <FilesMatch "\.php$">
        SetHandler application/x-httpd-php
    </FilesMatch>
    <FilesMatch "\.phps$">
        SetHandler application/x-httpd-php-source
    </FilesMatch>
</IfModule>
</pre>
: <code>service apache24 restart</code>
----
passendes Installieren von einer möglichen Datenbank (MySQL 5.6)
: <code>pkg install -y mysql56-server</code>
<pre></pre>
<pre>
Message from mysql56-client-5.6.27:
* * * * * * * * * * * * * * * * * * * * * * * *
Please be aware the database client is vulnerable
to CVE-2015-3152 - SSL Downgrade aka "BACKRONYM".
You may find more information at the following URL:
http://www.vuxml.org/freebsd/36bd352d-299b-11e5-86ff-14dae9d210b8.html
Although this database client is not listed as
"affected", it is vulnerable and will not be
receiving a patch. Please take note of this when
deploying this software.
* * * * * * * * * * * * * * * * * * * * * * * *
</pre>
<pre></pre>
<pre>
Message from mysql56-server-5.6.27:
************************************************************************
Remember to run mysql_upgrade the first time you start the MySQL server
after an upgrade from an earlier version.
************************************************************************
</pre>
: <code>sysrc mysql_enable=yes</code>
: <code>service mysql-server start</code>
: <code>mysql_secure_installation</code>
<pre></pre>
<pre>
Set root password? [Y/n] y
</pre>
<pre>
New password:
Re-enter new password:
</pre>
<pre>
Remove anonymous users? [Y/n] y
</pre>
<pre>
Disallow root login remotely? [Y/n] y
</pre>
<pre>
</pre>
<pre>
Remove test database and access to it? [Y/n] y
</pre>
<pre>
Reload privilege tables now? [Y/n] y
</pre>
----
PHP meets MySQL
: <code>pkg install -y php56-mysql</code>
----
WordPress meets Apache
: <code>mv /usr/local/www/apache24/data /usr/local/www/apache24/data.bak</code>
: <code>ln -s /usr/local/www/wordpress/ /usr/local/www/apache24/data</code>
<!--
chown www:www /usr/local/www/apache24/data/wordpress
-->
----
=== Migration von WordPress ===
: aus einem älteren Ubuntu (mit seltsamen UIDs und sowas)
Achtung!
Dieser Abschnitte basiert auf Erinnerungen unmittelbar nach der Mirgration.
Dieser Abscnitt basiert nicht auf ordentlichen Aufzeichnungen.
: alte Daten ins neue (frisch installierte) WordPress werfen
<!--
: <code>cd ~</code>
: <code>mkdir import</code>
: <code>cd ~/import</code>
: <code>fetch http://www.fsr-et.htwdd.de/wp.tar.gz</code>
: <code>fetch http://www.fsr-et.htwdd.de/fsr_et.sql</code>
: <code>tar -xvzf wp.tar.gz</code>
; weitere Notizen:
mv (import) same configs!
mv (import) wp-config!
chown -R www:www wp-config
connect to database by adding credentials to wp-config.php
----
mv /usr/local/www/wordpress /usr/local/www/wordpress_default
mkdir /usr/local/www/wordpress
chown www:www /usr/local/www/wordpress
cd /usr/local/www/wordpress && fetch http://www.fsr-et.htwdd.de/wp.tar.gz && tar -xvzf wp.tar.gz && rm wp.tar.gz
mysql -u root -p wordpress < /tmp/fsr_et.sql
cp wordpress_default/wp-config.php wordpress/wp-config.php
----
; unabhängige Notizen:
tar -cvzf dump.tar.gz
----
--->


== zu erledigende Dinge ==
== zu erledigende Dinge ==

Version vom 26. April 2016, 00:01 Uhr

Betriebssystem

Server/srs1337
Jail FreeNAS
FreeBSD

Verwendungszweck

Erstellung

Klicken der Jail über die Oberfläche von FreeNAS auf Server/srs1337
  • Jails ausgewählt
    • Add Jail ausgewählt
      • bei Jail Name: et_wordpress eingetragen
      • OK geklickt
        Jail wurde erstellt
    • View Jails ausgewählt
      • Zeile der Jail (Bezeichnung der Spalte) et_wordpress angewählt
        • Edit Jail (Werkzeugschlüssel) geklickt
          • bei IPv4 adress: ersetzend 141.56.50.30 eingetragen
          • OK geklickt
        • Edit Jail (Werkzeugschlüssel) geklickt
          • Advanced Mode geklickt
            • bei IPv4 default gateway: 141.56.50.254 eingetragen
            • Save geklickt
      • Zeile der Jail (Bezeichnung der Spalte) et_wordpress angewählt
        • Restart (gelbes Symbol) geklickt
          • Yes geklickt
Testen des Zugriffes von Server/srs1337
  • per Klicken einer Konsole
  • vom Terminal aus
    jexec `jls | grep et_wordpress | awk '{ print $1 }'` sh

Installation

Vorgeschichte

Der FSR ET betrieb eine (die) Instanz WordPress auf einem eigenen (kleinen) Server. Der kleine Server war in die Tage gekommen (BIOS-Baterrie leer; Lüfter defekt; keine Zugangsdaten). Die Instanz wurde 2016-04-25 letztlich als neue Instanz auf einen Server (srs1337) beim StuRa überführt.

Siehe auch
website:stura/ref/verwaltung/admin/events/arbeitstreffen-migration-wordpress-fsr-et

dump erstellen

  • neustarten
  • verwenden vom single user mode
  • prüfen des Besitzes von administrative Rechten
  • einhängen von allen wichtigen Pfaden (auch /) als read und write
  • mysqldump (Wohl waren hier die Zugangsdaten verfügbar.)
  • "tar wordpress"
    • (Alle "gelinkten" (ln) Inhalte wären auch nett gewesen. :-/ :-D)
  • dump und tar wegspeichern
    Erledigt durch Michael! :-) :-*

Vorbereitung

pauschales Aktualisieren

pkg upgrade -y

Installation von WordPress

mit ergänzenden (wahlobligatorischen) Komponenten
mit passend notwendiger Konfiguration

Installieren von WordPress

pkg install -y wordpress

Message from wordpress-4.4.2,1:
**** NOTE ****
Before the first use of WordPress, copy wp-config-sample.php to wp-config.php
in /usr/local/www/wordpress and modify it to fit your MySQL.
Maybe you need 'mysqladmin create wordpress' first.
If you are upgrading from 1.x or 2.x or 3.x to 4.x, please run
http://your.site/wordpress/wp-admin/upgrade.php to upgrade to WordPress 4.x

passendes Installieren von eines möglichen Webservers (Apache 2.4)

pkg install -y apache24

Message from apache24-2.4.20_1:
To run apache www server from startup, add apache24_enable="yes"
in your /etc/rc.conf. Extra options can be found in startup script.

Your hostname must be resolvable using at least 1 mechanism in
/etc/nsswitch.conf typically DNS or /etc/hosts or apache might
have issues starting depending on the modules you are using.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

- apache24 default build changed from static MPM to modular MPM
- more modules are now enabled per default in the port
- icons and error pages moved from WWWDIR to DATADIR

   If build with modular MPM and no MPM is activated in 
   httpd.conf, then mpm_prefork will be activated as default
   MPM in etc/apache24/modules.d to keep compatibility with 
   existing php/perl/python modules!

Please compare the existing httpd.conf with httpd.conf.sample
and merge missing modules/instructions into httpd.conf!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
sysrc apache24_enable=yes
service apache24 start

PHP meets Apache

pkg install mod_php56
cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
$EDITOR /usr/local/etc/apache24/Includes/php.conf
<IfModule dir_module>
    DirectoryIndex index.php index.html
    <FilesMatch "\.php$">
        SetHandler application/x-httpd-php
    </FilesMatch>
    <FilesMatch "\.phps$">
        SetHandler application/x-httpd-php-source
    </FilesMatch>
</IfModule>
service apache24 restart

passendes Installieren von einer möglichen Datenbank (MySQL 5.6)

pkg install -y mysql56-server

Message from mysql56-client-5.6.27:
* * * * * * * * * * * * * * * * * * * * * * * *

Please be aware the database client is vulnerable
to CVE-2015-3152 - SSL Downgrade aka "BACKRONYM".
You may find more information at the following URL:

http://www.vuxml.org/freebsd/36bd352d-299b-11e5-86ff-14dae9d210b8.html

Although this database client is not listed as
"affected", it is vulnerable and will not be 
receiving a patch. Please take note of this when
deploying this software.

* * * * * * * * * * * * * * * * * * * * * * * *

Message from mysql56-server-5.6.27:
************************************************************************

Remember to run mysql_upgrade the first time you start the MySQL server
after an upgrade from an earlier version.

************************************************************************
sysrc mysql_enable=yes
service mysql-server start
mysql_secure_installation

Set root password? [Y/n] y
New password: 
Re-enter new password: 
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y

Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

PHP meets MySQL

pkg install -y php56-mysql

WordPress meets Apache

mv /usr/local/www/apache24/data /usr/local/www/apache24/data.bak
ln -s /usr/local/www/wordpress/ /usr/local/www/apache24/data

Migration von WordPress

aus einem älteren Ubuntu (mit seltsamen UIDs und sowas)
Achtung!
Dieser Abschnitte basiert auf Erinnerungen unmittelbar nach der Mirgration.
Dieser Abscnitt basiert nicht auf ordentlichen Aufzeichnungen.
alte Daten ins neue (frisch installierte) WordPress werfen


zu erledigende Dinge

  • Verfügbarkeit des Zugriffes per ssh
    • (mindestens) ein allgemeiner Account
      • sudo
  • Übergabe Passwörter
    macht Michael
    • mysql
      • root
        • Passwort
      • Account für wordpress
        • Passwort
    • Account vom FSR ET bei WordPress

zu erledigende Tests

  • Muss noch was an Software seit dem Umzug aktualisert werden?
  • Ist mysql_upgrade oder sowas noch aussstehend.

Siehe auch