Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:PecanProject/pecan into dataone-…
Browse files Browse the repository at this point in the history
…download-util
  • Loading branch information
LiamBurke24 committed Aug 16, 2017
2 parents 584b0d0 + c230fe8 commit 508e96c
Show file tree
Hide file tree
Showing 10 changed files with 434 additions and 193 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ For more information about this file see also [Keep a Changelog](http://keepacha

## [Unreleased]

### Fixes
- Fixed remote code execution #1545

## [1.5.10] - Prerelease
### Added
- Added PEcAn.utils::download.file() to allow for use of alternative FTP programs
Expand Down
2 changes: 1 addition & 1 deletion book_source/_bookdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ rmd_files: [
"installation/Installing-PEcAn-Ubuntu.Rmd",
"installation/Installing-PEcAn-models.Rmd",
"installation/PEcAn-in-the-Cloud.Rmd",
"installation/centos.shiny.Rmd",
"installation/shiny.Rmd",
"installation/thredds.Rmd",
"misc/faq.Rmd"
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,14 @@
authors - Alexey Shiklomanov
- Rob Kooper

**NOTE: Instructions are only tested for CentOS 6.5.**
**NOTE: Instructions are only tested for CentOS 6.5 and Ubuntu 16.04**
**NOTE: Pretty much every step here requires root access.**

## Install the Shiny R package and Shiny server

The `shiny` R package can be installed directly in R via `install.packages("shiny")`.
Follow the instructions on the [Shiny download page][shiny-download] for the operating system you are using.

Download and install the Shiny server binary ([link](https://www.rstudio.com/products/shiny/download-server)).

## CentOS

```
wget https://download3.rstudio.org/centos5.9/x86_64/shiny-server-1.4.2.786-rh5-x86_64.rpm
sudo yum install --nogpgcheck shiny-server-1.4.2.786-rh5-x86_64.rpm
```

## Ubuntu

NOTE: The additional `gdebi` dependence may be optional and `dpkg` may work just fine, but I haven't tested this out.

```
$ sudo apt-get install gdebi-core
$ wget https://download3.rstudio.org/ubuntu-12.04/x86_64/shiny-server-1.4.2.786-amd64.deb
$ sudo gdebi shiny-server-1.4.2.786-amd64.deb
```
[shiny-download]: https://www.rstudio.com/products/shiny/download-server/

## Modify the shiny configuration file

Expand Down Expand Up @@ -77,35 +60,90 @@ server {
}
```

## Set the httpd proxy
If you change the configuration, for example to add a new location, you will need to restart Shiny server.
*If you are setting up a new instance of Shiny*, skip this step and continue with the guide, since there are a few more steps to get Shiny working.
*If there is an instance of Shiny already running*, you can restart it with:

Create a file `/etc/httpd/conf.d/shiny.conf` containing the following proxy settings:
```
## On CentOS
sudo service shiny-server stop
sudo service shiny-server start
## On Ubuntu
sudo systemctl stop shiny-server.service
sudo systemctl start shiny-server.service
```

## Set the Apache proxy

Create a file with the following name, based on the version of the operating system you are using:

* Ubuntu 16.04 (pecan1, pecan2, test-pecan) -- `/etc/apache2/conf-available/shiny.conf`
* CentOS 6.5 (psql-pecan) -- `/etc/httpd/conf.d/shiny.conf`

Into this file, add the following:

```
ProxyPass /shiny/ http://localhost:3838/
ProxyPassReverse /shiny/ http://localhost:3838/
RedirectMatch permanent ^/shiny$ /shiny/
```

## Create a symbolic link to the shiny server service
### **Ubuntu only:** Enable the new shiny configuration

```
sudo ln -s /opt/shiny-server/config/init.d/redhat/shiny-server /etc/init.d
sudo a2enconf shiny
```

## Start the shiny server and restart httpd
This will create a symbolic link to the newly created `shiny.conf` file inside the `/etc/apache2/conf-enabled` directory.
You can do `ls -l /etc/apache2/conf-enabled` to confirm that this worked.

## Enable and start the shiny server, and restart apache

### On CentOS

```
sudo ln -s /opt/shiny-server/config/init.d/redhat/shiny-server /etc/init.d
sudo service shiny-server stop
sudo service shiny-server start
sudo service httpd restart
```

You can check that Shiny is running with `service shiny-server status`.

### On Ubuntu

Enable the Shiny server service.
This will make sure Shiny runs automatically on startup.

```
sudo systemctl enable shiny-server.service
```

Restart Apache.

```
sudo apachectl restart
```

Start the Shiny server.

```
sudo systemctl start shiny-server.service
```

If there are problems, you can stop the `shiny-server.service` with...

```
sudo systemctl stop shiny-server.service
```

...and then use `start` again to restart it.


## Troubleshooting

Refer to the log files for shiny (`/var/log/shiny-server.log`) and httpd (`/var/log/httpd/error-log`).
Refer to the log files for shiny (`/var/log/shiny-server.log`) and httpd (on CentOS, `/var/log/httpd/error-log`; on Ubuntu, `/var/log/apache2/error-log`).



Expand Down
Loading

0 comments on commit 508e96c

Please sign in to comment.