RaspberryPi3B: Difference between revisions

From Wiki RB4
Line 127: Line 127:
* 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.goip.de/owncloud/remote.php/dav/addressbooks/users/uwe.heuer@gmail.com/contacts/
====Backup====
* create /media/ubunturoot permanently
* start Ubuntu HomePC
* mount directory
sudo mount -t cifs -o username=root //192.168.178.202/UBUNTU64_ROOT /media/ubunturoot/
<ROOT_PWD>


===PHPMyAdmin===
===PHPMyAdmin===

Revision as of 21:30, 21 February 2018

Specification

  • 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

Configuration

  • 192.168.178.34 for WLAN
  • 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
sudo su
passwd Halloo0@1
// edit /etc/ssh/sshd_config
// decommend PermitRootLogin without-password
// add PermitRootLogin yes
sudo service ssh restart
  • SD Card is file /dev/mmcblk0 and mmcblk0p[1-7] are the partitions, see them
fdisk /dev/mmcblk0
p
q

USB stick

  • pluged-in 64GB USB stick -> USB stick is sda1 (see lsblk)
  • 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

Fritz NAS

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

Software

Apache

  • 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
  • restart
sudo /etc/init.d/apache2 restart or
service apache2 restart
  • find out version
apache2ctl -v

Logging

  • see /var/log/apache2

Mediawiki

  • 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
  • change /var/www/html/mediawiki/LocalSettings.php
$wgServer = "http://uweheuer.goip.de";
$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
  • prabably forget to describe DB copy from EON laptop to Raspberry

MySQL

  • 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

OwnCloud

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 goip uweheuer domain added to /var/www/html/owncloud/config/config.php in trusted domains
 'trusted_domains' => 
 array (
   0 => '192.168.178.35',
   1 => 'uweheuer.goip.de',
 )
  • to make it accessible only via SSL added to /etc/apache2/sites-enabled/000-default.conf
Redirect /owncloud https://uweheuer.goip.de/owncloud

Backup

  • create /media/ubunturoot permanently
  • start Ubuntu HomePC
  • mount directory
sudo mount -t cifs -o username=root //192.168.178.202/UBUNTU64_ROOT /media/ubunturoot/
<ROOT_PWD>

PHPMyAdmin

  • 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
  • restart apache

SSL

  • edit /etc/apt/sources.list and add
deb http://ftp.debian.org/debian jessie-backports main
  • update
apt-get update
  • install
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

UweHeuer

  • 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
jdbc:mysql://localhost/mysql505?autoReconnect=true
root root
...
UwesWikiDS
...
  • after SSL setup added to /etc/apache2/sites-enabled/000-default-le-ssl.conf
ProxyPass /uweheuer ajp://localhost:8009/uweheuer
ProxyPassReverse /uweheuer http://localhost/uweheuer
  • /etc/apache2/000-default.conf permanent redirect to SSL
Redirect permanent /uweheuer https://uweheuer.goip.de/uweheuer
  • create /myprogs and copy DisAndEnableUweHeuer.bat
  • Wildfly logger configuratoin according to here

Wildfly

  • 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 used the approach from HomePC New):
create /etc/init.d/uweswildfly
sudo chmod 755 /etc/init.d/uweswildfly
sudo update-rc.d uweswildfly defaults // log goes to /var/log/uwes.log
  • enable ajp communication to Apache2 by Web admin -> Configuration -> Subsystems -> Web/HTTP - Untertow -> Http -> View -> default server -> View -> AJP Listeners -> Add 'ajp' 'ajp'


Manual Operation

  • cd /wildfly/wildfly-11.0.0.Final/bin
  • start server by
./standalone.sh &
  • 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

Installation

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


Plugins

UpdraftPlus - Backup/Restore
  • stores backup to Google Drive
Table of Contents Plus
  • automatically inserts a table of content if the number of headings is high

Operation

Show Free Diskspace

df -h

Ports

netstat -tulnp

Analyze Network Access

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

sudo reboot

Shutdown

sudo shutdown -h 0

Update

sudo apt-get update

Error corrected according to here

Version

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"