SMB(samba) install on the raspbian jessie – RCK

Proceed as pi.

Installing Samba

sudo apt-get update
sudo apt-get install samba samba-common-bin

Creating a directory to share

sudo mkdir -m 1777 /data

Edit the Samba Configuration, smb.conf

sudo nano /etc/samba/smb.conf

Add this in the last line:

[data]
 comment = Data share
 path = /data
 browseable = yes
 read only = no

Reboot

sudo reboot

Creating samba users

sudo smbpasswd -a root
sudo smbpasswd -a pi

Windows network drive address

\\192.168.0.31\data

Mount USB-HDD on the raspbian jessie – RCK

Proceed as pi.

NTFS file system

sudo apt-get install ntfs-3g

Find location

sudo fdisk -l

result: /dev/sda1

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 137215 129024 63M c W95 FAT32 (LBA)
/dev/mmcblk0p2 137216 126613503 126476288 60.3G 83 Linux


Disk /dev/sda: 931.5 GiB, 1000204885504 bytes, 1953525167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x518c5f10

Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 1953521663 1953519616 931.5G 7 HPFS/NTFS/exFAT

Create target directory

sudo mkdir -m 1777 /data

Mount USB-HDD

sudo mount -w -o uid=pi,gid=pi /dev/sda1 /data

ls

ls -lha /data

Unmount USB-HDD

sudo umount /dev/sda1

Link: Mounting USB-HDD at boot.

Mounting USB-HDD at boot on the raspbian jessie – RCK

Proceed at pi.

NTFS file system

sudo apt-get install ntfs-3g

Modify the ‘rc.local’ file

sudo nano /etc/rc.local

It should looks like this:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
 printf "My IP address is %s\n" "$_IP"
fi

mount -w -o uid=pi,gid=pi /dev/sda1 /data &

exit 0

Reboot:

sudo reboot

 Link: Mount USB-HDD on the raspbian jessie

Add a user to MySQL – RCK

Proceed as pi.

MySQL server login.

sudo mysql -uroot -p[rootpassword] mysql

Add user ‘wp’ (Stepping line)

create user 'wp'@'%' identified by 'userpassword';

grant all privileges on wp.* to 'wp'@'%';

create user 'wp'@'localhost' identified by 'userpassword';
grant all privileges on wp.* to 'wp'@'localhost';

### Tip - delete user:
 drop user 'wp'@'%';
 drop user 'wp'@'localhost';
###

Create database ‘wp’

create database wp;

MySQL restart

flush privileges;

Confirmation database.

show databases;

 

Install WordPress on raspbian jessie – RCK

Proceed as pi.

Install WordPress

Download wordpress

cd /home/pi
wget https://wordpress.org/latest.zip

If it exists, delete the WordPress directory:

rm -rf wp

Unzip wordpress

unzip latest.zip
mv ./wordpress ./wp

Change owner to ‘www-data’

Nginx use the ‘www-data’ user and group.

sudo chown -R www-data:www-data wp

Granted to ‘pi’ user:

sudo chmod -R 775 wp
sudo usermod -a -G www-data pi

Group confirmation:

groups pi

result:

pi : pi adm dialout cdrom sudo audio www-data video plugdev games users input netdev spi i2c gpio

Raspberry pi reboot:

sudo reboot

Modify the ‘wp-config.php’ file

cd ~/wp
cp wp-config-sample.php wp-config.php
sudo chown www-data:www-data wp-config.php
nano wp-config.php

Please edit this section(database name, ID, password):

/** The name of the database for WordPress */
define('DB_NAME', 'wp');

/** MySQL database username */
define('DB_USER', 'wp');

/** MySQL database password */
define('DB_PASSWORD', 'database password');

Please connect the site in a browser

http://raspberry pi IP address/

Add a user to MySQL

Install PHP7.0 on raspbian jessie – RCK

Proceed as pi.

Add new repository sources

sudo nano /etc/apt/sources.list

Add the following two lines:

deb http://repozytorium.mati75.eu/raspbian jessie-backports main contrib non-free
#deb-src http://repozytorium.mati75.eu/raspbian jessie-backports main contrib non-free

Next we need to add a couple of certificates in order to allow us to use the sources with apt-get. Run the following two commands:

sudo gpg --keyserver pgpkeys.mit.edu --recv-key CCD91D6111A06851
sudo gpg --armor --export CCD91D6111A06851 | sudo apt-key add -

Update the package list:

sudo apt-get install dirmngr
sudo apt-get update

PHP7.0 install

sudo apt-get install php7.0 php7.0-curl php7.0-gd php7.0-imap php7.0-json  php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-xmlrpc php7.0-fpm

Connecting with nginx

sudo nano /etc/php/7.0/fpm/pool.d/www.conf

find the line

listen = /run/php/php7.0-fpm.sock

It should look like this:

listen = 127.0.0.1:9000

Reboot raspberry pi.

sudo reboot

Excute the function phpinfo()

cd /home/pi/wp
nano pi.php

The contents of the file shoult look like this.

<?php
phpinfo();
?>

Connect to the page to the browser.

http://[rasberry pi IP]/pi.php