Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The browser shows 403 Forbidden -- nginx/1.18.0 after I follow the Development with Gulp 2.1 Back and front-end stuff #4

Open
Jacob9Audio opened this issue Apr 6, 2023 · 3 comments

Comments

@Jacob9Audio
Copy link

Hi
I flash moodeaudio image 2023-01-20-moode-r825-lite.img on and follow the Development with Gulp 2.1 Back and front-end stuff.
https://github.com/moode-player/docs/blob/main/development_with_gulp.md#21-back-and-front-end-stuff

Below is my board configuration:
Linux: 5.15.84-v7+ #1613 | armv7l (32-bit) | DebOS: 11.6
Model: Pi-3B 1.2 1GB
Audio: Pi HDMI 1

The instruction command I run on remote SSH as below:
cd ~
sudo apt-get update
sudo apt-get -y install npm
git clone https://github.com/moode-player/moode.git
cd moode
npm ci
node_modules/.bin/gulp build
node_modules/.bin/gulp deploy --test
sudo mv /var/www /var/www.org
sudo node_modules/.bin/gulp deploy
moodeutl -r

After browse the http://remoteIP/, the browser show 403 Forbidden -- nginx/1.18.0.

I tried to enable the log level to debug for Nginx, the log shows as below.
[20-Jan-2023 16:09:48] NOTICE: fpm is running, pid 458
[20-Jan-2023 16:09:48] NOTICE: ready to handle connections
[20-Jan-2023 16:09:48] NOTICE: systemd monitor interval set to 10000ms
[06-Apr-2023 04:28:44] NOTICE: Terminating ...
[06-Apr-2023 04:28:44] NOTICE: exiting, bye-bye!
[06-Apr-2023 04:28:44] NOTICE: fpm is running, pid 6543
[06-Apr-2023 04:28:44] NOTICE: ready to handle connections
[06-Apr-2023 04:28:44] NOTICE: systemd monitor interval set to 10000ms
[06-Apr-2023 05:05:20] NOTICE: Terminating ...
[06-Apr-2023 05:05:20] NOTICE: exiting, bye-bye!
[06-Apr-2023 05:05:28.124285] DEBUG: pid 444, fpm_scoreboard_init_main(), line 38: got clock tick '100'
[06-Apr-2023 05:05:28.126467] DEBUG: pid 444, fpm_signals_init_main(), line 221: Unblocking all signals
[06-Apr-2023 05:05:28.126892] DEBUG: pid 444, fpm_event_init_main(), line 353: event module is epoll and 1 fds have been reserved
[06-Apr-2023 05:05:28.127111] NOTICE: pid 444, fpm_init(), line 83: fpm is running, pid 444
[06-Apr-2023 05:05:28.127149] DEBUG: pid 444, fpm_children_make(), line 407: blocking signals before child birth
[06-Apr-2023 05:05:28.129114] DEBUG: pid 444, fpm_children_make(), line 431: unblocking signals, child born
[06-Apr-2023 05:05:28.129324] DEBUG: pid 444, fpm_children_make(), line 437: [pool www] child 486 started
[06-Apr-2023 05:05:28.129372] DEBUG: pid 444, fpm_children_make(), line 407: blocking signals before child birth
[06-Apr-2023 05:05:28.131511] DEBUG: pid 444, fpm_children_make(), line 431: unblocking signals, child born
[06-Apr-2023 05:05:28.131749] DEBUG: pid 444, fpm_children_make(), line 437: [pool www] child 487 started
[06-Apr-2023 05:05:28.131839] DEBUG: pid 444, fpm_event_loop(), line 382: 68196 bytes have been reserved in SHM
[06-Apr-2023 05:05:28.131873] NOTICE: pid 444, fpm_event_loop(), line 383: ready to handle connections
[06-Apr-2023 05:05:28.132229] DEBUG: pid 444, fpm_systemd_heartbeat(), line 68: have notify start to systemd
[06-Apr-2023 05:05:28.132283] NOTICE: pid 444, fpm_systemd_heartbeat(), line 75: systemd monitor interval set to 10000ms
[06-Apr-2023 05:05:29.133398] DEBUG: pid 444, fpm_pctl_perform_idle_server_maintenance(), line 382: [pool www] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1
[06-Apr-2023 05:05:30.134574] DEBUG: pid 444, fpm_pctl_perform_idle_server_maintenance(), line 382: [pool www] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1

Could you help to comment if any way I can enable more log or how to debug this problem?

Thanks.

Jacob

@Jacob9Audio
Copy link
Author

Found there are missing files index.php and others, apl-config.php, bkp-config.php, blu-config.php, cdsp-config.php, chp-config.php, eqg-config.php, eqp-config.php, gpio-config.php, index.php, inp-config.php, lib-config.php...
missing_files
Keep working on why the deploy not working as expected.

Thanks.

Jacob

@moodeaudio
Copy link
Contributor

The command node_modules/.bin/gulp deploy --test should create and populate a dir structure like below

moose
  build
    dist
      cache
      develop
      var
        www

Copy moode/build/dist/var/www/* to the target /var/www dir

@Jacob9Audio
Copy link
Author

Hi Tim,
I have tried the copy works. Thanks for the help!!

Go deeper inside the glupfile.js. I found

                  ...
                  // exclude generated content:
                  ,'!'+pkg.app.src+'/index.html'
                  ,'!'+pkg.app.src+'/templates/indextpl.min.html'
                  ,'!'+pkg.app.src+'/templates/indextpl.html'
                  ,'!'+pkg.app.src+'/header.php'
                  ,'!'+pkg.app.src+'/footer.php'
                  ,'!'+pkg.app.src+'/footer.min.php'
                  ,'!'+pkg.app.src+'/index.php'
                  ,'!'+pkg.app.src+'/*-config.php'
                  ...

=====================

It should in purpose to exclude those files for backend job because the deployment is for css and js changes.
So I just try to follow the same flow and just skip this command ==> "sudo mv /var/www /var/www.org"
And it works fine without the manual copy.

May I confirm if skip "sudo mv /var/www /var/www.org" is a correct way or I still need to manual copy the dist/.../www to /var/www?

Thanks again~~

Jacob

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants