Install drupal 8 on CentOS 7.x
1. drupal 8.x requirements
TypeRequirementDatabase1.MySQL 5.5.3/MariaDB 5.5.20/Percona Server 5.5.8 or higher with PDO and an InnoDB-compatible primary storage engine,
2. PostgreSQL 9.1.2 or higher with PDO,
3. SQLite 3.6.8 or higherPHPPHP 5.5.9 or higher
Official requirement Link
2. Deploy LAMP (Linux + Apache + Mysql + PHP)
Update the system installation package (CentOS) [Option]
# yum update
Install Apache
# yum install httpd
Set apache to start [Option] by default
# systemctl start httpd# systemctl enable httpd
Apache browser access
Enter the URL in the browser and you will see the test page. Testing .......
Install MariaDB
# yum install mariadb-server mariadb
Set MariaDB to run automatically
# systemctl start mariadb# systemctl enable mariadb
Initialize MariaDB
# /usr/bin/mysql_secure_installation
[Reference: CentOS 7 install LAMP]
Install PHP
Drupal 8. x requires php to be 5.5.9 or above. The default centOS 7 is 5.4, And the 5.5 version is placed on webtatic [referrence]
Install extension package
# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
Install php packages
# yum install php55w php55w-opcache php55w-gd php55w-mbstring php55w-mysqlnd php55w-pdo php55w-opcache php55w-xml
The above is a required package for drupal:
TypeDescriptionPhp55w required, version 5.35php55w-cli required php55w-common required php55w-gd required, drupal 8 required php55w-mbstring required, drupal 8 required, unicode Character php55w-mysqlnd required, drupal 8 required, link mariadbphp55w-opcache required, cache php55w-pdo required, drupal 8 required, database php55w-xml requiredTest php installation
# php -vPHP 5.5.35 (cli) (built: May 1 2016 11:44:25)Copyright (c) 1997-2015 The PHP GroupZend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
Test apache
# Restart apache # systemctl restart httpd
3. Download and install drupal 8.x
Download
#1. wget downloads # wget https://ftp.drupal.org/files/projects/drupal-8.1.1.tar.gz## 2. decompress to apache # tar xvfz drupal-8.1.1.tar.gz-C/var/www/html ### 3. rename # cd/var/www/html # mv drupal-8.1.1 drupal #4. modify permissions # chown-R apache: apache/var/www/html/drupal/#5. copy the configuration file # cd/var/www/html/drupal/sites/default # cp-p default. settings. php settings. php
Create Database
# mysql -u root -p>create database drupal_db;>CREATE USER db_user@localhost IDENTIFIED BY 'Durpal@123#';>GRANT ALL PRIVILEGES ON drupal_db.* TO db_user@localhost;>FLUSH PRIVILEGES;>exit;
Open browser http://your.ip/drupal
[Referrence] 1. http://www.linuxtechi.com/how-to-install-drupal-8-on-centos-7 2. https://www.linode.com/docs/websites/cms/install-and-configure-drupal-8
FAQ:
Clean URL Configuration:
# Check whether apache has a rewrite_module # apachectl-M | grep rewrite> rewrite_module (shared) # Configure/etc/httpd/conf/httpd. conf # vim/etc/httpd/conf/httpd. conf ## Add at the end: loadModule rewrite_module modules/mod_rewrite.so # modify AllowOverride <Directory "/var/www/html/drupal"> AllowOverride All Require all granted </Directory> # Save and exit
Restart the apache service:
systemctl restart httpd