Skip to content

Instantly share code, notes, and snippets.

@hunterserror
Created January 26, 2024 09:04
Show Gist options
  • Save hunterserror/e858ce0ddb82e008d37341bc8766b464 to your computer and use it in GitHub Desktop.
Save hunterserror/e858ce0ddb82e008d37341bc8766b464 to your computer and use it in GitHub Desktop.
Drupal Install and Optimization
:// Install LAMP Stack//
----Install Apache:
-- sudo apt update
--sudo apt install apache2
--Install MySQL--
---sudo apt install mysql-server--
--Install PHP and Required Modules--
--sudo apt install php libapache2-mod-php php-mysql --
//After installation, restart Apache\\
-- sudo systemctl restart apache2 --
//Configure MySQL//
--sudo mysql_secure_installation--
//Create a MySQL Database and User for Drupal//
-- sudo mysql -u root -p--
-- CREATE DATABASE drupaldb; --// so you can give your database name ......
-- CREATE USER 'drupaluser'@'localhost' IDENTIFIED BY 'your_password'; -- //you can create your desire user name and password //
--GRANT ALL ON drupaldb.* TO 'drupaluser'@'localhost'; --
-- FLUSH PRIVILEGES;--
-- EXIT; --
// Download and Install Drupal//
--cd /var/www/
--rm -rf html
--wget https://www.drupal.org/download-latest/tar.gz -- always try to get updated version
--tar -xzvf tar.gz--
--mv drupal-10.2.2 html--
--chown -R www-data:www-data /var/www/html/drupal-10.2.2/--
--chmod -R 755 /var/www/html/drupal-10.2.2/--
--cd /etc/apache2/sites-enabled/
--nano drupal.conf--
config file wouldbe
<VirtualHost *:80>
ServerName drupal.rosehosting.com
ServerAlias drupal.rosehosting.com
ServerAdmin [email protected]
DocumentRoot /var/www/html/drupal-10.2.2
CustomLog ${APACHE_LOG_DIR}/access.log combined
ErrorLog ${APACHE_LOG_DIR}/error.log
<Directory /var/www/html/drupal-10.2.2>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
# RewriteEngine on
# RewriteBase /
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</Directory>
</VirtualHost>
----------------------------------------------------------
//server check for everything going well or not ----
apachectl configtest
service apache2 restart
service apache2 reload
service mariadb restart
service apache2 restart
service apache2 reload
@hunterserror
Copy link
Author

image

@hunterserror
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment