RaspberryPi3B: Difference between revisions

From Wiki RB4
 
(297 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Specification==
==Specification==
* [https://www.amazon.de/gp/product/B01DC6MKAQ/ref=oh_aui_detailpage_o02_s01?ie=UTF8&psc=1 package] bought at amazon
* Quad Core 1.2GHz Broadcom BCM2837 64bit CPU
* Quad Core 1.2GHz Broadcom BCM2837 64bit CPU
* 1GB RAM
* 1GB RAM
Line 11: Line 12:
* Micro SD port for loading your operating system and storing data
* Micro SD port for loading your operating system and storing data
* Upgraded switched Micro USB power source up to 2.5A
* Upgraded switched Micro USB power source up to 2.5A
* 16GB Micro SD card
==OS-Version==
cat /etc/os-release // lists version 8
// kernel
uname -a // lists Linux raspberrypi 4.9.35...


==Configuration==
==Configuration==
* 192.168.178.34 for WLAN
 
===LAN===
* 192.168.178.35 for LAN
* 192.168.178.35 for LAN
* SSH credentials (e.g. for WinSCP or Putty) user=pi pwd=raspberry for both IP
 
* enable SSH access for root by
===WLAN and Bluetooth switch off===
* old WLAN IP was 192.168.178.34
* copy /boot/config.txt to /boot/config_2019-08-18.txt
* add lines below to /boot/config.txt
# added by UH 2019-08-18 for disabling WLAN and Bluetooth
dtoverlay=pi3-disable-wifi
dtoverlay=pi3-disable-bt
* reboot after change first time
 
===Shared Public Directory===
*<code>cd /media/usbstick2/shared</code>
*<code>python3 -m http.server 8181</code>
*<code>http://192.168.178.35:8181</code>
 
===SSH===
 
* configuration is in /etc/ssh/sshd_config
* all logins are documented in /var/log/auth.log
// the following entries are created by the local cron job and not critical
Aug 13 08:09:02 raspberrypi CRON[29805]: pam_unix(cron:session): session opened for user root by (uid=0)
Aug 13 08:09:02 raspberrypi CRON[29805]: pam_unix(cron:session): session closed for user root
* SSH credentials (e.g. for WinSCP or Putty) for user=pi pwd=Halloo0@1 (old raspberry)
* enable SSH access for root with pwd Halloo0@1 by
  sudo su
  sudo su
  passwd Halloo0@1
  passwd Halloo0@1
Line 23: Line 53:
  // add PermitRootLogin yes
  // add PermitRootLogin yes
  sudo service ssh restart
  sudo service ssh restart
* to just enable root for ssh
copy /etc/ssh/sshd_config to /etc/ssh/sshd_config_2019-08-18
add to ssh_config
    # added by UH 2019-18-08 10:05
    AllowUsers root
restart service by
    sudo service ssh restart
* cmd line access via fritzbox by
ssh root@uweheuer.spdns.de -p 54444
* or use WinSCP


* SD Card is mmcblk0
===SD Card===
* SD Card is file /dev/mmcblk0 and mmcblk0p[1-7] are the partitions, see them
fdisk /dev/mmcblk0
p
q


===USB stick===
===Timezone===
* pluged-in USB stick -> USB stick is sda1 (see lsblk)
set to Berlin by:
* partition table changed to Linux according to [http://www.netzmafia.de/skripten/hardware/RasPi/RasPi_Laufwerke.html here]
sudo timedatectl set-timezone Europe/Berlin
check with
timedatectl
 
===USB stick 1===
* pluged-in 64GB USB stick -> USB stick is sda1 (see lsblk)
* windows partition table changed to Linux according to [http://www.netzmafia.de/skripten/hardware/RasPi/RasPi_Laufwerke.html here]
* format USB stick to ext4 filesystem by  
* format USB stick to ext4 filesystem by  
  umount /dev/sda1
  umount /dev/sda1
Line 39: Line 89:
  nano -Bw /etc/fstab
  nano -Bw /etc/fstab
  add line /dev/sda1 /media/usbdisk auto defaults,user 0 1
  add line /dev/sda1 /media/usbdisk auto defaults,user 0 1
===USB stick 2===
* pluged-in 128GB USB stick for backup of raspberry -> USB stick device is sdb, partition is sdb1 (see output of tail -f /var/log/messages)
* the stick is formatted with FAT filesystem and is changed to ext4 by:
fdisk /dev/sdb
d
n + p
w
reboot
mkfs.ext4 /dev/sdb1 -L USBSTICK2
* mount it
cd /media
mkdir usbstick2
mount /dev/sda1 /media/usbstick2
* and for mounting it permanently add the following line /etc/fstab
/dev/sdb1 /media/usbstick2 auto defaults,user 0 1


===Fritz NAS===
===Fritz NAS===
Line 44: Line 110:
  cd /media
  cd /media
  mkdir fritzNAS
  mkdir fritzNAS
===User===
* pi <Lr><STANDARD><Lr>


==Software==
==Software==


===Apache===
===[[Apache|Apache]]===
====Installation====
* verion 2.4 installed by
* verion 2.4 installed by
  sudo apt-get install apache2
  sudo apt-get install apache2
  chmod 777 /var/www/html
  chmod 777 /var/www/html
* to setup Apache as reverse proxy for [[RaspberryPi3B#Wildfly|Wildfly]]
* to setup Apache as reverse proxy for [[RaspberryPi3B#Wildfly_19.1|Wildfly]]
  sudo a2enmod proxy_ajp  
  sudo a2enmod proxy_ajp  
* creates proxy.conf, proxy.load and proxy_ajp.load in /etc/apache2/mods-enabled
* creates proxy.conf, proxy.load and proxy_ajp.load in /etc/apache2/mods-enabled
====Configuration====
=====Site Configuration=====
* <code>/etc/apache2/sites-enabled/*</code> are links to /etc/apache2/sites-available
* for forwarding to Raspberry 4B in <code>000-default-le-ssl.conf</code>
ProxyPass /fwdtest http://192.168.178.72
ProxyPassReverse /fwdtest http://192.168.178.72
=====Logging=====
* see /var/log/apache2
====Operation====
* restart
* restart
  sudo /etc/init.d/apache2 restart or
  sudo /etc/init.d/apache2 restart or
  service apache2 restart
  service apache2 restart
* find out version
* find out version
  apache2ctl -v
  apache2ctl -v // -> Apache 2.4
* stop service
sudo service apache2 stop
* log goes to
/var/log/apache2


====Logging====
===Backup by RaspiBackup===
* see /var/log/apache2
====Installation====
* installation according to [https://www.linux-tips-and-tricks.de/de/raspberry/23-pi-erstellt-automatisch-backups-von-sich-selbst-pi-creates-automatic-backups-of-itself/ here] as user root
curl -sSLO https://www.linux-tips-and-tricks.de/raspiBackupInstall.sh && sudo bash raspiBackupInstall.sh
EN
N (normal mode)
RSYNC (backup type)
5 (number of backups)
Y (verbose message)
installs raspiBackup.sh and raspiBackupInstall.sh to /usr/local/bin and raspiBackup.conf to /usr/local/etc.
* changed in /usr/local/etc/raspiBackup.conf to
DEFAULT_BACKUPPATH="/media/usbstick2/raspibackup"
====Operation====
* open termminal
* call backup by
/usr/local/bin# ./raspiBackup.sh -a : -o : -m detailed -P
* map HomePC backup directory as described in [[RaspberryPi3B#Backup_4|here]]
* copy latest backup to ../backup/raspberry/raspibackup/ by
/media/usbstick2/raspibackup/raspberrypi# cp -r raspberrypi-rsync-backup-<DATETIME>/ /media/ubunturoot/backup/raspberry/raspberrybackup/
* copy backup directory to [[Computer#Backup|external discs]]


===Mediawiki===
===Mediawiki===
Line 71: Line 175:
* move directory to the html directory by
* move directory to the html directory by
   mv /tmp/mediawiki /var/www/html/mediawiki
   mv /tmp/mediawiki /var/www/html/mediawiki
* change /var/www/html/mediawiki/LocalSettings.php
$wgServer = "http://uweheuer.goip.de";
* call http://192.168.178.35/mediawiki/
* call http://192.168.178.35/mediawiki/
* to avoid not logged-in users to view or edit anything added the following lines to LocalSettings.php
* to avoid not logged-in users to view or edit anything added the following lines to LocalSettings.php
Line 78: Line 180:
  $wgGroupPermissions['*']['edit'] = false;
  $wgGroupPermissions['*']['edit'] = false;
  $wgGroupPermissions['*']['createaccount'] = false;
  $wgGroupPermissions['*']['createaccount'] = false;
* install ImageMagick for picture rendering by
sudo apt-get update
sudo apt-get install imagemagick
* copy C:\Uwes\Programme\xampp\htdocs\mediawiki-1.16.0\images to /var/www/html/mediawiki/images
* set images folder permissions right by
sudo chown -R www-data:www-data images/
sudo chmod -R 755 images/
* prabably forget to describe DB copy from EON laptop to Raspberry
====Backup====
=====DB Backup=====
* start xampp on laptop and start Apache and MySQL (works also on [https://uweheuer.spdns.de/mediawiki/index.php/EDTLaptop3 ZBook])
* call (database mediawiki_raspberry3b to be there)
C:\Uwes\owncloud\batches\Raspberry3BMediawikiToLocalhost.bat // will update DB [http://localhost/phpmyadmin/index.php?route=/database/structure&db=mediawiki_raspberry3b  mediawiki_raspberry3b] and document date in C:\temp text file
* on Raspberry map [[RaspberryPi3B#DB_backup_2|/media/ubunturoot/]]
mysqldump --single-transaction -h localhost -u root -p  mediawiki > /media/ubunturoot/backup/raspberry/mediawiki/mediawiki_<YYYY-MM-DD>.txt
Enter password:
* copy DB export file to [[Computer#Backup|external discs]]
=====Directory Backup=====
* on Raspberry
** to Ubuntu (if it is switched on)
tar zcvhf /media/ubunturoot/backup/raspberry/mediawiki/mediawiki_<YYYY-MM-DD>.tgz /var/www/html/mediawiki
** to local disc
tar zcvhf /backup/mediawiki/mediawiki_<YYYY-MM-DD>.tgz /var/www/html/mediawiki
tar zcvhf /backup/mediawiki/mediawiki_2022-06-29.tgz /var/www/html/mediawiki
*** copy it to Raspberry 4 <code>/home/uwe/backup/Raspberry3B/MediaWiki</code> via WinSCP
*** copy tgz file to [[Computer#Backup|external discs]]
*** copy tgz file to <code>C:\Uwes\owncloud\backups\raspberry3B\Mediawiki</code> via WinSCP
====Upgrade from 1.25 to 1.33====
* install version 1.33
** download the latest release (1.33) from [https://www.mediawiki.org/wiki/Download here] to laptop and copy it to raspberry /tmp directory
** extract gz file in /tmp by
tar -xvzf mediawiki-1.33.0.tar.gz
** move extracted directory to /var/www/html
mv mediawiki-1.33.0/ /var/www/html/
** delete downloaded gz-file
** copy images from 1.25 installation
  cp -a /backup/2019-08-27_mediawiki/images/* /var/www/html/mediawiki/images/
** copy LocalSettings.php from 1.25 installation
cp ../mediawiki/LocalSettings.php .
** edit LocalSettings.php (because of errors of the update script
*** decomment wfLoadSkin except Vector
*** decomment ConfirmEdit extension
** [[RaspberryPi3B#PHP7.2|disable PHP5 and enable PHP7.2]]
** run the update script by
cd maintenance
php update.php
====Install Msupload extension to enable Drag & Drop====
* install from [https://www.mediawiki.org/wiki/Extension:MsUpload here]
* install [[RaspberryPi3B#PHP7.2|PHP bcmath module]] to get rid of the error in editor
===Install MS Upload Extension===
* download and follow instructions from [https://www.mediawiki.org/wiki/Special:ExtensionDistributor?extdistname=MsUpload&extdistversion=REL1_33 here]


===MySQL===
===MySQL===
Line 87: Line 246:
* login with local client
* login with local client
  mysql -u root -p
  mysql -u root -p
====Backup====
* map directory like in [[RaspberryPi3B#Backup_4|owncloud backup]]
mysqldump --all-databases --single-transaction -h localhost -u root -p > /media/ubunturoot/backup/raspberry/mysql/DB_<YYYY-MM-DD>.txt


===OwnCloud===
===OwnCloud===
[[ownCloud|ownCloud]] installed according to [https://eltechs.com/owncloud-on-raspberry-pi/ here]]:
 
====Settings====
* WebDAV https://uweheuer.spdns.de/owncloud/remote.php/dav/files/uwe.heuer%40gmail.com/
* installation directory is <code>/var/www/html/owncloud/</code>
* configuration including data directory is <code>/var/www/html/owncloud/config/config.php</code>
* data directory is <code>/media/usbstick/owncloud/data/uwe.heuer@gmail.com</code>
* latest version of the files are in subdirectory <code>/files</code>
 
====Operation====
* make occ executable
root@raspberrypi:/var/www/html/owncloud# sudo chmod +x occ
* test occ
root@raspberrypi:/var/www/html/owncloud# sudo -u www-data ./occ
* scan filesystem and update DB
root@raspberrypi:/var/www/html/owncloud# sudo -u www-data ./occ files:scan --all
 
====Installation====
[[ownCloud|ownCloud]] installed according to [https://eltechs.com/owncloud-on-raspberry-pi/ here]:
  apt-get install apache2 php5 php5-gd php-xml-parser php5-intl
  apt-get install apache2 php5 php5-gd php-xml-parser php5-intl
  apt-get install php5-sqlite php5-mysql smbclient curl libcurl3 php5-curl
  apt-get install php5-sqlite php5-mysql smbclient curl libcurl3 php5-curl
Line 99: Line 279:
  service apache2 restart
  service apache2 restart
* call <IP>/owncloud, admin user uwe.heuer@gmail.com Halloo0@1, DB root root owncloud localhost:3306
* call <IP>/owncloud, admin user uwe.heuer@gmail.com Halloo0@1, DB root root owncloud localhost:3306
* change data directory by
* change data directory according to [https://doc.owncloud.org/server/10.0/admin_manual/maintenance/manually-moving-data-folders.html here] by
  mkdir /media/usbstick/owncloud/data
  mkdir /media/usbstick/owncloud/data
cp -r /var/www/html/owncloud/data/. /media/usbstick/owncloud/data
  chown -R www-data:www-data /media/usbstick/owncloud/data
  chown -R www-data:www-data /media/usbstick/owncloud/data
* to make owncloud accessible via goip uweheuer domain added to /var/www/html/owncloud/config/config.php in trusted domains
apachectl -k stop
rsync -avz /var/www/html/owncloud/data /media/usbstick/owncloud/
mv data data_obsolete
ln -s /media/usbstick/owncloud/data/ /var/www/html/owncloud/data
apachectl -k graceful
* to make owncloud accessible via uweheuer domain added to /var/www/html/owncloud/config/config.php in trusted domains
   'trusted_domains' =>  
   'trusted_domains' =>  
   array (
   array (
     0 => '192.168.178.35',
     0 => '192.168.178.35',
     1 => 'uweheuer.goip.de',
     1 => 'uweheuer.spdns.de',
   )
   )
* to make it accessible only via SSL added to /etc/apache2/sites-enabled/000-default.conf
* to make it accessible only via SSL see '000-default.conf' and '000-default-le-ssl.conf' in  [[#Site_Configuration|/etc/apache2/sites-enabled/]]
  Redirect /owncloud https://uweheuer.goip.de/owncloud
* to correct inconsistent database and filesystem
  :/var/www/html/owncloud# sudo -u www-data php occ files:scan --all
====Contacts====
* Contacts-App via Market installed
* Contacts-App via Market installed
* CardDav URL https://uweheuer.goip.de/owncloud/remote.php/dav/addressbooks/users/uwe.heuer@gmail.com/contacts/
* CardDav URL https://uweheuer.spdns.de/owncloud/remote.php/dav/addressbooks/users/uwe.heuer@gmail.com/contacts/ by Contacts -> Settings -> ... -> Link -> Copy URL to Clipboard
* for client configuration see e.g. [[SamsungTabletTabA#CardDAV-Sync_free|Samsung Tablet]]
 
====Calendar====
* Calendar-App via Market installed
* CalDav URL https://uweheuer.spdns.de/owncloud/remote.php/dav/
* for client configuration see e.g. [[SamsungTabletTabA#CalDAV-Sync|Samsung Tablet]]
 
====Upgrade====
* user (right top corner) -> settings
* admin area (left area) -> General -> Scroll down to Updater
* install apps again
 
====Backup====
=====Backup Files=====
* create <code>/backup/BackupOwncloudFiles.sh</code> with
** <code>cd /media/usbstick/owncloud/data/uwe.heuer@gmail.com/files</code>
** <code>zip -rFS -P "<STANDARD>" /media/usbstick/backup/owncloud/owncloud_backup.zip .</code>
* zipping every night by <code>sudo crontab -e</code>
* file will be fetched from Raspberry 4 and copied to Google drive (see [[RaspberryPi4B#Backup_of_Raspberry_3B|here]])
 
=====config directory=====
* and config directory <code>/var/www/html/owncloud/config/</code> to [[Computer#Backup|external discs]]
 
=====DB backup=====
created /media/ubunturoot permanently
* start Ubuntu HomePC (via fritz.box or WOL)
* login (as root) to Raspberry e.g. by Putty from Windows or Ubuntu
* mount directory for backup by
sudo mount -t cifs -o username=uwe //192.168.178.202/shareroot /media/ubunturoot/
<ROOT_PWD>
* change to Owncloud directory by
cd /var/www/html/owncloud/
* backup DB by
mysqldump --single-transaction -h localhost -u root -p  owncloud > /media/ubunturoot/backup/raspberry/owncloud/owncloud_<YYYY-MM-DD>.txt
Enter password:
* unmount directory by
umount /media/ubunturoot
* and copy dump file to [[Computer#Backup|external discs]]
 
=====Data Backup=====
* copy data directory <code>/media/usbstick/owncloud/data</code> to [[Computer#Backup|external discs]]
 
===PHP===
====PHP5====
* installed via [[#OwnCloud|OwnCloud]] installation. Is is not clear which ini-file is used:
./etc/php5/cli/php.ini
./etc/php5/apache2/php.ini // this one is used according phpinfo()
 
* increased max file upload size for [[#Installation|Wordpress]] by setting
upload_max_filesize = 4M // before 2M
service apache2 restart
 
====PHP7.2====
* installation according to [https://tecadmin.net/install-php7-on-debian/ here]
sudo apt update
sudo apt install php7.2
sudo apt install php7.2 php7.2-cli php7.2-cgi php7.2-common php7.2-curl php7.2-gd php7.2-json php7.2-mbstring php7.2-mysql php7.2-opcache php7.2-readline php7.2-xml libapache2-mod-php7.2
* and in order to make Owncloud work with 7.2
apt-get install php7.2-intl
apt-get install php7.2-zip
service apache2 restart
* and in order to make [[RaspberryPi3B#Install_Msupload_extension_to_enable_Drag_.26_Drop|Msupload extension]] of Mediawiki to work
apt-get install php7.2-bcmath
service apache2 restart
* ini-files:
./etc/php/7.2/cli/php.ini
./etc/php/7.2/apache2/php.ini // this one is used according phpinfo()
 
* switch to PHP7.2 (PHP5 remains installed)
a2dismod php5
a2enmod php7.2
service apache2 restart


===PHPMyAdmin===
===PHPMyAdmin===
Line 120: Line 378:
* add to /etc/apache2/apache2.conf at the end (marked by UH)
* add to /etc/apache2/apache2.conf at the end (marked by UH)
  Include /etc/phpmyadmin/apache.conf
  Include /etc/phpmyadmin/apache.conf
* changed URL in /etc/phpmyadmin/apache.conf by
Alias /phpxmyadmin /usr/share/phpmyadmin
* restart apache
* restart apache


===SSL===
===SSL===
====Obsolete installation via Backports Packages====
* edit /etc/apt/sources.list and add
* edit /etc/apt/sources.list and add
  deb http://ftp.debian.org/debian jessie-backports main
  deb http://ftp.debian.org/debian jessie-backports main
* backports are recompiled packages from testing and unstable  in a stable environment so that they will run without new libraries
* update
* update
  apt-get update
  apt-get update
* install
* install via Certbot, a script to install and update Let´s Encrypt SSL-certificats
  sudo apt-get install python-certbot-apache
  sudo apt-get install python-certbot-apache
  sudo apt-get install certbot -t jessie-backports
  sudo apt-get install certbot -t jessie-backports
Line 133: Line 395:
  uweheuer.goip.de uwe.heuer@gmail.com
  uweheuer.goip.de uwe.heuer@gmail.com
* creates among others /etc/letsencrypt
* creates among others /etc/letsencrypt
====Upgrade Cerbot from Homepage====
* goto [https://certbot.eff.org/ Certbot Homepage] and select 'Apache' and 'Debian 8 (jessie)' and follow instructions
sudo apt-get remove certbot
wget https://dl.eff.org/certbot-auto
sudo mv certbot-auto /usr/local/bin/certbot-auto
sudo chown root /usr/local/bin/certbot-auto
sudo chmod 0755 /usr/local/bin/certbot-auto
* certbot-auto accepts the same flags as certbot
* decommented the backports entry in /etc/apt/sources.list
sudo apt-get update
* then continue with Certbot configuration
sudo /usr/local/bin/certbot-auto --apache -d uweheuer.spdns.de
sudo /usr/local/bin/certbot-auto -d bbx0axbhewglhzf4.myfritz.net
sudo /usr/local/bin/certbot-auto --apache delete --cert-name uweheuer.goip.de
// this also edits /etc/apache2/sites-enabled/000-default-le-ssl.conf
* after Fritzbox 7490 to Fritzbox 7590
./certbot-auto -d uweheuer.spdns.de --cert-name 36jjbpz29h1pyywz.myfritz.net
sudo /usr/local/bin/certbot-auto delete --cert-name bbx0axbhewglhzf4.myfritz.net
replace in /etc/apache2/sites-enabled/000-default-le-ssl.conf bbx0axbhewglhzf4 with 36jjbpz29h1pyywz
* edit file /etc/cron.d/certbot and decomment old entry from obsolete installation and add
0 0,12 * * * python -c 'import random; import time; time.sleep(random.random() * 3600)' && /usr/local/bin/certbot-auto renew
=====Manual renew of SSL certificates=====
* login as root@raspberrypi with <STANDARD>:
cd /usr/local/bin
./certbot-auto renew // this might take very long if an update is needed, obviously requires [[RaspberryPi3B#Operation_3|reboot]] for JBoss to work properly
* easiest is to reboot and than [[RaspberryPi3B#Operation_4|restart Wildfly]] (Wildfly is not startet automatically after reboot)
===TCPDump===
* sudo apt-get install tcpdump


===UweHeuer===
===UweHeuer===
Line 142: Line 434:
* deploy it via the Wildfly admin console
* deploy it via the Wildfly admin console
* create datasources via Web admin console with
* create datasources via Web admin console with
  MySQLDS
  MySQLDS (see [[:File:RaspberryMySQL505Configuration.pdf]])
  jdbc:mysql://localhost/mysql505?autoReconnect=true
  jdbc:mysql://localhost/mysql505?autoReconnect=true
  root root
  root root
Line 148: Line 440:
  UwesWikiDS
  UwesWikiDS
  ...
  ...
* after [[RaspberryPi3B#SSL_2|SSL]] setup added to /etc/apache2/sites-enabled/000-default-le-ssl.conf
* after [[RaspberryPi3B#SSL|SSL]] setup added to [[#Site_Configuration|/etc/apache2/sites-enabled/]]000-default-le-ssl.conf
  ProxyPass /uweheuer ajp://localhost:8009/uweheuer
  ProxyPass /uweheuer ajp://localhost:8009/uweheuer
  ProxyPassReverse /uweheuer http://localhost/uweheuer
  ProxyPassReverse /uweheuer http://localhost/uweheuer
* /etc/apache2/000-default.conf permanent redirect to SSL  
ProxyPass /uweheuer_qa ajp://localhost:8009/uweheuer_qa
  Redirect permanent /uweheuer https://uweheuer.goip.de/uweheuer
ProxyPassReverse /uweheuer_qa http://localhost/uweheuer_qa
 
* /etc/apache2/sites-available/000-default.conf permanent redirect to SSL  
RedirectMatch ^/$ https://uweheuer.spdns.de/wordpress
  Redirect /uweheuer https://uweheuer.spdns.de/uweheuer
Redirect /uweheuerqs https://uweheuer.spdns.de/uweheuerqs
Redirect /owncloud https://uweheuer.spdns.de/owncloud
 
* create <code>/myprogs</code> and copy DisAndEnableUweHeuer.bat
* create <code>/myprogs</code> and copy DisAndEnableUweHeuer.bat
* Wildfly logger configuratoin according to [[Uweheuer#Server_Logging|here]]
* Wildfly logger configuratoin according to [[Uweheuer#Server_Logging|here]]
* after deployment uweheuer.war is probably extracted to (vfs stands for virtual file system)
/home/uwe/raspberry_root/wildfly/wildfly-11.0.0.Final/standalone/tmp/vfs/temp


===Wildfly===
====Backup August 2025====
* C:\Uwes\owncloud\batches\Raspberry3BBookmarksToCTemp.bat Window cmd batch (not Powershell) to copy DB content for uweheuer to C:\temp
 
====Backup====
* on laptop (xampp must be running)
** create DB mysql506
** run script
C:\Uwes\Batches\RaspberryBookmarksToLocalhost.bat
** rename DB with date extension
* on Raspberry map ubunturoot
mysqldump --single-transaction -h localhost -u root -p  mysql506 > /media/ubunturoot/backup/raspberry/uweheuer/mysql506_<YYYY-MM-DD>.txt
Enter password:
** copy <code>/wildfly/wildfly-19.1.0.Final/data/uweheuer/abc.tmp|Configuration.properties</code> to <code>/media/ubunturoot/backup/raspberry/uweheuer/</code>
** copy files to [[Computer#Backup|external discs]]
 
===Wildfly 19.1===
====Installation====
* download wildfly-19.1.0.Final.zip from https://wildfly.org/downloads/ to laptop
* copy zip file to <code>/wildfly/</code> (from Wildfly 11 installation)
* unzip file
unzip wildfly-19.1.0.Final.zip // creates directory wildfly-19.1.0.Final
* enable remote access to Wildfly by editing /wildfly/wildfly-19.1.0.Final/standalone/configuration/standalone.xml and replace (save old version to standalone.xml_20190609):
<interface name="management">
  <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
</interface>
<interface name="public">
  <inet-address value="${jboss.bind.address:0.0.0.0}"/>
</interface>
with
<interface name="management">
  <any-address/>
</interface>
<interface name="public">
  <any-address/>
</interface>
* enable remote CLI access by adding native interface configuration to /wildfly/wildfly-19.1.0.Final/standalone/configuration/standalone.xml
// add to <socket-binding-group name="standard-sockets" ...
<socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
// add to <management-interfaces>
<native-interface security-realm="ManagementRealm">
  <socket-binding native="management-native"/>
</native-interface>
* because of experience with Wildfly 11 (see /var/log/syslog) copy /wildfly/wildfly-19.1.0.Final/bin/standalone.conf to standalone.conf_20200609 and edited to:
  -Xmx256m (from Xmx512m)
* to make jsp work
cd /wildfly/wildfly-19.1.0.Final/standalone
chmod -R 777 tmp
* add management user by
../bin/add-user.sh
Management User uweheuer <Lj>Halloo0@1<Lj> no groups
* add Ajp Configuration -> Web- > Server -> default-server -> view -> Listener -> AJP Listener -> add -> 'ajp' 'ajp'
* activate audit.log by changing <code><audit-log></code> section to enabled
<logger log-boot="true" log-read-only="false" enabled="true">
=====UweHeuer app preparation=====
* install MySQL JDBC driver (Connector/J) (according to [https://docs.wildfly.org/19.1/Admin_Guide.html#DataSource official documentation for JDBC Driver installation]
** download platform independent Connector/J version 5.1.44 from [https://dev.mysql.com/downloads/connector/j/ here] (more actual version throw a timezone error during connection test)
** extract it
** open Admin console -> Deployments -> Upload Deployment and select mysql-connector-java-5.1.44-bin.jar for upload
* create data directory (see [[RaspberryPi3B#UweHeuer|here]]) and copy latest version from Wildfly 11
* create datasources
** mySQLDS [[:File:RaspberryMySQLConfigurationUweHeuer.pdf]]
Name: MySQLDS
JNDI Name: java:jboss/datasources/MySQLDS
Connection URL: jdbc:mysql://localhost/mysql506?autoReconnect=true
Driver Name: mysql-connector-java-5.1.44-bin.jar_com.mysql.jdbc.Driver_5_1
*** set JTA to false
** mySQLDS_QA ([[:File:RaspberryMySQL506QAConfiguration.pdf|see screenshots]])
*** set JTA to false
** UwesWikiDS
* create uweheuer logger (set use parent handler to false)
** [[File:UweHeuerLoggerConfiguration1.PNG|400px]]
** [[File:UweHeuerLoggerConfiguration2.PNG|400px]]
** [[File:UweHeuerLoggerConfiguration3.PNG|400px]]
 
====Operation====
* [[JBoss#Logging_Configuration|logging]] in
cd /wildfly/wildfly-19.1.0.Final/standalone/log
* check server status
cd /wildfly/wildfly-19.1.0.Final/bin
./jboss-cli.sh -c --commands="read-attribute server-state"
* [http://192.168.178.35:8080/ Wildfly Home]
* [http://192.168.178.35:9990/console/index.html Wildfly Administration @ Local Network] (only with Firefox)
* [https://uweheuer.spdns.de/console Wildfly Administration @ SPDNS
cd /wildfly/wildfly-19.1.0.Final/bin
./standalone.sh &
disown
./jboss-cli.sh --connect command=:shutdown
 
===Wildfly 11 (obsolete)===
* create /wildfly directory and chmod 777
* create /wildfly directory and chmod 777
* copy wildfly-11.0.0.Final.zip to /wildfly
* copy wildfly-11.0.0.Final.zip to /wildfly
Line 175: Line 564:
  </interface>
  </interface>
* enable remote CLI access by adding native interface configuration to /wildfly/wildfly-11.0.0.Final/standalone/configuration/standalone.xml (save old version to standalone.xml_20171112)
* enable remote CLI access by adding native interface configuration to /wildfly/wildfly-11.0.0.Final/standalone/configuration/standalone.xml (save old version to standalone.xml_20171112)
* set Wildfly as a service by (there is a debian script in the doc directory and a [http://www.it-adviser.net/wildfly-installieren-und-als-dienst-ausfuehren/ description] in the internet, but it didn't work, so used the approach from [[HomePCNew#JBoss|HomePC New]]):
* set Wildfly as a service by (there is a debian script in the doc directory and a [http://www.it-adviser.net/wildfly-installieren-und-als-dienst-ausfuehren/ description] in the internet, but it didn't work, so the following approach from [[HomePCNew#JBoss|HomePC New]]) was used:
  create /etc/init.d/uweswildfly
  create /etc/init.d/uweswildflyuweswildfly
  sudo chmod 755 /etc/init.d/uweswildfly
  sudo chmod 755 /etc/init.d/uweswildfly
  sudo update-rc.d uweswildfly defaults // log goes to /var/log/uwes.log
  sudo update-rc.d uweswildfly defaults // log goes to /var/log/uwes.log
* because of termination of java by operating system (see /var/log/syslog) for a test edited /wildfly/wildfly-11.0.0.Final/bin/standalone.conf:
  -Xmx256m (from Xmx512m)
* to make jsp work
cd /wildfly/wildfly-11.0.0.Final/standalone
chmod -R 777 tmp
* enable ajp communication to Apache2 by Web admin -> Configuration -> Subsystems -> Web/HTTP - Untertow -> Http -> View -> default server -> View -> AJP Listeners -> Add 'ajp' 'ajp'
* enable ajp communication to Apache2 by Web admin -> Configuration -> Subsystems -> Web/HTTP - Untertow -> Http -> View -> default server -> View -> AJP Listeners -> Add 'ajp' 'ajp'
 
* deployments gets extracted to (vfs stands for virtual file system)
/home/uwe/raspberry_root/wildfly/wildfly-11.0.0.Final/standalone/tmp/vfs/temp


====Manual Operation====
====Manual Operation====
* cd /wildfly/wildfly-11.0.0.Final/bin
* cd <code>/wildfly/wildfly-11.0.0.Final/bin</code>
* start server by
* start server by [[RaspberryPi3B#Reboot|reboot]] or by
  ./standalone.sh &
  ./standalone.sh &
disown
* stop server by  
* stop server by  
  ./jboss-cli.sh --connect command=:shutdown
  ./jboss-cli.sh --connect command=:shutdown
Line 204: Line 600:
  user = uwe.heuer@gmail.com
  user = uwe.heuer@gmail.com
  password = Halloo0@1
  password = Halloo0@1
Increased maximum upload file size by editing PHP.INI.


==Operation==
==Operation==


====Free Diskspace====
===Login===
from Ubunut:
ssh root@192.168.178.35
from Windows:
WinSCP
 
===Show Free Diskspace===
  df -h
  df -h


====Ports====
===Ports===
  netstat -tulnp
  netstat -tulnp


====Analyze Network Access====
===Analyze Network Access===
From http://www.lug-erding.de/artikel/nts.html:
From http://www.lug-erding.de/artikel/nts.html:
  telnet <IP|Domain> 80
  telnet <IP|Domain> 80
GET / HTTP/1.1
  <ENTER>
  <ENTER>
  HEAD / HTTP/1.0
  Host: <Domain>
  <ENTER>
  <ENTER><ENTER>
If  
If  
  Trying <IP>
  Trying <IP>
Line 225: Line 630:
then TCP is fine and errors are located in higher layers. If
then TCP is fine and errors are located in higher layers. If
  Connection refused
  Connection refused
then probably no one listening at port or firewall.
then probably no one listening at port or firewall otherwise see answer.
  ping -c <NumberOfPings> -s <Size>
  ping -c <NumberOfPings> -s <Size>
If size is e.g. 4000 pakets have to fragmented which could give hints for the error.
If size is e.g. 4000 pakets have to fragmented which could give hints for the error.
Line 232: Line 637:
DNS problems could be checked
DNS problems could be checked
  nslookup <Domain>
  nslookup <Domain>
Detailled analysis via
tcpdump


====Reboot====
===Reboot===
  sudo reboot
  sudo reboot


====Shutdown====
or [https://uweheuer.spdns.de/reboot.html via browser] implemented by reboot.html and reb.php and adding to /etc/sudoers:
www-data ALL=(root) NOPASSWD: /sbin/reboot
 
===Shutdown===
  sudo shutdown -h 0
  sudo shutdown -h 0


====Update====
===Update===
  sudo apt-get update
  sudo apt-get update // will update package list
sudo apt-get dist-upgrade


Error corrected according to [https://rolfje.wordpress.com/2017/06/09/installing-gpg-keys-for-debian-backports/ here]
Error corrected according to [https://rolfje.wordpress.com/2017/06/09/installing-gpg-keys-for-debian-backports/ here]


====Version====
===Version===
  cat /etc/os-release
  cat /etc/os-release
  PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
  PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"

Latest revision as of 10:33, 17 November 2025

Specification[edit]

  • package bought at amazon
  • Quad Core 1.2GHz Broadcom BCM2837 64bit CPU
  • 1GB RAM
  • BCM43438 wireless LAN and Bluetooth Low Energy (BLE) on board
  • 40-pin extended GPIO
  • 4 USB 2 ports
  • 4 Pole stereo output and composite video port
  • Full size HDMI
  • CSI camera port for connecting a Raspberry Pi camera
  • DSI display port for connecting a Raspberry Pi touchscreen display
  • Micro SD port for loading your operating system and storing data
  • Upgraded switched Micro USB power source up to 2.5A
  • 16GB Micro SD card

OS-Version[edit]

cat /etc/os-release // lists version 8
// kernel
uname -a // lists Linux raspberrypi 4.9.35...

Configuration[edit]

LAN[edit]

  • 192.168.178.35 for LAN

WLAN and Bluetooth switch off[edit]

  • old WLAN IP was 192.168.178.34
  • copy /boot/config.txt to /boot/config_2019-08-18.txt
  • add lines below to /boot/config.txt
# added by UH 2019-08-18 for disabling WLAN and Bluetooth
dtoverlay=pi3-disable-wifi
dtoverlay=pi3-disable-bt
  • reboot after change first time

Shared Public Directory[edit]

SSH[edit]

  • configuration is in /etc/ssh/sshd_config
  • all logins are documented in /var/log/auth.log
// the following entries are created by the local cron job and not critical
Aug 13 08:09:02 raspberrypi CRON[29805]: pam_unix(cron:session): session opened for user root by (uid=0)
Aug 13 08:09:02 raspberrypi CRON[29805]: pam_unix(cron:session): session closed for user root
  • SSH credentials (e.g. for WinSCP or Putty) for user=pi pwd=Halloo0@1 (old raspberry)
  • enable SSH access for root with pwd Halloo0@1 by
sudo su
passwd Halloo0@1
// edit /etc/ssh/sshd_config
// decommend PermitRootLogin without-password
// add PermitRootLogin yes
sudo service ssh restart
  • to just enable root for ssh
copy /etc/ssh/sshd_config to /etc/ssh/sshd_config_2019-08-18
add to ssh_config
   # added by UH 2019-18-08 10:05
   AllowUsers root
restart service by 
   sudo service ssh restart
  • cmd line access via fritzbox by
ssh root@uweheuer.spdns.de -p 54444
  • or use WinSCP

SD Card[edit]

  • SD Card is file /dev/mmcblk0 and mmcblk0p[1-7] are the partitions, see them
fdisk /dev/mmcblk0
p
q

Timezone[edit]

set to Berlin by:

sudo timedatectl set-timezone Europe/Berlin

check with

timedatectl

USB stick 1[edit]

  • pluged-in 64GB USB stick -> USB stick is sda1 (see lsblk)
  • windows partition table changed to Linux according to here
  • format USB stick to ext4 filesystem by
umount /dev/sda1
mkfs.ext4 /dev/sda1 -L USBSTICK
  • mount the USB stick by
cd /media
mkdir usbstick
mount /dev/sda1 /media/usbstick
  • make the mount permanent by
nano -Bw /etc/fstab
add line /dev/sda1 /media/usbdisk auto defaults,user 0 1

USB stick 2[edit]

  • pluged-in 128GB USB stick for backup of raspberry -> USB stick device is sdb, partition is sdb1 (see output of tail -f /var/log/messages)
  • the stick is formatted with FAT filesystem and is changed to ext4 by:
fdisk /dev/sdb
d
n + p
w
reboot
mkfs.ext4 /dev/sdb1 -L USBSTICK2
  • mount it
cd /media
mkdir usbstick2
mount /dev/sda1 /media/usbstick2
  • and for mounting it permanently add the following line /etc/fstab
/dev/sdb1 /media/usbstick2 auto defaults,user 0 1

Fritz NAS[edit]

  • mount the USB disk of the Fritz.Box
cd /media
mkdir fritzNAS

User[edit]

  • pi <Lr><STANDARD><Lr>

Software[edit]

Apache[edit]

Installation[edit]

  • verion 2.4 installed by
sudo apt-get install apache2
chmod 777 /var/www/html
  • to setup Apache as reverse proxy for Wildfly
sudo a2enmod proxy_ajp 
  • creates proxy.conf, proxy.load and proxy_ajp.load in /etc/apache2/mods-enabled

Configuration[edit]

Site Configuration[edit]
  • /etc/apache2/sites-enabled/* are links to /etc/apache2/sites-available
  • for forwarding to Raspberry 4B in 000-default-le-ssl.conf
ProxyPass /fwdtest http://192.168.178.72
ProxyPassReverse /fwdtest http://192.168.178.72
Logging[edit]
  • see /var/log/apache2

Operation[edit]

  • restart
sudo /etc/init.d/apache2 restart or
service apache2 restart
  • find out version
apache2ctl -v // -> Apache 2.4
  • stop service
sudo service apache2 stop
  • log goes to
/var/log/apache2

Backup by RaspiBackup[edit]

Installation[edit]

  • installation according to here as user root
curl -sSLO https://www.linux-tips-and-tricks.de/raspiBackupInstall.sh && sudo bash raspiBackupInstall.sh
EN
N (normal mode)
RSYNC (backup type)
5 (number of backups)
Y (verbose message)

installs raspiBackup.sh and raspiBackupInstall.sh to /usr/local/bin and raspiBackup.conf to /usr/local/etc.

  • changed in /usr/local/etc/raspiBackup.conf to
DEFAULT_BACKUPPATH="/media/usbstick2/raspibackup"

Operation[edit]

  • open termminal
  • call backup by
/usr/local/bin# ./raspiBackup.sh -a : -o : -m detailed -P
  • map HomePC backup directory as described in here
  • copy latest backup to ../backup/raspberry/raspibackup/ by
/media/usbstick2/raspibackup/raspberrypi# cp -r raspberrypi-rsync-backup-<DATETIME>/ /media/ubunturoot/backup/raspberry/raspberrybackup/

Mediawiki[edit]

  • download mediawiki-1.25.1.tar.gz and copy it to /tmp
  • extract it by
tar -xzf mediawiki-1.25.1.tar.gz
  • rename directory mediawiki-1.25.1 to mediawiki by
mv mediawiki-1.25.1 mediawiki
  • move directory to the html directory by
 mv /tmp/mediawiki /var/www/html/mediawiki
$wgGroupPermissions['*']['read'] = false;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['createaccount'] = false;
  • install ImageMagick for picture rendering by
sudo apt-get update
sudo apt-get install imagemagick
  • copy C:\Uwes\Programme\xampp\htdocs\mediawiki-1.16.0\images to /var/www/html/mediawiki/images
  • set images folder permissions right by
sudo chown -R www-data:www-data images/
sudo chmod -R 755 images/
  • prabably forget to describe DB copy from EON laptop to Raspberry

Backup[edit]

DB Backup[edit]
  • start xampp on laptop and start Apache and MySQL (works also on ZBook)
  • call (database mediawiki_raspberry3b to be there)
C:\Uwes\owncloud\batches\Raspberry3BMediawikiToLocalhost.bat // will update DB mediawiki_raspberry3b and document date in C:\temp text file
mysqldump --single-transaction -h localhost -u root -p  mediawiki > /media/ubunturoot/backup/raspberry/mediawiki/mediawiki_<YYYY-MM-DD>.txt
Enter password:
Directory Backup[edit]
  • on Raspberry
    • to Ubuntu (if it is switched on)
tar zcvhf /media/ubunturoot/backup/raspberry/mediawiki/mediawiki_<YYYY-MM-DD>.tgz /var/www/html/mediawiki
    • to local disc
tar zcvhf /backup/mediawiki/mediawiki_<YYYY-MM-DD>.tgz /var/www/html/mediawiki
tar zcvhf /backup/mediawiki/mediawiki_2022-06-29.tgz /var/www/html/mediawiki
      • copy it to Raspberry 4 /home/uwe/backup/Raspberry3B/MediaWiki via WinSCP
      • copy tgz file to external discs
      • copy tgz file to C:\Uwes\owncloud\backups\raspberry3B\Mediawiki via WinSCP

Upgrade from 1.25 to 1.33[edit]

  • install version 1.33
    • download the latest release (1.33) from here to laptop and copy it to raspberry /tmp directory
    • extract gz file in /tmp by
tar -xvzf mediawiki-1.33.0.tar.gz
    • move extracted directory to /var/www/html
mv mediawiki-1.33.0/ /var/www/html/
    • delete downloaded gz-file
    • copy images from 1.25 installation
 cp -a /backup/2019-08-27_mediawiki/images/* /var/www/html/mediawiki/images/
    • copy LocalSettings.php from 1.25 installation
cp ../mediawiki/LocalSettings.php .
    • edit LocalSettings.php (because of errors of the update script
      • decomment wfLoadSkin except Vector
      • decomment ConfirmEdit extension
    • disable PHP5 and enable PHP7.2
    • run the update script by
cd maintenance
php update.php

Install Msupload extension to enable Drag & Drop[edit]

Install MS Upload Extension[edit]

  • download and follow instructions from here

MySQL[edit]

  • install by
sudo apt-get install mysql-server php5-mysql mysql-client
root root
  • decomment in /etc/mysql/my.cnf
#bind-address		= 127.0.0.1
  • login with local client
mysql -u root -p

Backup[edit]

mysqldump --all-databases --single-transaction -h localhost -u root -p > /media/ubunturoot/backup/raspberry/mysql/DB_<YYYY-MM-DD>.txt

OwnCloud[edit]

Settings[edit]

Operation[edit]

  • make occ executable
root@raspberrypi:/var/www/html/owncloud# sudo chmod +x occ
  • test occ
root@raspberrypi:/var/www/html/owncloud# sudo -u www-data ./occ
  • scan filesystem and update DB
root@raspberrypi:/var/www/html/owncloud# sudo -u www-data ./occ files:scan --all

Installation[edit]

ownCloud installed according to here:

apt-get install apache2 php5 php5-gd php-xml-parser php5-intl
apt-get install php5-sqlite php5-mysql smbclient curl libcurl3 php5-curl
usermod -a -G www-data www-data
  • download owncloud-10.0.3.tar.bz2
cd /var/www/html
tar xfj /home/pi/owncloud-10.0.2.tar.bz2
chown -R www-data:www-data /var/www/html
service apache2 restart
  • call <IP>/owncloud, admin user uwe.heuer@gmail.com Halloo0@1, DB root root owncloud localhost:3306
  • change data directory according to here by
mkdir /media/usbstick/owncloud/data
chown -R www-data:www-data /media/usbstick/owncloud/data
apachectl -k stop
rsync -avz /var/www/html/owncloud/data /media/usbstick/owncloud/
mv data data_obsolete
ln -s /media/usbstick/owncloud/data/ /var/www/html/owncloud/data
apachectl -k graceful
  • to make owncloud accessible via uweheuer domain added to /var/www/html/owncloud/config/config.php in trusted domains
 'trusted_domains' => 
 array (
   0 => '192.168.178.35',
   1 => 'uweheuer.spdns.de',
 )
  • to make it accessible only via SSL see '000-default.conf' and '000-default-le-ssl.conf' in /etc/apache2/sites-enabled/
  • to correct inconsistent database and filesystem
:/var/www/html/owncloud# sudo -u www-data php occ files:scan --all

Contacts[edit]

Calendar[edit]

Upgrade[edit]

  • user (right top corner) -> settings
  • admin area (left area) -> General -> Scroll down to Updater
  • install apps again

Backup[edit]

Backup Files[edit]
  • create /backup/BackupOwncloudFiles.sh with
    • cd /media/usbstick/owncloud/data/uwe.heuer@gmail.com/files
    • zip -rFS -P "<STANDARD>" /media/usbstick/backup/owncloud/owncloud_backup.zip .
  • zipping every night by sudo crontab -e
  • file will be fetched from Raspberry 4 and copied to Google drive (see here)
config directory[edit]
DB backup[edit]

created /media/ubunturoot permanently

  • start Ubuntu HomePC (via fritz.box or WOL)
  • login (as root) to Raspberry e.g. by Putty from Windows or Ubuntu
  • mount directory for backup by
sudo mount -t cifs -o username=uwe //192.168.178.202/shareroot /media/ubunturoot/
<ROOT_PWD>
  • change to Owncloud directory by
cd /var/www/html/owncloud/
  • backup DB by
mysqldump --single-transaction -h localhost -u root -p  owncloud > /media/ubunturoot/backup/raspberry/owncloud/owncloud_<YYYY-MM-DD>.txt
Enter password:
  • unmount directory by
umount /media/ubunturoot
Data Backup[edit]

PHP[edit]

PHP5[edit]

  • installed via OwnCloud installation. Is is not clear which ini-file is used:
./etc/php5/cli/php.ini
./etc/php5/apache2/php.ini // this one is used according phpinfo()
  • increased max file upload size for Wordpress by setting
upload_max_filesize = 4M // before 2M
service apache2 restart

PHP7.2[edit]

  • installation according to here
sudo apt update
sudo apt install php7.2
sudo apt install php7.2 php7.2-cli php7.2-cgi php7.2-common php7.2-curl php7.2-gd php7.2-json php7.2-mbstring php7.2-mysql php7.2-opcache php7.2-readline php7.2-xml libapache2-mod-php7.2
  • and in order to make Owncloud work with 7.2
apt-get install php7.2-intl
apt-get install php7.2-zip
service apache2 restart
apt-get install php7.2-bcmath
service apache2 restart
  • ini-files:
./etc/php/7.2/cli/php.ini
./etc/php/7.2/apache2/php.ini // this one is used according phpinfo()
  • switch to PHP7.2 (PHP5 remains installed)
a2dismod php5
a2enmod php7.2
service apache2 restart

PHPMyAdmin[edit]

  • installed by
apt-get install phpmyadmin
root root
  • add to /etc/apache2/apache2.conf at the end (marked by UH)
Include /etc/phpmyadmin/apache.conf
  • changed URL in /etc/phpmyadmin/apache.conf by
Alias /phpxmyadmin /usr/share/phpmyadmin 
  • restart apache

SSL[edit]

Obsolete installation via Backports Packages[edit]

  • edit /etc/apt/sources.list and add
deb http://ftp.debian.org/debian jessie-backports main
  • backports are recompiled packages from testing and unstable in a stable environment so that they will run without new libraries
  • update
apt-get update
  • install via Certbot, a script to install and update Let´s Encrypt SSL-certificats
sudo apt-get install python-certbot-apache
sudo apt-get install certbot -t jessie-backports
sudo certbot --apache
uweheuer.goip.de uwe.heuer@gmail.com
  • creates among others /etc/letsencrypt

Upgrade Cerbot from Homepage[edit]

  • goto Certbot Homepage and select 'Apache' and 'Debian 8 (jessie)' and follow instructions
sudo apt-get remove certbot
wget https://dl.eff.org/certbot-auto
sudo mv certbot-auto /usr/local/bin/certbot-auto
sudo chown root /usr/local/bin/certbot-auto
sudo chmod 0755 /usr/local/bin/certbot-auto
  • certbot-auto accepts the same flags as certbot
  • decommented the backports entry in /etc/apt/sources.list
sudo apt-get update
  • then continue with Certbot configuration
sudo /usr/local/bin/certbot-auto --apache -d uweheuer.spdns.de
sudo /usr/local/bin/certbot-auto -d bbx0axbhewglhzf4.myfritz.net
sudo /usr/local/bin/certbot-auto --apache delete --cert-name uweheuer.goip.de
// this also edits /etc/apache2/sites-enabled/000-default-le-ssl.conf
  • after Fritzbox 7490 to Fritzbox 7590
./certbot-auto -d uweheuer.spdns.de --cert-name 36jjbpz29h1pyywz.myfritz.net
sudo /usr/local/bin/certbot-auto delete --cert-name bbx0axbhewglhzf4.myfritz.net
replace in /etc/apache2/sites-enabled/000-default-le-ssl.conf bbx0axbhewglhzf4 with 36jjbpz29h1pyywz
  • edit file /etc/cron.d/certbot and decomment old entry from obsolete installation and add
0 0,12 * * * python -c 'import random; import time; time.sleep(random.random() * 3600)' && /usr/local/bin/certbot-auto renew
Manual renew of SSL certificates[edit]
  • login as root@raspberrypi with <STANDARD>:
cd /usr/local/bin 
./certbot-auto renew // this might take very long if an update is needed, obviously requires reboot for JBoss to work properly
  • easiest is to reboot and than restart Wildfly (Wildfly is not startet automatically after reboot)

TCPDump[edit]

  • sudo apt-get install tcpdump

UweHeuer[edit]

  • create database mysql505 with PHPMyAdmin
  • export and import database
  • create /wildfly/wildfly-11.0.0.Final/standalone/data/uweheuer
  • copy abc.tmp and /wildfly/wildfly-11.0.0.Final/standalone/data
  • download mysql-connector-java-5.1.44-bin.jar from MySQL site
  • deploy it via the Wildfly admin console
  • create datasources via Web admin console with
MySQLDS (see File:RaspberryMySQL505Configuration.pdf)
jdbc:mysql://localhost/mysql505?autoReconnect=true
root root
...
UwesWikiDS
...
ProxyPass /uweheuer ajp://localhost:8009/uweheuer
ProxyPassReverse /uweheuer http://localhost/uweheuer
ProxyPass /uweheuer_qa ajp://localhost:8009/uweheuer_qa
ProxyPassReverse /uweheuer_qa http://localhost/uweheuer_qa
  • /etc/apache2/sites-available/000-default.conf permanent redirect to SSL
RedirectMatch ^/$ https://uweheuer.spdns.de/wordpress
Redirect /uweheuer https://uweheuer.spdns.de/uweheuer
Redirect /uweheuerqs https://uweheuer.spdns.de/uweheuerqs
Redirect /owncloud https://uweheuer.spdns.de/owncloud
  • create /myprogs and copy DisAndEnableUweHeuer.bat
  • Wildfly logger configuratoin according to here
  • after deployment uweheuer.war is probably extracted to (vfs stands for virtual file system)
/home/uwe/raspberry_root/wildfly/wildfly-11.0.0.Final/standalone/tmp/vfs/temp

Backup August 2025[edit]

  • C:\Uwes\owncloud\batches\Raspberry3BBookmarksToCTemp.bat Window cmd batch (not Powershell) to copy DB content for uweheuer to C:\temp

Backup[edit]

  • on laptop (xampp must be running)
    • create DB mysql506
    • run script
C:\Uwes\Batches\RaspberryBookmarksToLocalhost.bat
    • rename DB with date extension
  • on Raspberry map ubunturoot
mysqldump --single-transaction -h localhost -u root -p  mysql506 > /media/ubunturoot/backup/raspberry/uweheuer/mysql506_<YYYY-MM-DD>.txt
Enter password:
    • copy /wildfly/wildfly-19.1.0.Final/data/uweheuer/abc.tmp|Configuration.properties to /media/ubunturoot/backup/raspberry/uweheuer/
    • copy files to external discs

Wildfly 19.1[edit]

Installation[edit]

unzip wildfly-19.1.0.Final.zip // creates directory wildfly-19.1.0.Final
  • enable remote access to Wildfly by editing /wildfly/wildfly-19.1.0.Final/standalone/configuration/standalone.xml and replace (save old version to standalone.xml_20190609):
<interface name="management">
  <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
</interface>
<interface name="public">
  <inet-address value="${jboss.bind.address:0.0.0.0}"/>
</interface>
with
<interface name="management">
  <any-address/>
</interface>
<interface name="public">
  <any-address/>
</interface>
  • enable remote CLI access by adding native interface configuration to /wildfly/wildfly-19.1.0.Final/standalone/configuration/standalone.xml
// add to <socket-binding-group name="standard-sockets" ...
<socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
// add to <management-interfaces>
<native-interface security-realm="ManagementRealm">
  <socket-binding native="management-native"/>
</native-interface>
  • because of experience with Wildfly 11 (see /var/log/syslog) copy /wildfly/wildfly-19.1.0.Final/bin/standalone.conf to standalone.conf_20200609 and edited to:
 -Xmx256m (from Xmx512m)
  • to make jsp work
cd /wildfly/wildfly-19.1.0.Final/standalone
chmod -R 777 tmp
  • add management user by
../bin/add-user.sh
Management User uweheuer <Lj>Halloo0@1<Lj> no groups
  • add Ajp Configuration -> Web- > Server -> default-server -> view -> Listener -> AJP Listener -> add -> 'ajp' 'ajp'
  • activate audit.log by changing <audit-log> section to enabled
<logger log-boot="true" log-read-only="false" enabled="true">
UweHeuer app preparation[edit]
Name: MySQLDS
JNDI Name: java:jboss/datasources/MySQLDS
Connection URL: jdbc:mysql://localhost/mysql506?autoReconnect=true
Driver Name: mysql-connector-java-5.1.44-bin.jar_com.mysql.jdbc.Driver_5_1
  • create uweheuer logger (set use parent handler to false)

Operation[edit]

cd /wildfly/wildfly-19.1.0.Final/standalone/log
  • check server status
cd /wildfly/wildfly-19.1.0.Final/bin
./jboss-cli.sh -c --commands="read-attribute server-state"
cd /wildfly/wildfly-19.1.0.Final/bin
./standalone.sh &
disown
./jboss-cli.sh --connect command=:shutdown

Wildfly 11 (obsolete)[edit]

  • create /wildfly directory and chmod 777
  • copy wildfly-11.0.0.Final.zip to /wildfly
  • unzip
  • enable remote access to Wildfly by editing /wildfly/wildfly-11.0.0.Final/standalone/configuration/standalone.xml and replace (save old version to standalone.xml_20171110):
<interface name="management">
  <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
</interface>
<interface name="public">
  <inet-address value="${jboss.bind.address:0.0.0.0}"/>
</interface>
with
<interface name="management">
  <any-address/>
</interface>
<interface name="public">
  <any-address/>
</interface>
  • enable remote CLI access by adding native interface configuration to /wildfly/wildfly-11.0.0.Final/standalone/configuration/standalone.xml (save old version to standalone.xml_20171112)
  • set Wildfly as a service by (there is a debian script in the doc directory and a description in the internet, but it didn't work, so the following approach from HomePC New) was used:
create /etc/init.d/uweswildflyuweswildfly
sudo chmod 755 /etc/init.d/uweswildfly
sudo update-rc.d uweswildfly defaults // log goes to /var/log/uwes.log
  • because of termination of java by operating system (see /var/log/syslog) for a test edited /wildfly/wildfly-11.0.0.Final/bin/standalone.conf:
 -Xmx256m (from Xmx512m)
  • to make jsp work
cd /wildfly/wildfly-11.0.0.Final/standalone
chmod -R 777 tmp
  • enable ajp communication to Apache2 by Web admin -> Configuration -> Subsystems -> Web/HTTP - Untertow -> Http -> View -> default server -> View -> AJP Listeners -> Add 'ajp' 'ajp'
  • deployments gets extracted to (vfs stands for virtual file system)
/home/uwe/raspberry_root/wildfly/wildfly-11.0.0.Final/standalone/tmp/vfs/temp

Manual Operation[edit]

  • cd /wildfly/wildfly-11.0.0.Final/bin
  • start server by reboot or by
./standalone.sh &
disown
  • stop server by
./jboss-cli.sh --connect command=:shutdown
  • restart server by
./jboss-cli.sh --connect command=:reload
  • get server status by
./jboss-cli.sh -c --commands="read-attribute server-state"

Wordpress[edit]

Installation[edit]

cd /var/wwww/html
wget https://wordpress.org/latest.zip
unzip latest.zip
sudo chown -R www-data:www-data wordpress
user = uwe.heuer@gmail.com
password = Halloo0@1

Increased maximum upload file size by editing PHP.INI.

Operation[edit]

Login[edit]

from Ubunut:

ssh root@192.168.178.35

from Windows:

WinSCP

Show Free Diskspace[edit]

df -h

Ports[edit]

netstat -tulnp

Analyze Network Access[edit]

From http://www.lug-erding.de/artikel/nts.html:

telnet <IP|Domain> 80
GET / HTTP/1.1
<ENTER>
Host: <Domain>
<ENTER><ENTER>

If

Trying <IP>

then name resolution works and if

Connected to <IP|Domain>

then TCP is fine and errors are located in higher layers. If

Connection refused

then probably no one listening at port or firewall otherwise see answer.

ping -c <NumberOfPings> -s <Size>

If size is e.g. 4000 pakets have to fragmented which could give hints for the error.

traceroute -n <IP> // Linux
tracert <IP> // Windows

DNS problems could be checked

nslookup <Domain>

Detailled analysis via

tcpdump

Reboot[edit]

sudo reboot

or via browser implemented by reboot.html and reb.php and adding to /etc/sudoers:

www-data ALL=(root) NOPASSWD: /sbin/reboot

Shutdown[edit]

sudo shutdown -h 0

Update[edit]

sudo apt-get update // will update package list
sudo apt-get dist-upgrade

Error corrected according to here

Version[edit]

cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"