Drupal Apache

Drupal works on Apache, Nginx, and other web servers. In this video I am sharing some info regarding the PHP/Apache configuration you need, to be able to run Drupal. I hope I save you some time:-)You can instal. Drupal runs on all the web server including, Apache, Nginx, IIS, Lighttpd and as backend databases MySQL, MariaDB, MongoDB, SQLite, MS SQL Server, PostgreSQL etc. In this article, we will demonstrate how to install Drupal 8 on Debian 9 server.

Drupal Apache Solr is the best solution for super-fast, credible and awesome search applications. Big guns like Netflix, Instagram and Twitter including various e-commerce sites and CMSs, use Apache Solr for their search functionality. Why choose Apache Solr? Drupal is an “out of the box” web content management tool as well as a customizable platform - to help you build the right tool to serve your content management strategy. Business and technology leaders use Drupal to create real-world enterprise solutions that empower web innovation.

If you know WordPress… then you should also know Drupal. They both helps users create dynamic PHP based websites and blogs.. Although WordPress is # 1 when it comes to CMS, Drupal has some features that are not available to WordPress users..

Drupal is a powerful and popular CMS use by many webmasters to create powerful websites and blogs. If you’re looking open source platform to create dynamic, PHP-based websites and blogs easily may want to take a look at Drupal CMS.

In today’s environments, Drupal is frequently being installed with SSL/TLS encryption so that all traffic to and from the website is protected over HTTPS. Also, websites that use HTTPS may rank better with Google and other search engine providers.

This brief tutorial is going to show students and new users how to install Drupal on Ubuntu 17.04 17.10 with Apache2, MariaDB, PHP and Let’s Encrypt support. When you’re done, your website will automatically be configured to use HTTPS for all traffic.

To get started with installing Drupal with Let’s Encrypt support, follow the steps below:

Step 1: Install Apache2

Drupal requires a webserver to function and the second most popular webserver in used today is Apache2. So, go and install Apache2 on Ubuntu by running the commands below:

sudo apt install apache2

Next, run the commands below to stop, start and enable Apache2 service to always start up with the server boots.

Step 2: Install MariaDB

Drupal also requires a database server to function.. and MariaDB database server is a great place to start. To install it run the commands below.

sudo apt-get install mariadb-server mariadb-client

After installing, the commands below can be used to stop, start and enable MariaDB service to always start up when the server boots.

After that, run the commands below to secure MariaDB server.

sudo mysql_secure_installation

When prompted, answer the questions below by following the guide.

  • Enter current password for root (enter for none): Just press the Enter
  • Set root password? [Y/n]: Y
  • New password: Enter password
  • Re-enter new password: Repeat password
  • Remove anonymous users? [Y/n]: Y
  • Disallow root login remotely? [Y/n]: Y
  • Remove test database and access to it? [Y/n]: Y
  • Reload privilege tables now? [Y/n]: Y

Restart MariaDB server

sudo systemctl restart mysql.service

Step 3: Install PHP 7.1 and Related Modules

Apache

PHP 7.1 isn’t available on Ubuntu default repositories… in order to install it, you will have to get it from third-party repositories.

Run the commands below to add the below third party repository to upgrade to PHP 7.1

Then update and upgrade to PHP 7.1

sudo apt update

Run the commands below to install PHP 7.1 and related modules.

sudo apt install php7.1 libapache2-mod-php7.1 libapache2-mod-php7.1 php7.1-common php7.1-mbstring php7.1-xmlrpc php7.1-soap php7.1-gd php7.1-xml php7.1-intl php7.1-mysql php7.1-cli php7.1-mcrypt php7.1-ldap php7.1-zip php7.1-curl

After install PHP, run the commands below to open Apache2 PHP default file.

sudo nano /etc/php/7.1/apache2/php.ini

Then change the following lines below in the file and save. You may increase the value to suite your environment.

Step 4: Create Drupal Database

Now that you’ve install all the packages that are required, continue below to start configuring the servers. First run the commands below to create Drupal database.

Run the commands below to logon to the database server. When prompted for a password, type the root password you created above.

sudo mysql -u root -p

Then create a database called drupal

CREATE DATABASE drupal;

Create a database user called drupaluser with new password

CREATE USER 'drupaluser'@'localhost' IDENTIFIED BY 'new_password_here';

Then grant the user full access to the database.

GRANT ALL ON drupal.* TO 'drupaluser'@'localhost' IDENTIFIED BY 'user_password_here' WITH GRANT OPTION;

Finally, save your changes and exit.

Step 5: Download Drupal Latest Release

Next, visit Drupal site and download the latest package…. or run the commands below to download and extract Drupal content.

After downloading, run the commands below to extract the downloaded file and move it into a new Drupal root directory.

Then run the commands below to set the correct permissions for Drupal to function properly.

Step 6: Configure Apache2 Drupal Site

Finally, configure Apache2 configuration file for Drupal. This file will control how users access Drupal content. Run the commands below to create a new configuration file called drupal.conf

sudo nano /etc/apache2/sites-available/drupal.conf

Then copy and paste the content below into the file and save it. Replace the highlighted line with your own domain name and directory root location.

Save the file and exit.

Step 7: Enable the Drupal Site

After configuring the VirtualHost above, enable it by running the commands below

Step 8 : Restart Apache2

To load all the settings above, restart Apache2 by running the commands below.

sudo systemctl restart apache2.service

Step 9: Obtain and Configure Let’s Encrypt SSL Certificates

To get Let’s Encrypt free SSL/TLS certificates on your Ubuntu machine, you should first install its client. The client helps automate the process for you. To install it, run the commands below.

sudo apt-get install python-certbot-apache

If python-certbot-apache isn’t already installed, you may have to add its PPA repository and install the package..

After that run the commands below to obtain your free Let’s Encrypt SSL/TLS certificate for your site.

sudo certbot --apache -m [email protected] -d example.com -d www.example.com

After running the above commands, you should get prompted to accept the licensing terms. If everything is checked, the client should automatically install the free SSL/TLS certificate and configure the Apache2 site to use the certs.

Choose Yes ( Y ) to share your email address

This is how easy is it to obtain your free SSL/TLS certificate for your Apache2 powered website.

Pick option 2 to redirect all traffic over HTTPS. This is important!

After that, the SSL client should install the cert and configure your website to redirect all traffic over HTTPS.

The highlighted code block should be added to your Apache2 Drupal site configuration file automatically by Let’s Encrypt certbot. Your Drupal site is ready to be used over HTTPS.

A new configuration file for the domain should also be created named /etc/apache2/sites-available/drupal-le-ssl.conf. This is Apache2 SSL module configuration file and should contain the certificate definitions defined in it.

After that, open your browser and browse to your domain name to start Drupal configuration wizard. You should see Drupal setup wizard… Please follow the wizard carefully.

Follow the onscreen wizard until you’re done.

Drupal apache solr

Enter the database connection info and continue.

Create your Drupal site admin account and website name.

Finish

Congratulations! You’ve successfully installed Drupal with Let’s Encrypt free SSL certificates.

To setup a process to automatically renew the certificates, add a cron job to execute the renewal process.

sudo crontab -e

Then add the line below and save.

0 1 * * * /usr/bin/certbot renew & > /dev/null

The cron job will attempt to renew 30 days before expiring

Enjoy!

You may also like the post below:

Note:

  • This tutorial is available in an Oracle-provided free lab environment.
  • It uses example values for Oracle Cloud Infrastructure credentials, tenancy, and compartments. When completing your lab, substitute these values with ones specific to your cloud environment.

Introduction

Drupal is a web Content Management System (CMS) written in PHP. Drupal provides the infrastructure for websites worldwide – ranging from personal blogs to corporate, political, and government sites. Very extensible and modular, it can be used in a large variety of scenarios.

