Advertisement
para_bellum

LEMP Linux nginx MariaDB PHP

Apr 11th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. ####### Packages installation #########
  2. sudo apt install nginx
  3. sudo apt install mariadb-server mariadb-client
  4. sudo mysql_secure_installation
  5. sudo apt install php7.0-fpm
  6. sudo apt install php7.0-curl php7.0-mysql
  7. sudo apt install phpmyadmin
  8. ####### End of packages installation ########
  9.  
  10. ####### phpmyadmin - Add a new user in the MySQL database ###########
  11. # http://askubuntu.com/questions/763336/cannot-enter-phpmyadmin-as-root-mysql-5-7/763359#763359*
  12. # Connect as root to mysql. Need to be sudo since a recent update.
  13. # The '-p' will prompt for a password. If none as been set, simply press 'enter'
  14. sudo mysql -u root -p
  15. # load the mysql database
  16. use mysql;
  17. # Create the new user
  18. CREATE USER 'pelican'@'localhost' IDENTIFED BY 'password';
  19. GRANT ALL PRIVILEGES ON *.* TO 'pelican'@'localhost' WITH GRANT OPTION;
  20. FLUSH PRIVILEGES;
  21. quit;
  22.  
  23. ####### End of adding a new user #############
  24.  
  25.  
  26. ########### facetious-pelican config file ##############
  27. server {
  28. listen 80 default_server;
  29. listen [::]:80 default_server;
  30. root /home/para/dev/facetious-pelican/html;
  31. index index.php index.html index.htm index.nginx-debian.html;
  32. server_name _;
  33.  
  34. location ~ \.php$ {
  35. try_files $uri $uri/ =404
  36. include snippets/fastcgi-php.conf;
  37. include fastcgi_params;
  38.  
  39. fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
  40. fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
  41. }
  42.  
  43. location /phpmyadmin {
  44. root /usr/share/;
  45. index index.php index.html index.htm;
  46. location ~ ^/phpmyadmin/(.+\.php)$ {
  47. try_files $uri =404;
  48. root /usr/share/;
  49. fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
  50. fastcgi_index index.php;
  51. fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
  52. include fastcgi_params;
  53. }
  54. location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
  55. root /usr/share/;
  56. }
  57. }
  58.  
  59. location /phpMyAdmin {
  60. rewrite ^/* /phpmyadmin last;
  61. }
  62.  
  63. }
  64. ############ End of nginx vhost ##############
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement