Table of Contents
1 Install Drupal
- This article uses default SSL/TLS certicication file for https. Please change your SSL/TLS certification file.
- If you use http instead of https, change https to http in firewall-cmd’s service argument.
- MYSQL_PASSWD is password of root user in MySQL and DRUPAL_PASSWD is password of drupal7 user in MySQL.
#!/bin/shset -e[ -z “${DRUPAL_PASSWD}” ] && DRUPAL_PASSWD=drupal_passwddrupal_install_mysql(){ sudo dnf install -y mariadb-server php-mysqlnd sudo systemctl enable mariadb sudo systemctl start mariadb cat<<EOF | sudo mysql -u rootcreate database drupal7 character set utf8 collate utf8_general_ci;grant all privileges on drupal7.* to drupal7@localhost identified by ‘${DRUPAL_PASSWD}’;exitEOF}drupal_install_drupal(){ sudo dnf install -y drupal7 sudo cp /etc/drupal7/default/default.settings.php /etc/drupal7/default/settings.php echo “require_once(‘dbconfig.php’);” | sudo tee -a /etc/drupal7/default/settings.php cat <<EOF | sudo tee /etc/drupal7/default/dbconfig.php<?php$dbs[‘mysql’] = array( ‘driver’ => ‘mysql’, ‘database’ => ‘drupal7’, ‘username’ => ‘drupal7’, ‘password’ => ‘${DRUPAL_PASSWD}’, ‘host’ => ‘localhost’, ‘port’ => ”, ‘prefix’ => ”);$databases[‘default’][‘default’] = $dbs[‘mysql’];?>EOF}drupal_install_apache(){ sudo dnf install -y mod_ssl sudo sed -e ‘s/Require local/Require all granted/g’ -i /etc/httpd/conf.d/drupal7.conf sudo firewall-cmd –add-service=https –permanent sudo firewall-cmd –reload sudo systemctl enable httpd sudo systemctl restart httpd}drupal_main(){ drupal_install_mysql drupal_install_drupal drupal_install_apache}drupal_main
2 Access to Drupal
Access to the following URL and setup Drupal. Accept this page’s certification to browser.
https://<server>/drupal7/install.php
After setup, access to the following URL and Drupal is displayed.
https://<server>/drupal7/