Use this workshop as a starting point and have a complete installation built on top of Oracle Linux and Oracle MySQL Database Service.

Steps to success

In this workshop you’ll learn how to:

  • Create VCN and subnets
  • Create Linux instances
  • Install and configure Apache HTTP Server
  • Create and populate MySQL Database Service instance
  • Install and configure Drupal

Prerequisites

  • You need an Oracle Cloud Infrastructure account.
  • A web browser
  • SSH Terminal - Cloud Shell (provided in the OCI console). Alternatively, terminal with SSH (Linux or MAC), Windows machine with GitBash/Putty or WSL (Windows Subsystem for Linux).

Create your Virtual Cloud Network and Related Components

Create your VCN and subnets

Set up a Virtual Cloud Network (VCN) to connect your Linux instance to the internet. You will configure all the components needed to create your virtual network.

  1. Open the navigation menu. Under Core Infrastructure, go to Networking and click Virtual Cloud Networks.

    Ensure that a compartment (or the compartment designated for you) is selected in the Compartment list on the left.

  2. Click Start VCN Wizard.

  3. Select VCN with Internet Connectivity, and then click Start VCN Wizard.

  4. Enter the following (descriptions are italicized, replace with the values for your scenario):

    • Name: Enter a name for your cloud network
    • COMPARTMENT: select the desired compartment
    • VCN CIDR BLOCK: 10.0.0.0/16
    • PUBLIC SUBNET CIDR BLOCK: 10.0.0.0/24
    • PRIVATE SUBNET CIDR BLOCK: 10.0.1.0/24
    • DNS RESOLUTION: checked

      Note The public and private subnets have different CIDR blocks.

  5. Click Next.

    The Create a VCN with Internet Connection configuration dialog will be displayed, confirming all the values you just entered and listing additional components that will be created.

  6. Click Create to start the workflow.

  7. After the workflow completes, click on View Virtual Cloud Networks and you will be directed to the details page of the VCN you created.

Configure security list to allow HTTP incoming connections

Create the rules in the default security list that will allow incoming connections on ports 80/TCP and 443/TCP.

  1. Click View Virtual Cloud Network to view your new VCN.

  2. With your new VCN displayed, click on your Public subnet link.

    The public subnet information is displayed with the Security Lists at the bottom of the page. There should be a link to the Default Security List for your VCN.

  3. Click the Default Security List link.

    The default Ingress Rules for your VCN are displayed.

  4. Click Add Ingress Rules.

    An Add Ingress Rules dialog is displayed.

  5. Enter the following:

    • Stateless: Do not select
    • Source Type: CIDR
    • Source CIDR: 0.0.0.0/0
    • IP Protocol: TCP
    • Source port range: (leave-blank)
    • Destination Port Range: 80
    • Description: Allow HTTP connections

      Once you click Add Ingress Rule, inbound HTTP connections are allowed.

  6. Repeat the steps from 1-4 and enter the following:

    • Stateless: Do not select
    • Source Type: CIDR
    • Source CIDR: 0.0.0.0/0
    • IP Protocol: TCP
    • Source port range: (leave-blank)
    • Destination Port Range: 443
    • Description: Allow HTTPS connections

      Once you click Add Ingress Rule, inbound HTTPS connections are allowed.

Configure security list to allow MySQL incoming connections

Create a rule in the Security List for Private Subnet-VCN Name security list that will allow incoming connections on ports 3306/TCP and 33060/TCP.

  1. Click View Virtual Cloud Network to view your new VCN.

  2. With your new VCN displayed, click on your Private subnet link.

    The private subnet information is displayed with the Security Lists at the bottom of the page. There should be a link to the Security List for Private Subnet-VCN Name for your private subnet.

  3. Click the Security List for Private Subnet-VCN Name link.

    The default Ingress Rules for your VCN are displayed.

  4. Click Add Ingress Rules.

    An Add Ingress Rules dialog is displayed.

  5. Enter the following:

    • Stateless: Do not select
    • Source Type: CIDR
    • Source CIDR: 10.0.0.0/24
    • IP Protocol: TCP
    • Source port range: (leave-blank)
    • Destination Port Range: 3306
    • Description: Allow MySQL connections

    Once you click Add Ingress Rule, inbound MySQL connections from the public subnet are allowed.

  6. Repeat the steps from 1-4 and enter the following:

    • Stateless: Do not select
    • Source Type: CIDR
    • Source CIDR: 10.0.0.0/24
    • IP Protocol: TCP
    • Source port range: (leave-blank)
    • Destination Port Range: 33060
    • Description: Allow MySQL X connections

    Once you click Add Ingress Rule, inbound MySQL X connections from the public subnet are allowed.

