Created
July 18, 2021 09:39
-
-
Save antonkuzmin/818f32f703e4161441df81d5f54a1b1c to your computer and use it in GitHub Desktop.
php_setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| apt-get update | |
| apt-get install wget curl nginx | |
| echo "1. INSTALLING PHP" | |
| apt-get install php7.3 | |
| apt-get install php7.3-fpm | |
| sed -i /etc/nginx/sites-available/default 's/^[\t ]*index index.html/index index.html index.php/' /etc/nginx/sites-available/default | |
| echo "2. INSTALLING GEOIP" | |
| # https://www.kobzarev.com/linux/ustanovka-geoip-na-debian-lenny/ | |
| curl "https://dl.miyuru.lk/geoip/maxmind/city/maxmind4.dat.gz" | gunzip > GeoIPCity.dat | |
| mv -v GeoLiteCity.dat /usr/share/GeoIP/GeoIPCity.dat | |
| apt-get install php7.3-geoip | |
| # sudo nano /etc/php.ini | |
| cat <<EOT >> /etc/php/7.3/fpm/php.ini | |
| [geoip] | |
| geoip.custom_directory = /usr/share/GeoIP/ | |
| EOT | |
| sed -i /etc/nginx/sites-available/default 's/^[\t ]*location \/ {/\tlocation ~ \.php$ {\n\t\tinclude snippets\/fastcgi-php.conf;\n\t\tfastcgi_pass unix:\/run\/php\/php7.3-fpm.sock;\n\t}\n\tlocation \/ {/' /etc/nginx/sites-available/default | |
| service php7.3-fpm restart | |
| service nginx restart | |
| echo "3. SETUP GIT" | |
| ssh-keygen -f /root/.ssh/id_rsa -N "" | |
| cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys | |
| cat ~/.ssh/id_rsa |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment