Last active
October 19, 2021 16:02
-
-
Save parallaxhub/fca106a153df79ff678576ab37c8599e to your computer and use it in GitHub Desktop.
LAMP Install Ubuntu
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
# !/bin/sh | |
apt update | |
apt upgrade | |
apt install apache2 | |
ufw allow in "Apache Full" | |
apache2 -v | |
nano /etc/apache2/apache2.conf | |
# Add this line: | |
# save and exit by pressing ctrl+s and ctrl+x | |
service apache2 start | |
service apache2 restart | |
apt install curl | |
ufw allow ssh | |
ufw allow 2222/tcp | |
apt install curl | |
curl http://icanhazip.com | |
# Visit: http://localhost/ | |
# Install MySQL & check version, start,stop & restart Apache | |
apt install mysql-server | |
mysql_secure_installation | |
mysql --version | |
nano /etc/mysql/mysql.conf.d/mysqld.cnf | |
# And then change the bind-address line to 0.0.0.0 | |
# save and exit by pressing ctrl+s and ctrl+x | |
service mysql start | |
service mysql restart | |
service mysql status | |
ufw allow from any to any port 3306 proto tcp | |
systemctl restart mysql | |
sudo mysql | |
CREATE DATABASE mydb; | |
CREATE USER 'masum'@'localhost' IDENTIFIED WITH mysql_native_password BY '01722G@usia'; | |
ALTER USER 'masum'@'localhost' IDENTIFIED WITtive_password BY '01722G@usia'; | |
GRANT CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, SELECT on *.* TO 'masum'@'localhost' WITH GRANT OPTION; | |
use mydb; | |
FLUSH PRIVILEGES; | |
exit | |
service mysql restart | |
# Install PHP & check version | |
apt install software-properties-common | |
apt install php | |
apt install php-curl php-gd php-mbstring php-mysql php-zip php-json php-xmi | |
php --version | |
# Install PHPmyAdmin | |
apt update | |
apt upgrade -y | |
apt update | |
apt install phpmyadmin | |
apt install -y php-mbstring | |
apt-get install gettext | |
apt install php libapache2-mod-php | |
a2enmod php7.4 | |
service apache2 reload | |
service apache2 restart | |
# visit: http://localhost/phpmyadmin/ | |
Use user= masum | |
pass= 01722G@usia |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment