How to install a second Drupal 10 website on the same Amazon VPS running Ubuntu?

admin, 21 六月, 2024

To install a second Drupal 10 website on the same Amazon VPS Linux server running Ubuntu, you need to perform the following steps. Assume that we have already installed Apache, PHP, and MySQL on the VPS and have configured the environment for the first Drupal website. Here are the specific steps:

  1. Create a new MySQL database and user.
sudo mysql -u root -p

  Execute the following command in the MySQL console:

CREATE DATABASE magename_db;
CREATE USER 'second_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON second_db.* TO 'second_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

2. Download and extract Drupal 10.

cd /var/www/
sudo wget https://ftp.drupal.org/files/projects/drupal-10.0.0.tar.gz
sudo tar -xzvf drupal-10.0.0.tar.gz
sudo mv drupal-10.0.0 example2.com

3. Set file permissions.

sudo chown -R www-data:www-data /var/www/example2.com
sudo chmod -R 755 /var/www/example2.com

4. Configure Apache Virtual Host.

Create a new Apache virtual host configuration file for the new website:

sudo nano /etc/apache2/sites-available/example2.com.conf

Add the following content to the file:

<VirtualHost *:80>
    ServerAdmin admin@example2.com
    ServerName example2.com
    ServerAlias www.example2.com
    DocumentRoot /var/www/example2.com

    <Directory /var/www/example2.com>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/example2.com_error.log
    CustomLog ${APACHE_LOG_DIR}/example2.com_access.log combined
</VirtualHost>

5. Enable the new site and reload Apache.

sudo a2ensite magename.com.conf
sudo systemctl reload apache2

6. Install Drupal through the web interface.  

Point your browser to http://example2.com and follow the installation wizard to install Drupal. During the installation, use the database name, username, and password you created earlier.

评论