{"id":25711,"date":"2018-04-13T02:38:26","date_gmt":"2018-04-13T07:38:26","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=25711"},"modified":"2022-06-03T03:35:08","modified_gmt":"2022-06-03T08:35:08","slug":"how-to-install-joomla-3-on-centos-7","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-install-joomla-3-on-centos-7\/","title":{"rendered":"How to Install Joomla 3 on CentOS 7"},"content":{"rendered":"
In this post we will show you how to install Joomla 3 on CentOS 7, with MariaDB 10.2, PHP-FPM 7.1 and Nginx. Joomla is an award-winning content management system (CMS) for publishing web content and online apps. Joomla is one of the most popular CMSs and it is used all over the world to power millions of websites and applications of all shapes and sizes. Joomla is a free and open-source, php-based CMS system with wide range of features for publishing content. This guide should work on other RedHat-based systems as well but was tested and written for an CentOS 7 VPS<\/a>. The process of installing Joomla 3 on CentOS 7 is fairly easy and it shouldn’t take more then 10 minutes.<\/p>\n <\/p>\n sudo yum update<\/p>\n sudo yum install yum-utils unzip wget<\/p>\n If you already have MySQL or MariaDB installed you can skip this step and move to the next section.<\/p>\n To add the MariaDB repository and install the latest MariaDB server, create an new file under and add the folowing lines:<\/p>\n Once the repo file is created you can install MariaDB with the following command:<\/p>\n During the installation YUM will prompt you to install the MariaDB GPG Signing key.<\/p>\n When the installation is complete, run the following command to secure your installation:<\/p>\n Create a new database and user for the Joomla installation using the following commands:<\/p>\n If you don’t have Nginx installed on your server, you can install the latest stable version from the official Nginx repositories:<\/p>\n First, create an new file under and add the following configuration:<\/p>\n Once you enable the Nginx repository you can proceed and install Nginx using the following command:<\/p>\n Next, create a new Nginx server block:<\/p>\n Test the Nginx configuration and restart nginx:<\/p>\n PHP version 7.1 is not available in the default CentOS 7 repositories so we will use the Remi repository.<\/p>\n To install and enable both EPEL and Remi repositories run the following command:<\/p>\n You can now proceed and install PHP 7.1 and all necessary PHP modules using the following commands:<\/p>\n During the installation YUM will prompt you to install the Remi GPG Signing key.<\/p>\n Once the installation you’ll need to open the PHP FPM poll configuration file and change the user from apache to nginx:<\/p>\n and fix the session and cache directories permissions:<\/p>\n Finally, restart the PHP FPM service with:<\/p>\n Installing Joomla is pretty easy and straightforward, first download the Joomla zip archive from the Joomla download page:<\/p>\n Once the download is completed, unzip the archive and move the extracted files to the Finally change the ownership of the Open That\u2019s it. You have successfully installed Joomla on CentOS 7. For more information about how to manage your Joomla installation, please refer to the official Joomla documentation.<\/a><\/p>\nPrerequisites<\/h3>\n
\n
1. Update the system and install requeired packages<\/h3>\n
2. Install MariaDB 10.2<\/h3>\n
\/etc\/yum.repos.d\/<\/code>:<\/p>\n
sudo nano \/etc\/yum.repos.d\/MariaDB.repo<\/pre>\n
[mariadb]\r\nname = MariaDB\r\nbaseurl = http:\/\/yum.mariadb.org\/10.2\/centos7-amd64\r\ngpgkey=https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB\r\ngpgcheck=1\r\n<\/pre>\n
sudo yum install MariaDB-server MariaDB-client<\/pre>\n
3. Secure MariaDB<\/h3>\n
mysql_secure_installation<\/pre>\n
4. Create new database<\/h3>\n
mysql -uroot -p<\/pre>\n
MariaDB [(none)]> CREATE DATABASE joomla;\r\nMariaDB [(none)]> GRANT ALL PRIVILEGES ON joomla.* TO 'joomla'@'localhost' IDENTIFIED BY 'strongpassword';\r\nMariaDB [(none)]> FLUSH PRIVILEGES;\r\nMariaDB [(none)]> \\q<\/pre>\n
5. Install and configure Nginx<\/h3>\n
\/etc\/yum.repos.d\/<\/code>:<\/p>\n
sudo nano\/etc\/yum.repos.d\/nginx.repo<\/pre>\n
[nginx]\r\nname=nginx repo\r\nbaseurl=http:\/\/nginx.org\/packages\/centos\/$releasever\/$basearch\/\r\ngpgcheck=0\r\nenabled=1<\/pre>\n
sudo yum install nginx<\/pre>\n
sudo nano \/etc\/nginx\/conf.d\/my.joomla.site<\/pre>\n
server {\r\n listen 80;\r\n server_name my.joomla.site;\r\n root \/var\/www\/my.joomla.site;\r\n\r\n index index.html index.htm index.php;\r\n\r\n charset utf-8;\r\n\r\n access_log \/var\/log\/nginx\/my.joomla.site.access.log;\r\n error_log \/var\/log\/nginx\/my.joomla.site.error.log info;\r\n\r\n location \/ {\r\n try_files $uri $uri\/ \/index.php?$args;\r\n }\r\n\r\n location ~* \/(images|cache|media|logs|tmp)\/.*\\.(php|pl|py|jsp|asp|sh|cgi)$ {\r\n return 403;\r\n error_page 403 \/403_error.html;\r\n }\r\n\r\n location = \/favicon.ico { access_log off; log_not_found off; }\r\n location = \/robots.txt { access_log off; log_not_found off; }\r\n\r\n error_page 404 \/index.php;\r\n\r\n location ~ \\.php$ {\r\n fastcgi_pass 127.0.0.1:9000;\r\n fastcgi_index index.php;\r\n include fastcgi_params;\r\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\r\n }\r\n\r\n location ~ \/\\.(?!well-known).* {\r\n deny all;\r\n }\r\n}<\/pre>\n
sudo nginx -t\r\nsudo systemctl restart nginx.service<\/pre>\n
6. Install PHP 7.1<\/h3>\n
sudo yum install epel-release\r\nsudo rpm -Uhv https:\/\/rpms.remirepo.net\/enterprise\/remi-release-7.rpm\r\nsudo yum-config-manager --enable remi-php71<\/pre>\n
sudo yum install php-fpm php-cli php-gd php-opcache php-mysqlnd php-json php-mcrypt php-xml php-curl<\/pre>\n
sudo nano \/etc\/php-fpm.d\/www.conf<\/pre>\n
user = nginx\r\ngroup = nginx<\/pre>\n
chown -R root:nginx \/var\/lib\/php\/*<\/pre>\n
sudo systemctl restart php-fpm.service<\/pre>\n
7. Install Joomla 3 on CentOS 7<\/h3>\n
wget https:\/\/downloads.joomla.org\/us\/cms\/joomla3\/3-8-5\/Joomla_3-8-5-Stable-Full_Package.zip<\/pre>\n
\/var\/www\/my.joomla.site<\/code> directory, which will be the root directory of your new Joomla site:<\/p>\n
sudo mkdir -p \/var\/www\/my.joomla.site\r\nsudo unzip Joomla_3-8-5-Stable-Full_Package.zip -d \/var\/www\/my.joomla.site<\/pre>\n
\/var\/www\/my.joomla.site<\/code> directory to the\u00a0
nginx<\/code>\u00a0user:<\/p>\n
sudo chown -R nginx: \/var\/www\/my.joomla.site<\/pre>\n
8. Complete the installation via web browser installer<\/h3>\n
http:\/\/my.joomla.site\/<\/code> in your favorite web browser and follow the on-screen instructions to complete the Joomla installation.<\/p>\n
\n