-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-lamp-stack.sh
More file actions
32 lines (21 loc) · 854 Bytes
/
install-lamp-stack.sh
File metadata and controls
32 lines (21 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
#Purpose: This is a script to install the LAMP Stack and configure baselines for testing.
sudo apt update
#Install Apache2, MySQL, and PHP.
sudo apt install apache2 mysql-server php php-mysql libapache2-mod-php php-cli lynx
#Run/Enable Apache2 on Boot.
sudo systemctl enable apache2
#Restart Apache2 web server.
sudo systemctl start apache2
#Enable HTTP and HTTPS on UFW Firewall for apache web server.
sudo ufw allow in "Apache Full"
#Set read/write permissions for default html directory location.
sudo chmod 755 /var/www/html/
#Create info.php and test for php.
sudo touch /var/ww/html/info.php
sudo chmod 777 /var/html/info.php
sudo echo "<?php phpinfo(); ?>" > /var/www/html/info.php
sudo chmod 755 /var/html/info.php
#Open web browser and test for web access.
xdg-open "http://localhost"
xdg-open "http://localhost/info.php"