Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. https://github.com/zeropingheroes/lancache
  2.  
  3. FIRST. Edit the VM and make two share mounts.
  4.  
  5. sudo nano /etc/fstab
  6.  
  7. nginx /etc/nginx/ 9p trans=virtio,version=9p2000.L,_netdev,rw 0 0
  8. nginx-cache /var/lancache/cache/ 9p trans=virtio,version=9p2000.L,_netdev,rw 0 0
  9.  
  10. Save and reboot. Use "df" to see if it worked, you should see the shares listed
  11.  
  12. Enter an interative superuser shell:
  13.  
  14. sudo -i
  15.  
  16. Create the Nginx config directory:
  17.  
  18. mkdir /etc/nginx && cd /etc/nginx
  19.  
  20. Clone the zeropingheroes/lancache repository into it:
  21.  
  22. git clone https://github.com/zeropingheroes/lancache.git
  23.  
  24. cd lancache
  25. find . -maxdepth 1 -exec mv {} .. \; to move everything up one folder
  26. cd .. to move up one folder
  27. sudo rm -rf lancache to remove the now empty lancache folder
  28.  
  29. Make all the scripts in the install directory executable:
  30.  
  31. chmod -R +x /etc/nginx/install/
  32.  
  33. Compile Nginx from source:
  34.  
  35. sudo /etc/nginx/install/compile-nginx.sh
  36.  
  37. Prepare directories:
  38.  
  39. sudo /etc/nginx/install/prepare-directories.sh
  40.  
  41. For whatever reason this script doesn't create a nginx.service file so make one,
  42.  
  43. sudo nano /lib/systemd/system/nginx.service
  44.  
  45. place this in the file:
  46.  
  47. [Unit]
  48. Description=The NGINX HTTP and reverse proxy server
  49. After=syslog.target network.target remote-fs.target nss-lookup.target
  50.  
  51. [Service]
  52. Type=forking
  53. PIDFile=/run/nginx.pid
  54. ExecStartPre=/usr/local/bin/nginx -t
  55. ExecStart=/usr/local/bin/nginx
  56. ExecReload=/bin/kill -s HUP $MAINPID
  57. ExecStop=/bin/kill -s QUIT $MAINPID
  58. PrivateTmp=true
  59.  
  60. [Install]
  61. WantedBy=multi-user.target
  62.  
  63. Install Nginx as a service to start at boot:
  64.  
  65. /etc/nginx/install/install-nginx-service.sh
  66.  
  67. Start Nginx:
  68.  
  69. systemctl start nginx
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement