How To Raspberry Pi

How to: Beginners guide to setup a website on Raspberry Pi

A Raspberry Pi

The Raspberry Pi is a tiny and affordable computer that you can use to learn programming through fun, practical projects. Given it’s low cost the Raspberry Pi is also used by tech enthusiasts to do a myriad of cool and useful project. 

How to: Beginners guide to setup a website on Raspberry Pi 1
Raspberry Pi 3b+ – a pocket sized computer

In this step by step guide we look at setting up a website on a Raspberry Pi. 

This can be done using several methods but we’re going to use the LAMP stack to configure a locally hosted website.

LAMP is a collection (called stack) of open-source software that is used to setup a web server, it’s an acronym that stands for

How to: Beginners guide to setup a website on Raspberry Pi 2

L – Linux

A – Apache

M – MySQL

P – PHP


Step 1 – Update Raspberry Pi

Update the Raspberry Pi software by running the following commands in the terminal

sudo aptitude update && sudo aptitude upgrade && sudo aptitude dist-upgrade

Step 2 – Install LAMP 

Install the LAMP webserver components by running 

sudo aptitude install apache2 php7.0 mysql-server php-mysql -y

You can test the config by opening you browser and typing http://localhost as the address (as shown below)

How to: Beginners guide to setup a website on Raspberry Pi 3

This will load the default Apache index.html page (as shown below)

How to: Beginners guide to setup a website on Raspberry Pi 4

Step 3 – Download WordPress

Next we download the WordPress application 

sudo wget http://wordpress.org/latest.tar.gz

Unzip the tar file

sudo tar xzf latest.tar.gz

Move the extracted folder to the /var/www/

sudo mv wordpress /var/www/wordpress

Step 4 – Configure webroot

We first delete the existing html folder containing apache files and rename the wordpress folder to html

sudo rm -rf html
sudo mv wordpress html

Configure file ownerships

sudo chown -R www-data:www-data html

Step 5 – Configure MySQL

Start the MySQL configuration 

sudo mysql_secure_installation

You will be asked:

Enter current password for root (enter for none):

Press Enter

Set root password?

Type Y and then press Enter
Then type in the new password for your MySQL database, and do the following when prompted

Remove Anonymous Users – Type Y
Disallow root login remotely – Type Y
Remove test database and access to it – Type Y
Reload privilege tables now – Type Y

We now will create a WordPress database

Login in to MySQL

sudo mysql -u root -p

Enter the MySQL Root password you created earlier (this is not your Raspberry Pi account password)

You will get a prompt “Welcome to the MariaDB monitor”

How to: Beginners guide to setup a website on Raspberry Pi 5

Now create a database 

create database wordpress;

Ensure everything is in lowercase and note the semi-colon.

Grant priviledges,

GRANT ALL PRIVILEGES ON wordpress.* TO 'root'@'localhost' IDENTIFIED BY 'YOURPASSWORD';

You need to replace ‘YOURPASSWORD’ with the password that you created for MySQL root user earlier.
Now flush and apply the priviledges, note the spelling of “privileges” below.

FLUSH PRIVILEGES;

Type exit and press enter to exit MariaDB

Step 6 – Configure WordPress

Open your browser and type http://localhost to open the WordPress configuration, first it will ask for language selection

How to: Beginners guide to setup a website on Raspberry Pi 6

Select the language you want to setup your website in and press continue, for this example we’re assuming you selected English (United States), this will bring up the welcome screen. Click on let’s go

How to: Beginners guide to setup a website on Raspberry Pi 7

Now fill up the following details when asked for

How to: Beginners guide to setup a website on Raspberry Pi 8

Replace “username” and “password” with the database username (“root”) and the password that was created earlier

Click “Submit”  and then “Run the Install”

Fill up the login details and click on “Install WordPress”

How to: Beginners guide to setup a website on Raspberry Pi 9

Now type http://localhost/admin in the browser to access the WordPress admin area to make changes.

How to: Beginners guide to setup a website on Raspberry Pi 10

That’s it!

The default wordpress theme and Hello Word page can be opened by typing http://localhost in the browser.


ALSO READ  Use Serveo.net to access your Raspberry Pi from internet

11 comments

buy/order vicodin 5mg 10mg online pharmacy no script legally cheap for pain anxiety weight loss in USA Canada UK Australia overseas overnight delivery September 15, 2020 at 4:26 am

… [Trackback]

[…] Find More here on that Topic: techrad.io/how-to/57/how-to-beginners-guide-to-setup-a-website-on-raspberry-pi-step-by-step/ […]

Reply
mo thay nguoi chet danh so gi September 16, 2020 at 7:07 am

… [Trackback]

[…] Find More on to that Topic: techrad.io/how-to/57/how-to-beginners-guide-to-setup-a-website-on-raspberry-pi-step-by-step/ […]

Reply
buy oxycontin online no script use for pain anxiety overnight delivery September 16, 2020 at 8:14 am

… [Trackback]

[…] Here you can find 85813 more Information to that Topic: techrad.io/how-to/57/how-to-beginners-guide-to-setup-a-website-on-raspberry-pi-step-by-step/ […]

Reply
rx pharmacy October 4, 2020 at 6:49 pm

Hi Dear, are you actually visiting this web site daily, if so
after that you will absolutely obtain good experience. rx
pharmacy https://pharmaciescegs.com/ pharmacy online

Reply
generic viagra without a doctor prescription October 5, 2020 at 12:31 am

generic viagra without a doctor prescription https://edabcrx.com/ order viagra online

Reply
viagra without a doctor prescription canada October 5, 2020 at 2:32 am

viagra without a doctor prescription canada https://usggrxmed.com/ online
viagra prescription

Reply
generic name for viagra October 5, 2020 at 2:46 am

generic name for viagra https://abcrxmed.com/ canadian viagra

Reply
best over the counter viagra October 5, 2020 at 3:50 am

best over the counter viagra https://pillexrx.com/ viagra canada

Reply
online viagra canadian pharmacy online October 5, 2020 at 4:37 am

online viagra canadian pharmacy online https://fmedrx.com/ us pharmacy
viagra online

Reply
Davidser October 24, 2020 at 2:24 am

generic viagra approved by fda genericviagra2o medicine shoppe generic viagra.

Reply
Davidser October 25, 2020 at 2:24 am

safest place to buy generic viagra online generic viagra price comparison buy generic viagra from uk.

Reply

Leave a Comment