SHARE
TWEET

Untitled

a guest Feb 20th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ## Requirements
  2. - PHP >= 7.2
  3. - Composer >= 1.2.1
  4. - Node.js >= 10.2
  5. - npm >= 6.1
  6. - pm2
  7.  
  8. ## Installation
  9. ### Server Requirements
  10. login to your favorite ssh as root / administrator user
  11. ```bash
  12. # install pm2 process manager
  13. sudo npm install -g pm2
  14. ```
  15. ### Backend Installation
  16. login to your favorite ssh as www-data, or public user
  17. ```bash
  18. # move to domain directory
  19. cd /home/runcloud/domain
  20.  
  21. # clone repository
  22. git init
  23. git remote add -t \* -f origin https://github.com/pijarajip/agc-wallpaper.git
  24. git checkout master
  25.  
  26. # install backend dependencies
  27. composer agc-install
  28.  
  29. # generate fake users
  30. php artisan agc:generate-users 50
  31. ```
  32. Now you can edit some config files
  33. - .env
  34. - config/agc.php
  35. - storage/app/inject-keywords.txt
  36. - storage/app/blockade/*
  37. - storage/app/templates/*
  38.  
  39. ### Theme Installation
  40. No theme installed by default, you must manually clone exists repository theme or upload your own theme to themes directory.
  41. Here is command to clone default theme from https://github.com/agc-wallpaper-theme/default
  42. ```bash
  43. # move to themes directory
  44. cd /home/runcloud/domain/themes
  45.  
  46. # clone theme
  47. git clone https://github.com/agc-wallpaper-theme/default.git default
  48.  
  49. # move to theme "default" directory
  50. cd default
  51.  
  52. # install theme dependencies
  53. npm install
  54.  
  55. # build theme
  56. npm run build
  57.  
  58. # set nodejs server running in background
  59. pm2 startup
  60. pm2 start npm --name "agc-wallpaper" -- run start
  61. pm2 save
  62. ```
  63.  
  64. ### Nginx Proxy
  65. This script is running both php and nodeJs, so, we must set nodeJs running as reverse proxy in nginx.
  66.  
  67. Open your nginx config file, and search code nearly with:
  68.  
  69. ```
  70. location / {
  71.     include /etc/nginx-rc/extra.d/bernardilibri.location.root.*.conf;
  72.     try_files $uri $uri/ /index.php$is_args$args;
  73. }
  74. ```
  75. And replace with
  76. ```
  77. location ^~ /api {
  78.     try_files $uri $uri/ /index.php$is_args$args;
  79. }
  80. location / {
  81.     include /etc/nginx-rc/extra.d/bernardilibri.location.root.*.conf;
  82.     try_files $uri $uri.html $uri/index.html @nuxt;
  83. }
  84. location ^~ /_nuxt {
  85.     try_files $uri $uri.html $uri/index.html @nuxt;
  86. }
  87. location @nuxt {
  88.     proxy_pass                          http://localhost:3000;
  89.     proxy_redirect                      off;
  90.     proxy_set_header Host               \$host;
  91.     proxy_set_header X-Real-IP          \$remote_addr;
  92.     proxy_set_header X-Forwarded-For    \$proxy_add_x_forwarded_for;
  93.     proxy_set_header X-Forwarded-Proto  \$scheme;
  94.     proxy_read_timeout                  1m;
  95.     proxy_connect_timeout               1m;
  96. }
  97. ```
  98.  
  99. ### Optimize BackEnd
  100. We need to generate config and route cache to optimize backend process
  101. ```bash
  102. # generate config cache
  103. php artisan config:cache
  104.  
  105. # generate route cache
  106. php artisan route:cache
  107. ```
  108.  
  109. ### Notes
  110. Everytime you edit .env file in #FrontEnd Environment section, you must rebuild your theme and restrat pm2 process manager
  111. ```bash
  112. # move to theme directory
  113. cd /home/runcloud/domain/themes/default
  114.  
  115. # build theme
  116. npm run build
  117.  
  118. # restart pm2
  119. pm2 restart agc-wallpaper
  120. ```
  121.  
  122. Everytime you edit .env file in #BackEnd Environment section, and config/agc.php, you must regenerate config cache
  123. ```bash
  124. php artisan config:cache
  125. ```
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top