DevCEDTeam / CED

0 stars 0 forks source link

Description #27

Open DevCEDTeam opened 1 year ago

DevCEDTeam commented 1 year ago

Sure! Here's a combined step-by-step guide to developing a Google Cloud SQL database linked to Mautic installation and configuration, along with the revised installation guide for the "45_mautic-449" package and additional instructions for SSL certificate generation and installation in cPanel:

Step 1: Set up a Google Cloud Project

  1. Go to the Google Cloud Console (console.cloud.google.com) and create a new project.
  2. Enable billing for your project.
  3. Enable the Cloud SQL Admin API for your project.

Step 2: Create a Google Cloud SQL Instance

  1. In the Google Cloud Console, navigate to the SQL section.
  2. Click on "Create instance" to create a new Cloud SQL instance.
  3. Select the desired database engine (e.g., MySQL or PostgreSQL), specify the instance details, and set a root password.
  4. Configure the remaining settings according to your requirements.
  5. Click on "Create" to create the Cloud SQL instance.

Step 3: Set up the Database

  1. Once the Cloud SQL instance is created, go to the instance details page in the Google Cloud Console.
  2. Under the "Databases" tab, click on "Create database" to create a new database for Mautic.
  3. Provide a name for the database and set the character set and collation according to your preference.
  4. Click on "Create" to create the database.

Step 4: Generate and Install SSL Certificate in cPanel

  1. Log in to cPanel.
  2. Navigate to the "SSL/TLS" section.
  3. Click on "Generate SSL Certificate" to generate a new SSL certificate.
  4. Fill in the required details such as the domain name, email, and other information.
  5. Click on "Generate" to generate the SSL certificate.
  6. Once the certificate is generated, go back to the "SSL/TLS" section.
  7. Click on "Install and Manage SSL for your site (HTTPS)".
  8. Select the domain for which you generated the certificate.
  9. Choose the "Autossl" option and click on "Install Certificate" to install the SSL certificate.

Step 5: Install the "45_mautic-449" Package

  1. SSH into your server or access your server's terminal.
  2. Navigate to the directory where you want to install Mautic.
  3. Download the "45_mautic-449" package using the following command:
wget URL_TO_45_MAUTIC-449_PACKAGE

Replace URL_TO_45_MAUTIC-449_PACKAGE with the actual URL where the package is hosted.

  1. Extract the package using the following command:
unzip 45_mautic-449.zip
  1. Move the extracted files to the web server's directory. For example:
mv 45_mautic-449/* /var/www/html/
  1. Set the correct file permissions for Mautic:
chmod -R 755 /var/www/html/
chown -R www-data:www-data /var/www/html/
  1. Rename the Mautic configuration file:
mv /var/www/html/app/config/parameters.php.dist /var/www/html/app/config/parameters.php
  1. Open the Mautic configuration file using a text editor:
nano /var/www/html/app/config/parameters.php
  1. Modify the database connection settings to point to your Cloud SQL instance. Replace the database configuration block with the following code:

For MySQL:

<?php
    $parameters = array(
        'database_driver' => 'pdo_mysql',
        'database_host' => '

CLOUD_SQL_INSTANCE_CONNECTION_NAME',
        'database_port' => '3306',
        'database_name' => 'YOUR_DATABASE_NAME',
        'database_user' => 'YOUR_USERNAME',
        'database_password' => 'YOUR_PASSWORD',
        // ...
    );

For PostgreSQL:

<?php
    $parameters = array(
        'database_driver' => 'pdo_pgsql',
        'database_host' => '/cloudsql/CLOUD_SQL_INSTANCE_CONNECTION_NAME',
        'database_port' => '5432',
        'database_name' => 'YOUR_DATABASE_NAME',
        'database_user' => 'YOUR_USERNAME',
        'database_password' => 'YOUR_PASSWORD',
        // ...
    );

Replace CLOUD_SQL_INSTANCE_CONNECTION_NAME with the connection name of your Cloud SQL instance, YOUR_DATABASE_NAME with the name of the database you created, YOUR_USERNAME with the database username, and YOUR_PASSWORD with the database password.

  1. Save the changes and exit the text editor.

Step 6: Connect Mautic to the Cloud SQL Instance

  1. Install the necessary database drivers for Mautic to connect to the Cloud SQL instance. Use the following commands depending on your database engine:

For MySQL:

composer require doctrine/dbal:^2.10

For PostgreSQL:

composer require doctrine/dbal:^2.12
  1. Run Mautic's database update command to update the database schema:
php bin/console doctrine:migrations:migrate
  1. Restart your web server to apply the changes.

At this point, you should have a Google Cloud SQL database linked to your Mautic installation, with SSL certificate generation and installation in cPanel. You can proceed with the Mautic configuration and setup process.

Remember to replace the placeholder values mentioned in the instructions with the actual values specific to your Cloud SQL instance, database, and SSL certificate.

I hope this combined guide helps you successfully set up a Google Cloud SQL database linked to your Mautic installation and configure it with SSL certificate support!

DevCEDTeam commented 1 year ago

//

DevCEDTeam commented 1 year ago

//