From 3943f7085507c51b22547b187c9f9f9c26c00b57 Mon Sep 17 00:00:00 2001 From: girishpanchal30 Date: Mon, 26 Jun 2023 18:37:56 +0530 Subject: [PATCH 1/2] Comment postgre DB and remove WP CLI from LAMP --- LAMP-with-packages.sh | 8 ++++---- LEMP-with-packages.sh | 41 ++++++++++------------------------------- 2 files changed, 14 insertions(+), 35 deletions(-) diff --git a/LAMP-with-packages.sh b/LAMP-with-packages.sh index b27954d..979d6d5 100644 --- a/LAMP-with-packages.sh +++ b/LAMP-with-packages.sh @@ -31,10 +31,10 @@ sudo systemctl start mysql.service # sudo mysql_secure_installation # Please use following command to set root password for the MYSQL. -# sudo mysql -# ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Root@1234'; -# flush privileges; -# exit; +sudo mysql +ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Root@1234'; +flush privileges; +exit; # Install PHP packages. echo -e "\n\nInstalling PHP & Requirements\n" diff --git a/LEMP-with-packages.sh b/LEMP-with-packages.sh index faa09d6..ab13632 100644 --- a/LEMP-with-packages.sh +++ b/LEMP-with-packages.sh @@ -29,10 +29,10 @@ sudo systemctl start mysql.service # sudo mysql_secure_installation # Please use following command to set root password for the MYSQL. -# sudo mysql -# ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Root@1234'; -# flush privileges; -# exit; +sudo mysql +ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Root@1234'; +flush privileges; +exit; # Install PHP packages. echo -e "\n\nInstalling PHP & Requirements\n" @@ -75,18 +75,18 @@ server { }" > my_site sudo ln -s /etc/nginx/sites-available/my_site /etc/nginx/sites-enabled/ # Unlink default config -#sudo unlink /etc/nginx/sites-enabled/default +# sudo unlink /etc/nginx/sites-enabled/default sudo systemctl reload nginx # Install postgres database. -sudo apt update -sudo apt upgrade -y -sudo apt install postgresql postgresql-client -y -sudo systemctl enable postgresql.service +# sudo apt update +# sudo apt upgrade -y +# sudo apt install postgresql postgresql-client -y +# sudo systemctl enable postgresql.service # sudo su -l postgres # psql -c "alter user postgres with password 'Root@1234'"; # exit; -sudo service postgresql restart +# sudo service postgresql restart # Give a www-data ownership to www directory # echo -e "\n\n Ownership for /var/www\n" @@ -174,27 +174,6 @@ echo 'export PATH=$HOME/.config/composer/vendor/bin:$PATH' >> ~/.bashrc source ~/.bashrc phpcs -i -# install_wpcli() { -# curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -# php wp-cli.phar --info -# chmod +x wp-cli.phar -# sudo mv wp-cli.phar /usr/local/bin/wp -# wp --info -# echo "\e[1;42m WP CLI install successfully \e[0m" -# } - -# while true; do - -# read -p "Do you want to install WP CLI for WordPress (y/n) " yn - -# case $yn in -# [yY] ) -# install_wpcli -# break;; -# [nN] ) echo "\e[1;41m No \e[0m" -# exit;; -# esac - # Install Dukto echo -e "\n\nInstalling Dukto\n" sudo add-apt-repository ppa:xuzhen666/dukto From 5dba5352e130f0582fc09eb068ab5a545df3110e Mon Sep 17 00:00:00 2001 From: girishpanchal30 Date: Tue, 25 Jul 2023 18:30:15 +0530 Subject: [PATCH 2/2] Update mysql command line interface in shell script --- LAMP-with-packages.sh | 9 +++++---- LEMP-with-packages.sh | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/LAMP-with-packages.sh b/LAMP-with-packages.sh index 979d6d5..3bd14cf 100644 --- a/LAMP-with-packages.sh +++ b/LAMP-with-packages.sh @@ -31,10 +31,11 @@ sudo systemctl start mysql.service # sudo mysql_secure_installation # Please use following command to set root password for the MYSQL. -sudo mysql -ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Root@1234'; -flush privileges; -exit; +# sudo mysql +sudo mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Root@1234';FLUSH PRIVILEGES;exit;" +# ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Root@1234'; +# flush privileges; +# exit; # Install PHP packages. echo -e "\n\nInstalling PHP & Requirements\n" diff --git a/LEMP-with-packages.sh b/LEMP-with-packages.sh index ab13632..1fee8ad 100644 --- a/LEMP-with-packages.sh +++ b/LEMP-with-packages.sh @@ -29,10 +29,10 @@ sudo systemctl start mysql.service # sudo mysql_secure_installation # Please use following command to set root password for the MYSQL. -sudo mysql -ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Root@1234'; -flush privileges; -exit; +sudo mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Root@1234';FLUSH PRIVILEGES;exit;" +# ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Root@1234'; +# flush privileges; +# exit; # Install PHP packages. echo -e "\n\nInstalling PHP & Requirements\n"