Created
October 3, 2021 09:34
-
-
Save parallaxhub/776f008d7cffdfe4db26ee76a85480f7 to your computer and use it in GitHub Desktop.
Drupal Install LEMP Stack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Things to do after install Ubuntu 20 | |
sudo apt update -y | |
sudo apt-get upgrade -y | |
sudo apt install build-essential checkinstall | |
sudo apt install ubuntu-restricted-extras | |
sudo apt install software-properties-common | |
sudo apt upgrade -o APT::Get::Show-Upgraded=true | |
sudo apt install apt-show-versions | |
sudo apt update -y | |
sudo apt-get upgrade -y | |
sudo apt update && sudo apt-get upgrade --fix-missing | |
sudo apt install build-essential checkinstall | |
sudo apt install ubuntu-restricted-extras | |
sudo apt update | |
sudo -i | |
add-apt-repository ppa:git-core/ppa | |
apt update -y | |
apt install git | |
git config --global user.name "masum" | |
git config --global user.email [email protected] | |
apt upgrade -y | |
ssh-keygen -t rsa -b 4096 -C "[email protected]" | |
eval "$(ssh-agent -s)" | |
ssh-add ~/.ssh/id_rsa | |
cat /root/.ssh/id_rsa.pub | |
service ssh restart | |
apt -f install | |
apt autoremove | |
apt -y autoclean | |
apt -y clean | |
apt update -y | |
apt-get upgrade -y | |
reboot | |
# Install NGINX | |
apt update | |
apt install nginx | |
sudo nano /etc/nginx/sites-available/default | |
### Replace all the contents of the file with the bellow code. | |
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
root /var/www/html/drupal; | |
index index.html index.htm index.nginx-debian.html index.php; | |
server_name 192.0.2.12; | |
location / { | |
try_files $uri $uri/ /index.php$is_args$args; | |
} | |
location = /favicon.ico { log_not_found off; access_log off; } | |
location = /robots.txt { log_not_found off; access_log off; allow all; } | |
location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ { | |
expires max; | |
log_not_found off; | |
} | |
location ~ \.php$ { | |
try_files $uri =404; | |
fastcgi_split_path_info ^(/.+)$; | |
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
} | |
sudo nginx -t | |
systemctl start nginx | |
systemctl enable nginx | |
systemctl daemon-reload | |
systemctl restart nginx | |
systemctl reload nginx | |
systemctl status nginx | |
sudo -i | |
apt install mariadb-server mariadb-client | |
mysql_secure_installation | |
nano /usr/lib/systemd/system/mariadb.service | |
# Update | |
LimitNOFILE=infinity | |
# save and exit ctrl+s and ctrl+x | |
systemctl daemon-reload | |
systemctl restart mariadb | |
systemctl status mariadb | |
ctrl+c | |
systemctl is-enabled mariadb | |
mysql | |
create database drupal; | |
CREATE USER 'drupaladmin'@'localhost' IDENTIFIED BY 'DRUP@l786'; | |
GRANT ALL PRIVILEGES ON *.* TO 'drupaladmin'@'localhost'; | |
use drupal; | |
FLUSH PRIVILEGES; | |
exit | |
systemctl restart mysql | |
apt update -y | |
apt upgrade -y | |
apt install php php-mysql php-fpm | |
sudo apt install openssl php-common php-1.4-php-mbstring php-mysql php-xml php-zip | |
sudo apt install php7.4-common php7.4-bcmath openssl php7.4-json php7.4-mbstring | |
nano /etc/php/7.4/fpm/php.ini | |
# update | |
;cgi.fix_pathinfo=1 TO cgi.fix_pathinfo=0 | |
# save and exit ctrl+s and ctrl+x | |
systemctl restart php7.4-fpm | |
systemctl status php7.4-fpm | |
systemctl is-enabled php7.4-fpm | |
systemctl stop apache2 | |
nano /etc/php/7.4/fpm/pol.d/www.conf | |
# check and if set this below line: | |
listen = /run/php/php7.4-fpm.sock | |
# save and exit ctrl+s and ctrl+x | |
systemctl stop apache2 | |
systemctl restart nginx | |
systemctl reload nginx | |
systemctl status nginx | |
###Install Drupal | |
sudo apt install unzip | |
wget https://ftp.drupal.org/files/project/drupal-9.1.4.zip | |
sudo unzip drupal-9.1.4.zip | |
cd drupal-9.1.4 | |
sudo mkdir /var/www/html/drupal | |
sudo mv * /var/www/html/drupal | |
cd /var/www/html/drupal/sites/default | |
sudo cp default.settings.php settings.php | |
sudo chown -R www-data:www-data /var/www/html/drupal/ | |
sudo chmod -R 755 /var/www/html/drupal/ |
Author
parallaxhub
commented
Oct 3, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment