diff --git a/assets/nginx-phpmyadmin.conf b/assets/nginx-phpmyadmin.conf new file mode 100644 index 0000000..f5f486f --- /dev/null +++ b/assets/nginx-phpmyadmin.conf @@ -0,0 +1,31 @@ +server { + listen 80; + location /phpmyadmin { + # server_name phpmyadmin.idroot.net; + root /var/www/phpmyadmin; + + index index.php; + + ## Images and static content is treated different + location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ { + access_log off; + expires 30d; + } + + location ~ /\.ht { + deny all; + } + + location ~ /(libraries|setup/frames|setup/libs) { + deny all; + return 404; + } + + location ~ \.php$ { + fastcgi_pass unix:/run/php/php7.3-fpm.sock; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + } + } +} diff --git a/bin/lemp.sh b/bin/lemp.sh index cabc94f..b2871be 100755 --- a/bin/lemp.sh +++ b/bin/lemp.sh @@ -133,6 +133,20 @@ echo -e "\033[35;1mInstalling phpMyAdmin \033[0m" # echo -e "\033[92;1mphpMyAdmin installed\033[Om" # echo -e "\033[92;1mYou can access it at yourip/phpmyadmin\033[Om" +# install from source +apt-get install php-{mbstring,zip,gd,xml,pear,gettext,cgi} +cd /var/www/html/ +wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.zip +unzip phpMyAdmin-latest-all-languages.zip +mv phpMyAdmin-*-all-languages pma +rm phpMyAdmin-latest-all-languages.zip +# cp "$_assets"/nginx-phpmyadmin.conf > /etc/nginx/sites-available/phpmyadmin.conf +# ln -s /etc/nginx/sites-available/phpmyadmin.conf /etc/nginx/sites-enabled/phpmyadmin.conf +echo -e "\033[92;1mphpMyAdmin installed\033[Om" +echo -e "\033[92;1mYou can access it at yourip/pma\033[Om" + + + echo -e '\033[35m ____ ___ / __ \___ ____/ (_)____