mirror of
https://github.com/aelve/guide.git
synced 2025-01-03 11:02:24 +03:00
[INSTALL] Update for Stack
This commit is contained in:
parent
4dad1acbef
commit
1f714610eb
27
INSTALL.md
27
INSTALL.md
@ -5,7 +5,7 @@ The `state/` directory contains the database. You can download the current datab
|
||||
$ git clone https://github.com/aelve/guide-database
|
||||
$ mv guide-database state
|
||||
|
||||
The `config.json` file contains the config (it will be created at the 1st start). There are 4 settings so far:
|
||||
The `config.json` file contains the config (it will be created at the 1st start). There are 5 settings so far:
|
||||
|
||||
* `admin-password` is the password for the admin panel (at `/admin`). Leave it empty if you don't want any password.
|
||||
|
||||
@ -15,11 +15,12 @@ The `config.json` file contains the config (it will be created at the 1st start)
|
||||
|
||||
* `prerender` enables prerendering pages when the server starts. By default it's disabled (because it's annoying during development).
|
||||
|
||||
* `discuss-url` adds a “discuss this site” link under the header. You can leave it as `null`.
|
||||
|
||||
# How to install locally
|
||||
|
||||
$ cabal install --only-dependencies
|
||||
$ cabal build
|
||||
$ dist/build/guide/guide
|
||||
$ stack build
|
||||
$ stack exec guide
|
||||
|
||||
And go to <http://localhost:8080>. The status page is available at <http://localhost:5050>; the admin page, at <http://localhost:8080/admin>.
|
||||
|
||||
@ -27,25 +28,15 @@ And go to <http://localhost:8080>. The status page is available at <http://local
|
||||
|
||||
I'm going to use Digitalocean and Ubuntu, but you can use anything else.
|
||||
|
||||
Create a droplet with Ubuntu. Install GHC:
|
||||
Create a droplet with Ubuntu. Install Stack (this command will import a GPG key, add Stack's repository, and run `apt-get`):
|
||||
|
||||
$ add-apt-repository ppa:hvr/ghc
|
||||
$ apt-get update
|
||||
$ apt-get install ghc-7.10.3 cabal-install-1.22
|
||||
|
||||
Add cabal-install, GHC, and the cabal dir to `PATH` by adding
|
||||
|
||||
/opt/cabal/1.22/bin:/opt/ghc/7.10.3/bin:$HOME/.cabal/bin
|
||||
|
||||
to `PATH` in `~/.bashrc` and then doing `source ~/.bashrc`.
|
||||
$ curl -sSL https://get.haskellstack.org/ | sh
|
||||
|
||||
Clone and build `guide`:
|
||||
|
||||
$ git clone https://github.com/aelve/guide
|
||||
$ cd guide
|
||||
$ cabal update
|
||||
$ cabal install --dependencies-only
|
||||
$ cabal build
|
||||
$ stack build --no-test --no-bench --copy-bins
|
||||
|
||||
Make a new subdomain in Apache. For me, it means writing this to `/etc/apache2/sites-available/guide.conf`:
|
||||
|
||||
@ -91,7 +82,7 @@ start on filesystem or runlevel [2345]
|
||||
stop on runlevel [!2345]
|
||||
chdir /root/guide
|
||||
env LC_ALL=en_US.UTF-8
|
||||
exec dist/build/guide/guide
|
||||
exec /root/.local/bin/guide
|
||||
~~~
|
||||
|
||||
Start the daemon:
|
||||
|
Loading…
Reference in New Issue
Block a user