Finaly, here is very simple guide how to run CentOS 7 on Raspberry Pi2 🙂 enjoy & have a good time with it. This is the very first part of setting up home monitoring machine for other production servers, which I have. First tutorial is only setting up raspberry running in default mode, with http server and some tweaks.
And of course, all of steps will be soon available as installable automated bash script, as well as fully automated script bundle built for raspberry.
All what we need is:
The default settings for the image are :
The first what we need is to create SD card with operating system. There is a lot of ways, for windows, linux or OSX. If you are using windows, there is the best to use GUI utility called win32disimager (direct link to sourceforge), in Linux and OSX, there is system utility called „dd“.
For the very first step, we need to have sd card formated into fat32. we can do it with one simple command:
mkfs.fat32 /dev/sdb1
You can find which device you need with this command:
fdisk /dev/sd*
after formatting the card, we can continue with copying files onto sd card. In the best, we can use dd with this command:
dd if=/tmp/CentOS-Userland-7-armv7hl-Minimal-1511-RaspberryPi2.img of=/dev/sdb1
After you have created your first bootable sd card, you need to do first configure.
while CentOS 7 have support of armv7 cpu’s, there is no doubt that system will run as well, but in fact, the whole system isn’t ready for raspberry out of the box, so we need to do some steps. Depending on the SD card size you used, you probably want to expand the RootFS (/) to the maximum capacity of the underlying SD card. For your convenience, there is utility called rootfs-resize tool, packaged as rpm and also available through the Extras repository for armv7hl.
In the short – we need to setup chronyd, resize partitions on sd card and switch selinux to the right status. All what you need to do is follow these few command:
yum install chrony
systemctl start chronyd
/etc/sysconfig/selinux : change from "permissive" to "enforcing"
/boot/extlinux/extlinux.conf : change the "enforce=0" to "enforce=1"
touch /.autorelabel
touch /.rootfs-repartition
systemctl reboot
Your board will reboot, load kernel/initrd, expand the partition, resize it and reboot. Another reboot will evoke chronyd synchro and system apply changes in selinux. Once done, you’ll be using your whole SD card.
yum -y update
yum -y install httpd
Allow the default HTTP and HTTPS port, ports 80 and 443, through firewalld:
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=443/tcp
And reload the firewall:
firewall-cmd --reload
ServerName localhost:80
And then start Apache:
sudo systemctl start httpd
Be sure that Apache starts at boot:
sudo systemctl enable httpd
if all goes well, we will see this page:
Tento web používá k poskytování služeb, personalizaci a anláze návštěvnosti soubory Cookie. Více informací
Cookie je krátký textový soubor, který navštívená webová stránka odešle do prohlížeče. Umožňuje webu zaznamenat informace o vaší návštěvě, například preferovaný jazyk a další nastavení. Příští návštěva stránek tak může být snazší a produktivnější. Soubory cookie jsou důležité. Bez nich by procházení webu bylo mnohem složitější. Soubory cookie slouží k celé řadě účelů. Používáme je například k ukládání vašich nastavení bezpečného vyhledávání, k výběru relevantních reklam, ke sledování počtu návštěvníků na stránce, k usnadnění registrace nových služeb a k ochraně vašich dat.
No comments yet, be first!