CentOS 7 is out, and it brings some much needed features for web developers! For starters, MySQL is replaced by MariaDB (much better performance for InnoDB, and a better client), and PHP is 5.4 out of the box. In addition, multitudes of tweaks have been made to the system, making it more responsive.
The following is a guide (with screenshots) for installing a basic LAMP stack with the new OS, on an empty machine (in this case, a virtual machine), using the NetInstall image (Minimal is not yet available, but being worked on).
Getting the image
First off, grab a copy of the image either via torrent or directly from a mirror:
http://mirror.centos.org/centos/7/isos/x86_64/CentOS-7.0-1406-x86_64-NetInstall.torrent http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7.0-1406-x86_64-NetInstall.iso
Starting up
First off, boot from the CD image, and you'll be greeted by the (marginally) more colorful boot screen
Selecting "Install CentOS 7" will take you to the language selection screen:
The defaults work just fine for the purposes of the tutorial, so we move forward to the summary screen.
Every task will bring you back here after you complete it, and after the minimum required tasks are completed you'll be allowed to begin the installation. Note that some tasks have issues and thus we are not allowed to begin the installation yet.
Network & Hostname
This is the most basic task for this kind of installation - if you mess something up here, every other task that follows will bring up errors that DON'T point to this. Quite counter-intuitive in my opinion, but it is what it is. Click on the task, and you'll see a list of interfaces, and be able to turn them On or Off, and configure them. In our case, we only have one interface
so I'll skip over to configuring it, starting with the general tab:
Moving on, there's a whole new DCB tab with advanced networking options…. which we won't be touching, but some of you might like to see
And over to the classic IPv4 tab - I won't go into details here since it hasn't changed at all since the previous versions. Once you're done save your changes.
Click "Done" (top left!?) to return to the summary screen.
Installation Source
Click on the "Installation Source" task next. Select the "On the network" radio, and use the address
http://mirror.centos.org/centos/7/os/x86_64/
Click "Done"
After the download finished (might take some time depending on network traffic).
Software Selection
This task should be now unlocked, and you can pick packages to be installed. Choose the "Basic Web Server" role, "MariaDB client" and "PHP Support" packages
Click "Done"
Installation Destination
Since we're not doing anything advanced, just click on the drive available (if you don't it is assumed you haven't selected anything) and let it automatically partition the system.
You should be now able to "Begin Installation"
Installation Progress
While the packages needed are being downloaded and installed, you will be seeing a screen similar to the image below
Where you can add a root password via the task on screen
Other than that, you can also add users, or just wait patiently until installation is done.
Result
You first need to open the HTTP port in your firewall for the next steps to work - that's a simple afair, just by typing
# firewall-cmd --permanent --add-service=http # firewall-cmd --reload
This will allow HTTP traffic, and save it to your permanent rules. Finally, in the second line, reload the firewall to use the new ruleset.
Navigating to the IP of the machine you should now see the (new) welcome screen of Apache
To test PHP, we'll just add a simple script to the default docroot by using the terminal:
# echo "<?php phpinfo();" > /var/www/html/is.php
and navigate to http://<your-ip>/si.php, where you should find the basic info about PHP
And this concludes this guide. If you find any issues, or things missing just let me know in the comments! I'll post another article soon about the (many) changes in how things work soon. Enjoy!