-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
59 lines (49 loc) · 1.82 KB
/
install.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
#!/bin/bash
# https://github.com/humans/hum/releases/download/latest/hum-cli
apt update --yes
apt install ca-certificates apt-transport-https software-properties-common --yes
apt upgrade --yes
ARCHITECTURE=$(uname -m)
if [ $ARCHITECTURE == "x86_64" ]; then
wget https://dl.static-php.dev/static-php-cli/common/php-8.3.3-micro-linux-x86_64.tar.gz -qO php-micro.tar.gz
fi
if [ $ARCHITECTURE == "arm64" ]; then
wget https://dl.static-php.dev/static-php-cli/common/php-8.3.3-micro-linux-aarch64.tar.gz -qO php-micro.tar.gz
fi
tar -xvf php-micro.tar.gz
cat micro.sfx hum-cli > hum
chmod +x hum
mv hum /usr/bin
rm hum-cli micro.sfx php-micro.tar.gz
# Add User
adduser --disabled-password --gecos ""
usermod -aG sudo hum
usermod -aG www-data hum
usermod -aG hum www-data
mkdir /home/hum/.ssh
cp /root/.ssh/* /home/hum/.ssh/
chmod 700 /home/hum/.ssh/
chmod 600 /home/hum/.ssh/*
chown hum:hum /home/hum/.ssh
chown hum:hum /home/hum/.ssh/*
sed -i 's/#PubkeyAuthentication/PubkeyAuthentication/' /etc/ssh/sshd_config
service ssh restart
# Install NGINX
apt install certbot python3-certbot-nginx nginx --yes --quiet --quiet
service apache2 stop
service nginx start
chmod 2750 /home/hum
mkdir /home/hum/default
echo "Hello!" > /home/hum/default/index.html
chown hum:hum /home/hum/default
chown hum:hum /home/hum/default/index.html
sed -i 's/\/var\/www\/html/\/home\/hum\/default/g' /etc/nginx/sites-available/default
service nginx reload
###### mysql
debconf-set-selections <<< "mysql-server mysql-server/root_password password $MYSQL_ROOT_PASSWORD"
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $MYSQL_ROOT_PASSWORD"
apt install --yes --quiet --quiet mysql-server
#service mysql start
#mysqladmin -uroot password ******
# add site
#certbot certonly --nginx -d hum.pigeons.dev --non-interactive --agree-tos -m [email protected]