Skip to content

Commit

Permalink
Remove dependency on external http server for local viewing
Browse files Browse the repository at this point in the history
  • Loading branch information
zamaudio committed May 5, 2020
1 parent 13bd0fa commit 182a1f8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 20 deletions.
25 changes: 5 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ notes just in case you decide to anyway.
### Run it locally

You may want the manual available on a machine that doesn't have constant
internet access. You will need `git`, and `python3` installed.
internet access. You will need `git`, `python3` and `cherrypy` python module installed.

1. Download code and build manual

Expand All @@ -91,29 +91,14 @@ internet access. You will need `git`, and `python3` installed.
./build.py
```

2. Install and configure a web server on your machine. Any web server should
work, Apache, nginx, etc... The following steps are for nginx, using another
server means following the same procedure for the server you decide to use.

3. Install [nginx](http://wiki.nginx.org/Install)

4. Configure nginx server block in `/etc/nginx/sites-available/default`

2. Run the following:
```
server {
listen 80;
server_name localhost;
root ...path_to_.../ardour-manual/website;
index index.html;
}
./servit.py
```

5. Restart nginx server

service nginx restart
3. The manual will now be available at http://127.0.0.1:8080

6. The manual will now be available at http://localhost
(Ctrl-c to quit the server).

### Helper scripts: `implode` and `explode`

Expand Down
22 changes: 22 additions & 0 deletions servit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/python3
#
# Script to locally host the manual as a simple http site

import os
import cherrypy

PATH = os.path.abspath(os.path.dirname(__file__))

class Root(object):
pass

cherrypy.tree.mount(Root(), '/', config={
'/': {
'tools.staticdir.on': True,
'tools.staticdir.dir': os.path.join(PATH, 'website'),
'tools.staticdir.index': 'index.html',
},
})

cherrypy.engine.start()
cherrypy.engine.block()

0 comments on commit 182a1f8

Please sign in to comment.