-
Notifications
You must be signed in to change notification settings - Fork 0
/
2-ubuntu-laravel-setup.sh
executable file
·69 lines (54 loc) · 1.94 KB
/
2-ubuntu-laravel-setup.sh
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
# Laravel Setup
sudo apt update
# NGINX
echo "Installing NGINX..."
sudo apt install nginx
echo "Your firewall configuration is:"
sudo ufw app list
sudo ufw allow 'Nginx Full'
echo "Your new firewall configuration is:"
sudo ufw status
echo "You can now visit $(curl -4s icanhazip.com) to see the server running! 💡"
# MySQL
echo "Installing MySQL..."
sudo apt install mysql-server
sudo mysql_secure_installation
# PHP
echo "Installing PHP..."
# Ubuntu 20.04 will automatically install PHP v7.4
# We want PHP 8
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.0 php8.0-cli php8.0-fpm php8.0-pdo php8.0-mysql php8.0-zip php8.0-gd php8.0-mbstring php8.0-curl php8.0-xml php8.0-bcmath
echo "PHP version installed:"
php --version
sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/8.0/fpm/php.ini
sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/8.0/fpm/php.ini
# Composer
echo "Installing Composer..."
sudo apt update
sudo apt install unzip
cd ~
curl -sS https://getcomposer.org/installer -o composer-setup.php
HASH=`curl -sS https://composer.github.io/installer.sig`
php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
# supervisor
sudo apt-get install -y supervisor
# acl to handle permissions
sudo apt-get install -y acl
# Node.js
echo "Installing Node.js..."
curl -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt install nodejs
echo "Installed Node version:"
node -v
echo "Adding some artisan conveniences..."
echo "alias a='php artisan '" >> ~/.bashaliases
echo "alias art='php artisan '" >> ~/.bashaliases
source ~/.bashaliases
echo "Done! 💪"
echo "You can now proceed to setup your project."