Make the ‘ll’ file.
sudo nano /bin/ll
It should looks like this:
#!/bin/bash ls -lha $1 $2
Chmod:
sudo chmod 755 /bin/ll]]>
sudo apt-get update sudo apt-get install samba samba-common-bin
sudo mkdir -m 1777 /data
sudo nano /etc/samba/smb.conf
Add this in the last line:
[data] comment = Data share path = /data browseable = yes read only = no
sudo reboot
sudo smbpasswd -a root sudo smbpasswd -a pi
\\192.168.0.31\data]]>
sudo apt-get install ntfs-3g
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
sudo mkdir -m 1777 /data
sudo mount -w -o uid=pi,gid=pi /dev/sda1 /data
ls -lha /data
Unmount USB-HDD
sudo umount /dev/sda1
sudo apt-get install ntfs-3g
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
cd ~/wp nano robots.txt
The contents of the file shoult look like this:
User-agent: * Allow: / Sitemap: http://rckcw.iptime.org/sitemap.xml
Change owner of file:
sudo chown www-data:www-data robots.txt]]>
sudo nano /etc/dhcpcd.conf
interface eth0 static ip_address=192.168.0.31/24 static routers=192.168.0.1 static domain_name_servers=192.168.0.1
IP: 192.168.0.31
Gateway: 192.168.0.1
sudo reboot]]>
sudo mysql -uroot -p[rootpassword] mysql
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;
flush privileges;
show databases;
]]>
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
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
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/
sudo apt-get update
sudo apt-get install mysql-server mysql-client
PHP7.0 user
sudo apt-get install php7.0-mysql
Raspberry pi reboot:
sudo reboot
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
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
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]]>