Update
This commit is contained in:
71
ubuntu_install.sh
Normal file
71
ubuntu_install.sh
Normal file
@@ -0,0 +1,71 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo "Загрузка через sudo"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Установка..."
|
||||
|
||||
apt update && apt upgrade -y
|
||||
|
||||
apt install -y software-properties-common
|
||||
|
||||
add-apt-repository ppa:ondrej/php -y
|
||||
apt update
|
||||
|
||||
apt install -y nginx
|
||||
systemctl start nginx
|
||||
systemctl enable nginx
|
||||
|
||||
apt install -y mariadb-server mariadb-client
|
||||
systemctl start mariadb
|
||||
systemctl enable mariadb
|
||||
|
||||
apt install -y php8.3-fpm php8.3-mysql php8.3-curl php8.3-gd php8.3-mbstring \
|
||||
php8.3-xml php8.3-zip php8.3-opcache php8.3-intl php8.3-bcmath
|
||||
|
||||
systemctl start php8.3-fpm
|
||||
systemctl enable php8.3-fpm
|
||||
|
||||
cat > /etc/nginx/sites-available/default << 'EOF'
|
||||
server {
|
||||
listen 80 default_server;
|
||||
root /var/www/html;
|
||||
index index.php index.html;
|
||||
server_name _;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
include snippets/fastcgi-php.conf;
|
||||
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
|
||||
}
|
||||
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
nginx -t
|
||||
|
||||
sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/php/8.3/fpm/php.ini
|
||||
sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 64M/' /etc/php/8.3/fpm/php.ini
|
||||
sed -i 's/post_max_size = 8M/post_max_size = 64M/' /etc/php/8.3/fpm/php.ini
|
||||
|
||||
chown -R www-data:www-data /var/www/html
|
||||
chmod -R 755 /var/www/html
|
||||
|
||||
systemctl reload nginx
|
||||
systemctl restart php8.3-fpm
|
||||
|
||||
if command -v ufw &> /dev/null; then
|
||||
ufw allow 'Nginx Full'
|
||||
fi
|
||||
|
||||
echo "Установка завершена"
|
||||
Reference in New Issue
Block a user