-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·124 lines (104 loc) · 3.05 KB
/
setup.sh
File metadata and controls
executable file
·124 lines (104 loc) · 3.05 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/bin/bash
set -e
echo "
This script automates the installation of the essential components required for Full-Stack Laravel development:
- Ubuntu 24.04
- PHP 8.3
- Node 22
- Composer
- Nginx
- MariaDB (user: root with no password)
- Laravel Installer
- NVM (Node Version Manager)
- Yarn
you will be prompt for sudo password a few times
"
sleep 10
sudo add-apt-repository universe -y
echo "
Updating system packages...
"
sudo apt update
sudo apt upgrade -y
echo "
Installing basic tools...
"
wget https://raw.githubusercontent.com/clebsonsh/dev-setup/main/addsite.sh
sudo mv addsite.sh /usr/local/bin/addsite
sudo chmod +x /usr/local/bin/addsite
wget https://raw.githubusercontent.com/clebsonsh/dev-setup/main/rmsite.sh
sudo mv rmsite.sh /usr/local/bin/rmsite
sudo chmod +x /usr/local/bin/rmsite
sudo apt install htop curl git vim unzip -y
echo "
Installing NGINX
"
sudo apt install nginx -y
sudo sed -i "s/www-data/$USER/" /etc/nginx/nginx.conf
sudo systemctl restart nginx
PHP_VERSION=8.3
if ! [ -x "$(command -v php)" ]; then
echo "
Installing PHP $PHP_VERSION and required extensions for Laravel...
"
sudo apt install "php$PHP_VERSION-fpm" -y
sudo -S apt install -y \
"php$PHP_VERSION" \
"php$PHP_VERSION-cli" \
"php$PHP_VERSION-intl" \
"php$PHP_VERSION-common" \
"php$PHP_VERSION-mysql" \
"php$PHP_VERSION-sqlite3" \
"php$PHP_VERSION-swoole" \
"php$PHP_VERSION-zip" \
"php$PHP_VERSION-gd" \
"php$PHP_VERSION-mbstring" \
"php$PHP_VERSION-curl" \
"php$PHP_VERSION-xml" \
"php$PHP_VERSION-dev" \
"php$PHP_VERSION-bcmath"
fi
sudo sed -i "s/www-data/$USER/" /etc/php/8.3/fpm/pool.d/www.conf
sudo systemctl restart php8.3-fpm
if ! [ -x "$(command -v composer)" ]; then
echo "
Installing Composer...
"
curl -sS https://getcomposer.org/installer | php && sudo mv composer.phar /usr/local/bin/composer
echo 'export PATH="$HOME/.config/composer/vendor/bin:$PATH"' >>~/.bashrc
export PATH="$HOME/.config/composer/vendor/bin:$PATH"
fi
if ! [ -x "$(command -v laravel)" ]; then
echo "
Installing Laravel Installer...
"
composer global require laravel/installer
fi
# Install MySQL and set up a default user
if ! [ -x "$(command -v mysql)" ]; then
echo "
Installing MariaDB...
"
sudo apt install mariadb-server -y
sudo mysql -e "alter user root@localhost identified via '';FLUSH PRIVILEGES;"
fi
if ! [ -x "$(command -v node)" ]; then
echo "
Installing NVM, Node.js, and Yarn...
"
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
echo "
Installing Node 22...
"
nvm install 22
npm install -g npm
npm install -g yarn
yarn config set -- --emoji true
fi
echo "
All set! Happy coding!
run 'source ~/.bashrc' to reload system paths
"