Blog

Upgrading from CentOS 6 to CentOS7? Here are some gotchas

CentOS 7 is out and if you’re like me, you’ve probably been working on yet another side project you want to bring online. In this short article I’m just writing down some gotchas I ran into when installing and configuring CentOS7 after having working with version 6 for some years.

Installing CentOS 7 via netinstall

I’m a fan of using the netinstall, which downloads the latest version of CentOS for you. All you need to do is download the netinstall ISO, hook it up to your Virtual Box drive and boot into the installer.

If you are just looking for the netinstall iso, click here to download the ISO from a Belgian mirror.

I’m sticking to this fine Belgian mirror for the installation source as well: http://mirror.myip.be/pub/centos/7/os/x86_64/

Installing a LAMP-stack

I assume you already know how to install CentOS using Virtual Box. If not, see this tutorial that sums it all up.

In CentOS 6, one would normally run a yum install php httpd mysql mysql-server to install all the required packages for setting up a LAMP-stack. Things have changed a little in CentOS 7.

MySQL is out, MariaDB is in

MySQL has been replaced with MariaDB which simply is a drop-in replacement for MySQL. As far as I know the large Linux repositories all moved over to MariaDB instead of MySQL because of the commercial and thus uncertain direction MySQL is heading. MariaDB is backwards-compatible with MySQL and fully open source. Want more details? Here you go buddy.

So don’t worry if you can’t find mysql in yum, just use mariadb instead and you’ll be fine.
Of course, make sure to run mysql_secure_installation after installing.

yum install httpd mariadb mariadb-server httpd php

systemd

In Centos6 (re)starting services like httpd on reboot was done by using init scripts. In Centos7, managing services is now under control of systemd.

Here are some shortcuts to get you started.

systemctl status httpd will show you whether the service (in this example httpd) is enabled (en will launch on reboot) or not. It will also show you if a service is active or inactive.

systemctl enable httpd will enable the service so that it will launch on reboot
systemctl disable httpd will disable the service
systemctl is-enabled httpd will show you whether a service is enabled or not

systemctl start httpd will start the service (without enabling it)
systemctl stop httpd will stop the service (without disabling it)
systemctl restart httpd will restart the service

systemctl list-unit-files—type=service shows all your services and corresponding statuses in a glimpse

If apache is running and your firewall isn’t blocking connections (iptables has been replaced with firewalld), you should now be able to surf to your server’s IP and see the apache test page.

Apache on Centos7

If you can’t surf to your server IP, stop firewalld for a minute or better, add the following rule to allow traffic on the http service:

firewall-cmd—zone=public—add-port=http/tcp—permanent

Restart firewalld after the command above to activate these changes and you should be all set.

Good luck penguins!

About the author

Hi there! I'm a freelancer who can help you build a great application or website - yes, also for mobile devices. If you speak Dutch, check out my eBooks.

Hire me, whether it's to help you build your next project or to organize a workshop. I teach about web design + development in college and I'd be happy to put a workshop together for you.

 
You might also like: