Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Requirements
- - PHP >= 7.2
- - Composer >= 1.2.1
- - Node.js >= 10.2
- - npm >= 6.1
- - pm2
- ## Installation
- ### Server Requirements
- login to your favorite ssh as root / administrator user
- ```bash
- # install pm2 process manager
- sudo npm install -g pm2
- ```
- ### Backend Installation
- login to your favorite ssh as www-data, or public user
- ```bash
- # move to domain directory
- cd /home/runcloud/domain
- # clone repository
- git init
- git remote add -t \* -f origin https://github.com/pijarajip/agc-wallpaper.git
- git checkout master
- # install backend dependencies
- composer agc-install
- # generate fake users
- php artisan agc:generate-users 50
- ```
- Now you can edit some config files
- - .env
- - config/agc.php
- - storage/app/inject-keywords.txt
- - storage/app/blockade/*
- - storage/app/templates/*
- ### Theme Installation
- No theme installed by default, you must manually clone exists repository theme or upload your own theme to themes directory.
- Here is command to clone default theme from https://github.com/agc-wallpaper-theme/default
- ```bash
- # move to themes directory
- cd /home/runcloud/domain/themes
- # clone theme
- git clone https://github.com/agc-wallpaper-theme/default.git default
- # move to theme "default" directory
- cd default
- # install theme dependencies
- npm install
- # build theme
- npm run build
- # set nodejs server running in background
- pm2 startup
- pm2 start npm --name "agc-wallpaper" -- run start
- pm2 save
- ```
- ### Nginx Proxy
- This script is running both php and nodeJs, so, we must set nodeJs running as reverse proxy in nginx.
- Open your nginx config file, and search code nearly with:
- ```
- location / {
- include /etc/nginx-rc/extra.d/bernardilibri.location.root.*.conf;
- try_files $uri $uri/ /index.php$is_args$args;
- }
- ```
- And replace with
- ```
- location ^~ /api {
- try_files $uri $uri/ /index.php$is_args$args;
- }
- location / {
- include /etc/nginx-rc/extra.d/bernardilibri.location.root.*.conf;
- try_files $uri $uri.html $uri/index.html @nuxt;
- }
- location ^~ /_nuxt {
- try_files $uri $uri.html $uri/index.html @nuxt;
- }
- location @nuxt {
- proxy_pass http://localhost:3000;
- proxy_redirect off;
- proxy_set_header Host \$host;
- proxy_set_header X-Real-IP \$remote_addr;
- proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto \$scheme;
- proxy_read_timeout 1m;
- proxy_connect_timeout 1m;
- }
- ```
- ### Optimize BackEnd
- We need to generate config and route cache to optimize backend process
- ```bash
- # generate config cache
- php artisan config:cache
- # generate route cache
- php artisan route:cache
- ```
- ### Notes
- Everytime you edit .env file in #FrontEnd Environment section, you must rebuild your theme and restrat pm2 process manager
- ```bash
- # move to theme directory
- cd /home/runcloud/domain/themes/default
- # build theme
- npm run build
- # restart pm2
- pm2 restart agc-wallpaper
- ```
- Everytime you edit .env file in #BackEnd Environment section, and config/agc.php, you must regenerate config cache
- ```bash
- php artisan config:cache
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement