Install WordPress on raspberry

Login with putty

Go to the directory where you want to install wordpress.

cd /var/recepten.van-daag.nl
sudo chown pi: .
rm *
wget http://wordpress.org/latest.tar.gz
tar xzf latest.tar.gz
mv wordpress/* .
rm -rf wordpress latest.tar.gz

Now login into MySQL and create database and user.

mysql -uroot -p[Password]
create database recepten;

GRANT ALL PRIVILEGES ON `recepten`.* TO `recepten_user`@`localhost` IDENTIFIED BY '[Password]';

Type Ctrl +D to close

Now browse to the website and run the setup.

Create Subdomains on your raspberry

Login on your raspberry with putty

Create a subdirectory

 sudo mkdir -p /var/www/recepten.van-daag.nl

Create a new apache config

sudo cp -a /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/recepten.van-daag.nl.conf

Edit the config

sudo nano /etc/apache2/sites-available/recepten.van-daag.nl

Change/add this text.

 ServerAdmin webmaster@localhost
 ServerName recepten.van-daag.nl
 DocumentRoot /var/www/recepten.van-daag.nl

 

Now activate the config

sudo a2ensite recepten.van-daag.nl

Reload the service

sudo service apache2 reload

 

Install FTP on your Raspberry

Run update

sudo apt-get update

Install ftp

sudo apt-get install vsftpd

You get a message about disk usage enter Yes

Now open up the config file by entering the following command:

sudo nano /etc/vsftpd.conf

In here add or uncomment(Remove the #) for the following settings.

anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
chroot_local_user=YES

Restart ftp server

sudo service vsftpd restart

And now you can connect with filezilla to the raspberry with SFTP (port 22)

Install webserver on Raspberry Pi

Download Raspbian
Place it on SD card
Start the raspberry.

Login with: pi (root)
Password: raspberry

Type sudo raspi-config to start the config.

Change the password
Change the Hostname
Change Localisation Options -> Change Timezone to Europe, Amsterdam
Change Interfacing Options -> Enable SSH
Update the Raspberry

Exit menu
Reboot the raspberry sudo reboot

Open putty and connect to the raspberry and login

Install Apache webserver on your Raspberry

sudo apt-get install apache2 -y

Install PHP

sudo apt-get install php5 libapache2-mod-php5 -y

13-03-2018
sudo apt-get install libapache2-mod-php

Install Mysql

sudo apt-get install mysql-server php5-mysql -y

You get a message to enter MySQL root password. Enter this password and Reenter the password in the next screen

Secure your MySQL

sudo mysql_secure_installation

and enter the MySQL root password

You get the message to change the password. Type No

Now you get some questions. Answer is Yes