Joomla installeren op een Raspberry Pi
Материал из Joomla! Documentation
This article or section is incomplete, which means it may be lacking information. You are welcome to assist in its completion by editing it as well. If this article or section has not been edited in several days, please consider helping complete the content.
This article was last edited by FuzzyBot (talk| contribs) 5 months ago. (Purge)
Note: Work-in-progress. This document is not yet ready & fully tested. Please wait with translation until it is finished. Thanks!
The Raspberry Pi is a small single-board computer that was originally developed to promote the teaching of basic computer science in schools and developing countries. Because of its versatility it has become very popular and is used as media player, small stand-alone server, etc. You can use it as webserver and install Joomla! on it. This page shows you how to get a your Joomla! website running on the Raspberry Pi.
- Rasberry Pi version 3 Model B — There are various models of Raspberry Pi. You can use most models that have an Ethernet port (the Model B types). However for performance we will use the latest version with most RAM memory.
- micro SD card — For the operating system + webserver + Joomla. (RPi version 3 model B uses micro SD other versions might use normal SD cards)
- 5 Volt adapter (1 Amp) — to power the Raspberry Pi you’ll need to convert the mains power (230V or 110V) to 5 Volt. The Rasperry Pi needs about 1 Amp, and maybe more if you connect USB devices to it.
- standard Ethernet cable — to connect the RPi to your Local Area Network / router / the internet.
Het Installeren Van Het Besturingssysteem
The operating system Raspbian is a Debian Linux version specially compiled for the Raspberry Pi. There are two versions of Raspbian available: Raspbian Jessie with Pixel Lite (version with PIXEL desktop based on Debian Jessie) and Raspbian Jessie Lite (minimal version based on Debian Jessie). Because we use the Raspberry Pi as webserver for Joomla, we won’t need the GUI.
Download Raspbian Jessie Lite and unzip the downloaded file, e.g. 2016-09-23-raspbian-jessie-lite.zip (306 MB) to 2016-09-23-raspbian-jessie-lite.img (1.4 GB).
Now we need to copy the .img file to the (micro) SD card. You can use a tool with graphical interface like UNetbootin (for Windows, Mac OS X and Linux) or do it on the command line).
Be very careful when writing the .img disk image to another disk. In case you use the wrong destination disk, you will overwrite that disk with the .img which makes that disk unusable, resulting in data loss.
In a terminal (CMD) check which device corresponds with the SD Card and do something like:
Check which device is used for your SD Card. In our case it’s disk1s1 and we’ll do in Terminal:
We connect a SD Card reader with the (micro) SD Card to a computer. With dmesg we can find the device name of the SD Card. In our case dmesg shows something like
meaning that we have a SD Card with 2 partitions. Do not write the Raspbian image to a partition but to the whole disk sdd.
We will use dd («Disk Dump») to write an Input File (if) to an Output File (of) using a specified Block Size (bs).
Be VERY careful: dd will write to a device without any warning. Triple double check that that you write to the right device! If you write to the wrong disk, then you’ll always remember the dd command as «Disk Destroyer».
WARNING for raspbian stretch version : to have a ssh server working from boot you need to create an empty file ssh on the root partition.
Connecting Raspberry Pi to LAN
When we have installed the Raspbian Operating System on the SD Card, we will:
- Insert the micro SD card in the SD Card slot on the Raspberry Pi.
- Connect an an Ethernet cable to the Raspberry Pi and to the Local Area Network (connect it to our router).
- Connect the 5V power supply to the the Raspberry Pi.
Booting up the Raspberry Pi takes roughly 30 seconds. We’ve to find the IP address to connect to it using SSH. We can use different approaches for that:
- log into the webinterface of your router and look up the connected devices;
- use a mobile phone connected the Wifi router using a network scanning App called Fing Overlook;
- use a command like nmap. Assuming that our PC has IP address 192.168.0.25 we can find all other devices in the same network range by doing the following:
Which might show the following details:
To log into our Raspberry Pi, we’ll use the command ssh.
The first time you’ll connect to it, it will show something like:
and use the default password: raspberry which on successful login will show:
We can configure the Raspberry Pi using a text interface via:
Raspberry Pi Software Configuration Tool (raspi-config)
With this configuration tool we’ll only change the following settings.
1 Expand Filesystem
By default the disk space on the SD Card is the same size as the 1.4GB .img file that you used to create the SD card for your Raspberry Pi. You can use this option to gain the rest of the disk space.
2 Change User Password
For security reasons it’s best to change the default password «raspberry» as soon as possible.
3 Boot Options
We would like the Raspberry Pi to boot the Text console
B2 Console Autologin Text console, automatically logged in as ‘pi’ user
9 Advanced Options
A3 Memory Split
Because we will use the Raspberry Pi as a headless server without connecting it to a monitor, we can decrease the memory used for the GPU from 64 to 16
5 Internationalisation Options
I2 Wijzigen Van De Tijdzone
We’ll change the Timezone to our own time zone (e.g. Europe/Amsterdam)
After all changes we’ll Reboot the Raspberry Pi, and will login again with our new password.
Now it’s time to install everything else.
Before installing anything else, we’ll:
- update the list of software versions from all external repositories
Updating the version list and upgrading all software is something that should be done regularly.
A fast and lightweight alternative for Apache web server is the increasingly becoming popular Nginx web server.
Installation of Nginx
We will install nginx and all dependencies (read: software that nginx needs to work) with
By choosing «y» nginx and all needed packages will be installed.
You can check the installation with a browser. Go to the IP address of your Raspberry pi, in our case http://192.168.0.35/ We should see a message like:
Starting and stopping Nginx
Na de installatie zal Nginx automatisch worden gestart. U kunt:
- Stop Nginx: sudo service nginx stop
- Start Nginx: sudo service nginx start
- Restart Nginx: sudo service nginx restart
Global Nginx configuration
In the global configuration of Nginx we can configure default caching etc. The Raspberry Pi 3 uses 1.2 GHz 64-bit quad-core ARM Cortex-A53 processor. If you have an earlier version with less CPU cores, then you should use
to change the «worker_processes» to fit the amount of CPUs of your device. By default it’s configured as
so for Raspberry Pi 3 you don’t have to change it.
After changing the Nginx configuration or virtual domain configuration, you have to do a
to make the changes effective.
It’s possible to run multiple Joomla websites on the same server using virtual domains.
Put every website in a separate folder in the default webroot /var/www/ for example:
For every site we will create a virtual domain which is basically a text file with domain specific information:
We need to enable every site by linking from /etc/nginx/sites-enabled/ to the virtual domain in «sites-available». We create a symbolic link for each virtual domain:
To make this virtual domain configuration effective, we do
and when everything has been configured correctly it will respond:
We can install MariaDB or MySQL; Joomla will work with both. Let’s install MariaDB with:
During the installation you’ve to add a password for the root user. Lets create a database password, for example correcthorsebatterystaple.
Finally let’s improve the security of our MariaDB installation by removing root accounts that are accessible from outside the local host, anonymous-user accounts and the test database. We can do that with
For PHP we will install the php-fpm (FastCGI Process Manager) that runs as a daemon and receives Fast/CGI requests. Furthermore we will install php5-mysql which is a module for MySQL database connections directly from PHP scripts.
more recent php7 should be installed with
Now we need to let Nginx know that it should use php-fpm for .php files. We add a couple of lines to our virtual domains:
Test it by creating the following PHP file
We use a browser to test if we see the PHP configuration page at http://192.168.0.35/example.com/test.php
Connecting Raspberry Pi to Internet
We want people on the internet to be able to visit our Joomla website on our Raspberry Pi. In order to do that we need to configure our Internet router to forward all incoming traffic on port 80 to our Raspberry Pi.
Use your web browser to connect to the Web Interface of your router. A router is usually located on the first number of your IP range, in our case on 192.168.0.1. In our router we configure Port Forwarding:
- External IP Address: 0.0.0.0
- External Start Port: 80
- External End Port: 80
- Internal IP Address: 192.168.0.35 ( = our Raspberry Pi)
- Internal Start Port: 80
- Internal End Port: 80
- Protocol: TCP
Make sure that it is enabled.
If everything is working correctly then you should see your own Joomla website on the Raspberry Pi by visiting your external IP address (Find your external IP address with a tool like whatsmyip.org).
Het gebruik van een domeinnaam
Let’s assume that our external IP address is 184.108.40.206. Let’s also assume that we have registered a domain name called example.com. We would like to serve our Joomla site on our Raspberry Pi to visitors visiting example.com. If your domain name registrar gives us the possibility to configure the Domain Name System (DNS) server, then we’ll need to create an MX record in the DNS that points our domain name to our IP address 220.127.116.11. Note that it can take up to 24 hours till all internet providers will redirect the traffic of their customers to the configured MX record.
Most routers will keep assigning the same internal IP address to your Raspberry Pi. Sometimes it’s better to configure your Raspberry Pi to use a static IP address:
The gateway is the IP address of your router. You can also find it using
Preamble Page Still Under Development
Joomla! 3.4.5 is the latest incarnation of the open source CMS (Content Management System).
Joomla! is an award-winning CMS, which enables you to build Web sites and powerful online applications. Many aspects, including its ease-of-use and extensibility, have made Joomla! the most popular Web site software available. Best of all, Joomla is an open source solution that is freely available to everyone. What’s a content management system (CMS)?
A content management system is software that keeps track of every piece of content on your Web site, much like your local public library keeps track of books and stores them. Content can be simple text, photos, music, video, documents, or just about anything you can think of. A major advantage of using a CMS is that it requires almost no technical skill or knowledge to manage. Since the CMS manages all your content, you don’t have to.
List of things you require minimum
- 4G Class4 SD Card (others will do but you do not actually need anything better than this)
- Power for your RPi
- A setup network connection to your router (Wireless or RJ45 10BaseT)
- A Computer with a connection to the internet (for getting software) preferably via the same router as the RPi
Software (note only Windows and Linux recommendations I just don’t know Mac options)
- A copy of Joomla! 2.5 available here | Joomla! Download page
- A copy of a free ssh client (recommend putty) | Putty download page.
- A copy of a free FTP client (recommend CoreFTP LE or Filezilla)(not essential but useful if you are not running from a Linux Computer)
- Some means of imaging your SD Card (Win32DiskImager or dd)(Note I use Win32DiskImager)
- Wheezy 2012-12-16
- LAMP install (instructions further down this page)
- php5 extensions for MySQL (instructions further down this page)
- vsftpd (not essential but useful if you are not running from a Linux Computer)
- something to unzip the Joomla! download (it’s a standard zip file so WinZip or Zip7 or WinRar take your pick)
Joomla! is built on a LAMP Server and while installing this is available on another page it is copied here to save you jumping around pages.
LAMP is an acronym that stands for LinuxApacheMySQLPHP these are the components required to run a Dynamic HTML webpage and these are the first steps to build a LAMP webserver on a RaspberryPi.
If all you want to run is a basic webpage then the update and apache2 is all you need to install.
However to have a copy of Joomla! to play with you do need MySQL and PHP5 you will also find it easier to migrate Joomla! if you have an FTP server running and using Putty to log into the RPi with ssh to set things up.
I recommend the FTP server vsftpd (there’s a faf setting this up but I will guide you through this).
Please do not be complacent — most of this stuff will need quite a bit of setting up but these installs will put the software in place and the default setting files ready to edit.
There’s voices on the forum said I was opening up a «world of pain» for the noobs when I suggested LAMP ; I will be interested in the noob viewpoint post on the forum.
I would say «Caveat Emptor» but then it’s all free so is supect it’s just «Caveat»
Image The latest Wheezy (Currently 2012-12-16 then run and sort raspi-config as per your prefrences don’t setup automatic start GUI also don’t disable ssh if you are going to folow my method.
Remember if you get lost in this and give up re-image your SD Card and you can use it for whatever project you move on to.
I have built the project on a 4 Gig Class 4 Sandisk SD card obviouslyif you want to persue this to a bigger project then obviously a bigger card is an option and it may work on a 2Gig but thats a project for later.
Install Steps Post Raspi-config
figure out the IP of theRPi assigned by DHCP put that IP address into your browser LAMP achieved
Ok there’s a bunch of editing to get the FTP working (but it does) it fit’s on a 2GB SD card and I don’t think you will get a lot of web space forJoomla! stick it on a 4GB give yourself some room.
In addition I have not got a fixed IP sorted so I can port forward with confidence and there should be room to get a No-ip patch running I run NO-IP .com on a full Ubuntu server elaswhere on my router the aim of this setup is not to run Joomla! on the RPi in anger but to run it to learn how to setup a Joomla! site.
Nearly forgot Win32DiskImage read to create a new image file so you don’t need to do it all again.
Here is an explination for our Noob readers.
I hope you know that this is about preparing your SD card for the coming events 4GB Class4 will do, 8GB better if you plan building a big site.
This is primarily about making all of the SD card available (resizing thing) there’s a wiki page of its own on this step.
login:pi password:raspberry #unless you have changed it
Yes if you changed the password when you were in raspi-config you will need to use that new password
Make yourself root the super user for the duration of this session.
Get the updates for the install program some of the later installs won’t happen if you do not do this.
Install the web host software Apache current version is 2
Install a version of PHP current version is 5
At this point you have a LAMP install LinuxApacheMySQLPHP but to be fair you need some other stuff to help
This is a couple of chunks of install that allow php to interact with MySQL
Change Directory to /var/www Note the slash direction, the leading slash and the space after cd
Start the text editor pico (Alternatives vi and nano my personal pref is nano but instructions follow for pico)
do a bit of editing to personalise the file index.html in the www directory by default this is the automatically added test page for Apache2. If you type some new stuff in here then when you load the page from a browser you will know you have the right page and it’s worked because you will see the text you added.
execute command as Picard would say «Make it so»
What to do next
Well now you are going to need to grab a couple of tools that are going to make your life easier.
Your going to need a ssh client for Windows and Linux I reccomend Putty theres some eqivilent for the MAC I suppose I will have to look this up later if someone knows before can you add that edit here.
As for FTP (File Transfer Protocol)Windows use either CoreFTP LE (FTP client) free for home use or Filezilla if you are using Linux you do not need an FTP instalation stick your SD card into a card reader in your Linux computer and when the time comes use a drag and drop copy to the Joomla! stuff to the apropreate folder.
I (personally) have found it easier for this project to run my Raspberry Headless (No monitor,keyboard,mouse) and logged in remotely using Putty. This means I can do everything from one screen one keyboard one mouse. I am using a WiFi connection but it works just as well with a wired ethernet.
Now you need to figure out the IP of the RPi assigned by DHCP. If you have a HDMI or Composite monitor it’s on one of the last lines as you boot; if you have come to this page because you completed the blind login you will know the IP as it’s the address you typed into Putty.
Now when it comes to setting up and using putty and the ssh link to your RPi there is a lot more information on using Putty on this page RPi A Method for ssh blind login.
Type that IP address into your browser. Note, it must be on a computer attached digitally or physically to the same router as your RaspberryPi as this is your intranet, not the internet — that slight change in spelling implies you are inside the router barrier and it’s hardware fierewall if it has one.
In addition I have got fixed IP sorted so I can port forward with confidence and there should be room to get a No-ip patch running.
My No-IP runs on my big (Lauughs out loud 80GB) Ubuntu server.
Port forwarding is something very Router/Hub specific but if you do manage it then your LAMP and your Joomla! instalation will shine on the Internet
It is unlikely to be bright at this time but shine it will. However this is about getting a Joomla! instalation to learn Joomla! not as a final solution.
Ok there is some editing of Linux files to get the FTP working (but it does I got it working with FileZilla and with CoreFTP LE )actually using FTP to transfer files between the PC and the Raspberry has an issue in that there is no root login you access the root (super user using the sudo function)but all you do is upload to the /home/pi folder and move the stuff around either by logging in with ssh or by booting the pi to command line.
You need to locate the config file for vsftpd this is located in /etc folder in your RaspberryPi file structure the file you need to edit is the vsftpd.conf file the default file has 34 different settings you can change nearly all with impunity nearly all of this editing consists of removing the hash mark (#) from the start of the line changing the line from a comment to something that is active. if you screw up then do the following.
and you arde back to the original vsftpd.conf original setup.
vsftpd which stands for «Very Secure FTP Daemon» it largely sets up as anonymous FTP to allow anonymous connections to download from your FTP Server.
But as our aim is to upload from ourselves inside our router space we need to change vsftpd so we can upload.
I know if I work through the vsftpd.conf so that I end up with these lines as shown without the leading #
Then I am able to use CoreFTP from my PC to login
The Site name is something you choose and just becomes a shortcut label for the saved settings
Obviously use the IP address your router has given to your RPi
Password raspberry (unless you have changed it)
Your core window should look something like this
You can drag and drop or highlight and use the blue arrow to instagate the transfer.
Upload and move Joomla
Now this is all well and good but you now need something to upload, namely the Joomla! installation. There is a link at the top of the page at and this time I have only tested this with the stable 2.5 version and I do not intend looking at version 3.0 till it is considered stable.
NOTE 3.4.x is the current stable release. 2.5 is now end of life, obsolete, as of the end of 2014. Current version 3.4.5 can be downloaded from the official GitHub repo: https://github.com/joomla/joomla-cms/releases/download/3.4.5/Joomla_3.4.5-Stable-Full_Package.zip
UNTESTED: Upload the zip to your RPi, then unpack it. Unzip the Joomla! download zip on your PC, then FTP it onto your RPi.
This may take a while depending on your network and PC speed.
The given method means your copy ends up in/home/pi probably best as a folder named joomla keep it lower case for now it makes life easier.
Note the following is my method.
Make a Backup
Nearly forgot shut down. Take out your SD card and use Win32DiskImage read to create a new image file REMEMBER GIVE IT A NEW NAME so you don’t need to do it all again
The following sections need to be added and written up.