Create and Configure Oracle MySQL Database Service

Create Oracle MySQL Database Service required policy

Note: If you are using a free Oracle-provided hands-on lab, creating this policy is not required. You can go to Create your Oracle MySQL Database Service section.

  1. Open the navigation menu. Under Governance and Administration, go to Identity and click Policies.

  2. On the Policies page, under List Scope, select the Compartment(root) and click on the Create Policy button.

  3. Enter the following information:
    • Name: policy name
    • Compartment: (root)
  4. In the Policy Builder, click Customize (Advanced).

  5. Enter the following required MySQL Database Service policies:

    Policy Statements

    • Allow group Administrators to {COMPARTMENT_INSPECT} in tenancy
    • Allow group Administrators to {VCN_READ, SUBNET_READ, SUBNET_ATTACH, SUBNET_DETACH} in tenancy
    • Allow group Administrators to manage mysql-family in tenancy
  6. Click Create.

Create your Oracle MySQL Database Service

  1. Open the navigation menu. Under Database, go to MySQL and click DB Systems.

  2. On the DB Systems page, select the compartment and click on Create MySQL DB System.

  3. Enter the following information:

    • Name: DB system name
    • Description: MySQL system Description
    • Compartment: select the compartment
    • Select an Availability Domain: select the availability domain
    • Fault Domain: Optional. Can be left unchecked
    • Select a Shape: choose the desired shape by clicking on Change Shape
    • Data Storage Size (GB): Enter the desired storage size
    • Maintenance Window Start Time: None
  4. Click Next to advance to Database Information screen.

  5. Enter the following information:

    • Username: administrator user name
    • Password: admin password
    • Confirm Password:admin password
    • Virtual Cloud Network in: select the VCN compartment
    • Virtual Cloud Network: select the a private VCN
    • Hostname: hostname name
    • MySQL Port: 3306
    • MySQL X Protocol Port: 33060
  6. Click Next to advance to Backup Information screen.

  7. Enter the following information:

    • Enable Automatic Backups: checked
    • Backup retention period: 7
    • Default Backup Window: checked
  8. You’ll be taken to the MySQL DB System’s details page. Once the yellow hexagon turns green, your DB system is provisioned, and up and running.

Create VM Compute Instance and Configure Apache and PHP

Create Oracle Linux instance to host your Apache web server.

  1. Open the Oracle Cloud Infrastructure main menu.

  2. Select Compute then Instances.

  3. From the list of instances screen click Create Instance.

  4. Enter a name for the instance.

  5. Select the compartment to create the instance in.

  6. Complete the following in the Configure placement and hardware section:

    • Availability domain: Select the Availability domain that you want to create the instance in
    • Fault Domain: Optional. Can be left unchecked
    • Image: Latest Oracle Linux ( by default the latest supported version will be already selected)
    • Shape: Select the desired shape
  7. Complete the following in the Configure networking section:

    • Network Select an existing virtual cloud network
    • Virtual cloud network in: Choose the compartment that has the desired VCN
    • Network: Select the Virtual Network Cloud Network
    • Subnet in: Choose the compartment that has the desired VCN
    • Subnet: Select a public subnet *
    • Use network security groups to control traffic:unchecked
    • Public IP Address: Assign a public IPv4 address
  8. In the Add SSH keys section:

    If you don’t have a SSH key pair:

    1. Select Generate SSH key pair.
    2. Click on Save Private Key and follow the browser prompt to save the private key.
    3. Click on Save Public Key and follow the browser prompt to save the public key.

    If you have a public key, you can:

    1. Select Choose public key files
    2. Drag and drop the public key files over or Or browse to a location., find the location and select the files. or
    3. Select Paste public keys.
    4. Paste the Public Key Value into SSH keys (multiple keys can be added by clicking on Another key).
  9. In the Configure boot volume, leave all options unchecked.

  10. Click Create.

  11. You will be taken to the instance’s details page. Once the yellow square turns green, your instance will be provisioned, up and running.

Install and configure Apache HTTP server with PHP

  1. Open the Oracle Cloud Infrastructure main menu.

  2. Select Compute then Instances.

  3. From the list of instances, click on the instance name you want to configure the HTTP server.

  4. Once the instance details are loaded, find on Public IP Address: on the right side, under Istance Access. Copy the Public IP access.

  5. From a terminal (Cloud Shell or any other SSH enabled terminal), connect to the instance:

  6. Install Apache HTTP Server and php. Dependencies will be resolved automatically and installed.

  7. Enable and start Apache HTTP Server.

  8. Allow HTTP and HTTPS in the local iptables firewall.

  9. Add the extra repositories:

  10. Install PHP.

  11. Create a test php page.

  12. From a web browser, navigate to http://public server IP/test.php.

Install MySQL and MySQL Shell

  1. Install MySQL release package.

  2. Install MySQL Shell.

Install Drupal CMS

Install Drupal in your Oracle Linux instance

  1. From your SSH enabled terminal, SSH to the Oracle Linux instance where Drupal will be installed.

  2. Install Drupal required packages.

  3. Edit the httpd.conf.

  4. Locate the section <Directory “/var/www/html”> and in that section change AllowOverride All to AllowOverride None. You can navigate on the file until you find it or press “/”, and enter Options Indexes FollowSymLinks.

  5. Restart Apache.

  6. Download Drupal from the Drupal website.

  7. Extract latest.tar.gz to /var/www/html (Apache document root).

  8. Adjust ownership.

  9. Create settings.php.

  10. Adjust ownership.

  1. Adjust SE Linux.
  1. Allow Apache to connect to an external database.
  1. Connect to the MDS database using MySQL Shell.
  1. Create Drupal database and user.
  1. From a browser access http://instance public IP/.

  2. Choose language and click Save and Continue.

  3. Select an installation profile, select Standard profile and click Save and Continue.

  4. If all settings are correct, you’ll see the database configuration page. Fill the following information:

    • Database type : MySQL, MariaDB, Percona Server, or equivalent
    • Database name: drupal
    • Database username: drupaluser
    • Database password: ComplexPass0rd!Expand Advanced options
    • Host: MDS IP address
  5. Click Install site.

  6. Configure the site by entering the following information:

    • Site name: Choose your site name
    • Site email address: email account for automated emails sent by the site
    • Username: Drupal administrator
    • Password : Drupal administrator password
    • Confirm password: confirm password
    • Email address: your email address
    • Default country: choose the country
    • Default time zone: choose the time zone
    • Check for updates automatically: checked
    • Receive email notifications : unchecked
  7. Click Save and continue.

  8. From a browser access http://instance public IP/, login with your admin user and start customizing the website.

Acknowledgements

Authors: Orlando Gentil and Frédéric Descamps

Learn More

  • Watch the video on Running Drupal with Oracle MySQL Database Service

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.

Install Drupal CMS on Oracle Linux with MySQL database

F38453-05

March 2021

Copyright © 2021, Oracle and/or its affiliates.

Drupal Apache Solr

This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.

Drupal Apache Solr

The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.

If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable:

Drupal Apache Docker

U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are 'commercial computer software' pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government.

Drupal Apache Solr

This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.

Drupal Apache Vhost

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.

This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle.