In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "how to install Drupal 8 on RHEL, CentOS and Fedora". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Drupal requirements:
Apache 2.x (recommended)
PHP 5.5.9 or higher (recommended PHP 5.5)
MySQL 5.5.3 or MariaDB 5.5.20 with PHP data object (PDO) support
During the installation, I used drupal.tecmint.com as the hostname of the website, and the IP address was 192.168.0.104. Your environment may be different from these settings, so please make appropriate changes.
Step 1: install the Apache Web server
1. First, let's install the Apache Web server from the official warehouse.
# yum install httpd
2. After the installation is completed, the service is disabled, so we need to start it manually and let it start automatically the next time the system starts, as follows:
-through SystemD-CentOS/RHEL 7 and Fedora 22 +-# systemctl start httpd # systemctl enable httpd-through SysVInit-CentOS/RHEL 6 and Fedora-- # service httpd start # chkconfig-- level 35 httpd on
3. Next, in order to allow access to the Apache service through HTTP and HTTPS, we must open ports 80 and 443 that the HTTPD daemon is listening to, as shown below:
-through Firewalld-CentOS/RHEL 7 and Fedora 22 +-# firewall-cmd-- permanent-- zone=public-- add-service=http # firewall-cmd-- permanent-- zone=public-- add-service=https # firewall-cmd-- reload-through IPtables-CentOS/RHEL 6 and Fedora 22 +-# iptables-An INPUT-p Tcp-m tcp-- dport 80-j ACCEPT # iptables-An INPUT-p tcp-m tcp-dport 443-j ACCEPT # service iptables save # service iptables restart
4. Now verify whether Apache is working properly. Open the browser and enter http://server_IP in the address bar, and enter your server IP address. The default Apache2 page should appear, as shown in the screenshot below:
Apache default page
Step 2: install Apache PHP support
5. Next, install the required modules for PHP and PHP.
# yum install php php-mbstring php-gd php-xml php-pear php-fpm php-mysql php-pdo php-opcache
Important: if you want to install PHP7, you need to add the following repositories: EPEL and Webtactic to install PHP7.0 using yum:
-Install PHP 7 in CentOS/RHEL and Fedora-# 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 # yum install php70w php70w-opcache php70w-mbstring php70w-gd php70w-xml php70w-pear php70w-fpm php70w-mysql php70w-pdo
6. Next, to get complete information about PHP installation and configuration from the browser, create an info.php file in the Apache document root (/ var/www/html) using the following command.
# echo "" > / var/www/html/info.php
Then restart the HTTPD server and enter http://server_IP/info.php in the browser address bar.
# systemctl restart httpd or # service httpd restart
Verify PHP information
Step 3: install and configure the MariaDB database
7. Please be aware that Red Hat Enterprise Linux/CentOS 7.0has shifted from supporting MySQL to MariaDB as the default database management system.
To install the MariaDB database, you need to add the official MariaDB library to / etc/yum.repos.d/MariaDB.repo, as shown below.
[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.1/centos7-amd64 gpgkey= https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
When the warehouse files are ready, you can install MariaDB like this:
# yum install mariadb-server mariadb
8. When the MariaDB database installation is complete, start the database daemon and enable it to start automatically after the next startup.
-through SystemD-CentOS/RHEL 7 and Fedora 22 +-# systemctl start mariadb # systemctl enable mariadb-through SysVInit-CentOS/RHEL 6 and Fedora-# service mysqld start # chkconfig-- level 35 mysqld on
9. Then run the mysql_secure_installation script to protect the database (set the root password, disable remote login, remove the test database, and remove anonymous users), as follows:
# mysql_secure_installation
MySQL secure installation
Step 4: install and configure Drupal 8 in CentOS
10. Here we use the wget command to download the * * version of Drupal (for example, 8.2.6). If you do not install the wget and gzip packages, use the following command to install them:
# yum install wget gzip # wget-c https://ftp.drupal.org/files/projects/drupal-8.2.6.tar.gz
After that, extract the tar file and move the Drupal directory to the Apache document root (/ var/www/html).
# tar-zxvf drupal-8.2.6.tar.gz # mv drupal-8.2.6 / var/www/html/drupal
12. Then, set the file default.settings.php according to the example in the / var/www/html/drupal/sites/default directory, create the settings file settings.php, and then set the appropriate permissions to the Drupal site directory, including subdirectories and files, as follows:
# cd / var/www/html/drupal/sites/default/ # cp default.settings.php settings.php # chown-R apache:apache / var/www/html/drupal/
13. More importantly, set the SElinux rule in the / var/www/html/drupal/sites/ directory as follows:
# chcon-R-t httpd_sys_content_rw_t / var/www/html/drupal/sites/
14. Now we have to create a database and users for management for the Drupal site.
# mysql-u root-p Enter password: MySQL Shell Welcome to the MariaDB monitor. Commands end with; or\ g. Your MySQL connection id is 12 Server version: 5.1.73 Source distribution Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement. * * MySQL [(none)] > create database drupal;** Query OK, 1 row affected (0.00 sec) * * MySQL [(none)] > create user ravi@localhost identified by 'tecmint123';** Query OK, 0 rows affected (0.00 sec) * * MySQL [(none)] > grant all on drupal.* to ravi@localhost;** Query OK, 0 rows affected (0.00 sec) * * MySQL [(none)] > flush privileges * * Query OK, 0 rows affected (0.00 sec) * * MySQL [(none)] > exit** Bye
15, *, open the address: http://server_IP/drupal/ to start the installation of the website, select your installation language and click Save to continue.
Drupal installation language
16. Next, select the installation configuration file, select Standard (Standard), and click Save to continue.
Drupal installation profile
Review and pass the requirements review and enable Clean URL before moving on to the next step.
Validate Drupal requirements
Now enable Clean URL's Drupal in your Apache configuration.
# vi / etc/httpd/conf/httpd.conf
Ensure that AllowOverride All is set for the default root document directory / var/www/html, as shown in the following figure:
Enable Clean URL in Drupal
18. When you enable Clean URL for Drupal, refresh the page to perform database configuration from the following interface, enter the Drupal site database name, database user and database password.
When you have completed all the information, click Save and continue.
Drupal database configuration
If the above settings are correct, the installation of the Drupal site should be completed, as shown in the figure below.
Drupal installation
19. Next, configure the site to the following settings (use values that are appropriate for your situation):
Site name-TecMint Drupal Site
Site email address-admin@tecmint.com
User name-admin
Password-#
User's email address-admin@tecmint.com
Default country-India
Default time zone-UTC
After setting the appropriate values, click Save and continue to complete the site installation process.
Drupal site configuration
20. The following figure shows the Drupal 8 site successfully installed through LAMP.
Drupal site panel
Now you can click add content to create sample web content.
This is the end of "how to install Drupal 8 on RHEL, CentOS and Fedora". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.