Skip to content

Instantly share code, notes, and snippets.

@iotonlinux
Created August 23, 2021 17:18
Show Gist options
  • Save iotonlinux/cfa021ee3b163dca6e95ee4b8e40a8c7 to your computer and use it in GitHub Desktop.
Save iotonlinux/cfa021ee3b163dca6e95ee4b8e40a8c7 to your computer and use it in GitHub Desktop.
LAMP Stack Service
# !/bin/sh
apt update
apt upgrade
apt install apache2
ufw allow in "Apache Full"
apache2 -v
nano /etc/apache2/apache2.conf
# Add this line:
ServerName 127.0.1.1
# save and exit by pressing ctrl+s and ctrl+x
sudo apt update
sudo apt install phpmyadmin php-mbstring php-gettext
sudo nano /etc/apache2/apache2.conf
# Then add the following line to the end of the file:
Include /etc/phpmyadmin/apache.conf
# save ctrl+x then y and hit enter. Then restart apache:
sudo service apache2 restart
# visit: http://localhost/phpmyadmin/
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 WITH mysql_native_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-xml
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
@iotonlinux
Copy link
Author

Screenshot from 2021-08-23 22-32-44
Screenshot from 2021-08-23 22-48-28

@iotonlinux
Copy link
Author

Screenshot from 2021-08-19 23-20-01

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