Sorry, I ran all the above commands successfully (the last one had a . missing and I added that). But still I get "Not Found" error on the URL. And the other URL is still working. Pasting all commands executed with a periodic ls -l
. I have also found one peculiar thing: the app.R runs in the parent dir while fails inside any subdir of the main dir nlp
.
shiny apps run under shiny user not rstudio user that is the problem
You can reset your shiny permissions with this
sudo groupadd shiny-apps
sudo usermod -aG shiny-apps #your-user#
sudo usermod -aG shiny-apps shiny
cd /srv/shiny-server
sudo chown -R #your-user#:shiny-apps .
sudo chmod g+w .
sudo chmod g+s
Replace #your-user# with your actual user name
[/quote]
studio@ip-172-31-30-19:~/nlp$ sudo usermod -aG shiny-apps shiny
rstudio@ip-172-31-30-19:~/nlp$ cd /srv/shiny-server
rstudio@ip-172-31-30-19:/srv/shiny-server$ ls -l
total 0
lrwxrwxrwx 1 root root 38 Oct 15 2017 index.html -> /opt/shiny-server/samples/welcome.html
lrwxrwxrwx 1 root root 37 Oct 15 2017 sample-apps -> /opt/shiny-server/samples/sample-apps
rstudio@ip-172-31-30-19:/srv/shiny-server$ sudo chown -R rstudio:shiny-apps .
rstudio@ip-172-31-30-19:/srv/shiny-server$ ls -l
total 0
lrwxrwxrwx 1 rstudio shiny-apps 38 Oct 15 2017 index.html -> /opt/shiny-server/samples/welcome.html
lrwxrwxrwx 1 rstudio shiny-apps 37 Oct 15 2017 sample-apps -> /opt/shiny-server/samples/sample-apps
rstudio@ip-172-31-30-19:/srv/shiny-server$ sudo chmod g+w .
rstudio@ip-172-31-30-19:/srv/shiny-server$ ls -l
total 0
lrwxrwxrwx 1 rstudio shiny-apps 38 Oct 15 2017 index.html -> /opt/shiny-server/samples/welcome.html
lrwxrwxrwx 1 rstudio shiny-apps 37 Oct 15 2017 sample-apps -> /opt/shiny-server/samples/sample-apps
rstudio@ip-172-31-30-19:/srv/shiny-server$ sudo chmod g+s
chmod: missing operand after ‘g+s’
Try 'chmod --help' for more information.
rstudio@ip-172-31-30-19:/srv/shiny-server$ sudo chmod g+s .
rstudio@ip-172-31-30-19:/srv/shiny-server$ ls -l
total 0
lrwxrwxrwx 1 rstudio shiny-apps 38 Oct 15 2017 index.html -> /opt/shiny-server/samples/welcome.html
lrwxrwxrwx 1 rstudio shiny-apps 37 Oct 15 2017 sample-apps -> /opt/shiny-server/samples/sample-apps
Update 1:
And by now I have experimented with all possible combinations of directory moving the app.R. And the results are very interesting.
The app.R runs in all combinations except when it is inside a subdirectory of nlp
directory.
The ls -l
is as follows.
rstudio@ip-172-31-30-19:~$ ls -l
total 24
drwxr-xr-x 6 rstudio rstudio 4096 Nov 1 02:59 embassy
drwxrwxr-x 18 rstudio rstudio 4096 Dec 9 12:52 nlp
drwxr-xr-x 4 rstudio rstudio 4096 Jun 16 16:26 nsdl
drwxr-xr-x 3 rstudio rstudio 4096 Dec 9 19:47 R
drwxr-xr-x 6 rstudio rstudio 4096 Dec 9 17:05 ShinyApps
-rw-r--r-- 1 rstudio rstudio 2141 Oct 15 2017 Welcome.R
The app.R works from directory embassy, nlp, nsdl, R and ShinyApps. So 100% working at level -1 of depth.
The app.R works at level-2 depth in all other directories except the directory nlp
.
This seems quite a weird problem.