Introduction
In the previous lesson, you set up a Drupal 10 site using Composer, providing a foundation for scalable and maintainable sites. However, some scenarios might call for more granular control over the installation process. This is where downloading Drupal via a tarball comes in handy. In this lesson, we will guide you through downloading, extracting, and configuring a Drupal site using a tarball, offering you a more hands-on approach to setup.
Understanding the Tarball Method
A tarball is a compressed archive file, commonly used for distribution in Linux environments. By downloading Drupal as a tarball, you can manually take care of each installation step, which can be beneficial for learning purposes or environments where Composer is unavailable. Additionally, the tarball approach ensures that you fully grasp what each component of your Drupal site does.
Prerequisites
Before proceeding with the manual installation, ensure that you have:
- A web server configured with Apache or Nginx.
- PHP version 8.1 or higher, with necessary extensions such as gd, mbstring, and xml.
- MySQL version 5.7.8+ or MariaDB version 10.3.7+.
- Access to a terminal or command line interface.
Downloading the Tarball
First, download the latest Drupal tarball from the official website. Follow these steps:
- Visit the Drupal download page.
- Copy the download link for the latest Drupal version.
- Open your terminal and navigate to the directory where you want to install Drupal.
- Use
wget
orcurl
to download the tarball. Example with wget:
wget https://ftp.drupal.org/files/projects/drupal-x.x.tar.gz
Extracting the Tarball
Now that you've downloaded the tarball, extract its contents:
- Run the following command in your terminal to extract the file:
- This command will unpack Drupal into a directory called
drupal-x.x
. - Move the extracted contents to your desired web directory (e.g.,
/var/www/html/drupal
):
tar -zxvf drupal-x.x.tar.gz
mv drupal-x.x /var/www/html/drupal
Configuring Basic Settings
Once extracted, prepare your site for installation:
- Navigate to the
sites/default
directory: - Copy the default settings file:
- Adjust permissions to ensure the webserver can write to the settings file during installation:
cd /var/www/html/drupal/sites/default
cp default.settings.php settings.php
chmod 664 settings.php
Setting Up the Database
Drupal requires a database to store content and configuration. Follow these steps to set up your database:
- Create a new database for Drupal in your preferred database tool.
- Note down your database name, username, and password for use during the setup process.
Running the Installation Script
With everything in place, run the installation script to complete your setup:
- Open your web browser and navigate to your Drupal directory, e.g., http://localhost/drupal.
- Follow the on-screen prompts to select your language, verify requirements, and enter database details.
- Ensure to point Drupal’s installation to the database and user credentials you created.
Conclusion
You've successfully downloaded and configured Drupal via tarball, providing you a deeper insight into Drupal's manual setup. Regularly managing your setup directly can foster a strong understanding of Drupal’s back-end workings.
Next Lesson Preview: Setting Up settings.php for Database Connection
For our next lesson, we will delve into configuring your settings.php
file for database connections, optimizing your site's performance, and ensuring secure connections. We will guide you step-by-step through this crucial setup process. Stay tuned!