<commit_before># Installation instructions

Server runs on Linux, OS X, BSD and Windows.


If you just want to check out OS.js without building or running a server, I provide a minimalistic [nightly build](http://osjsv2.0o.no/OS.js-v2-minimal-nightly.zip).
Please note that it might be unstable, also Networking and Filesystem functions is disabled.

# Dependencies

You just need **node** and **npm**. Install them with your package manager or download the [official installer](https://nodejs.org).

# Installation

To easily apply updates and other changes, I recommend using **git** to download instead of using a zip-file (or the automated installer and then build manually).

## Automated

### NIX

Simply run `curl -sS http://os.js.org/installer | sh`

### Windows

Download and run `http://os.js.org/installer.exe`.

### Vagrant

A [Vagrant](https://www.vagrantup.com/) file is also included so you can easily set up a development or testing environment in a Virtual Machine.

Just use [this configuration file](https://raw.githubusercontent.com/andersevenrud/OS.js-v2/master/Vagrantfile).

## Manual

This only requires a few simple steps.

```shell
# Install grunt (Windows users: Run "cmd" as Administrator for this without sudo in front)
$ sudo npm install -g grunt-cli

# In this example we clone with git, you can also download the zip-file from github and extract it.
$ git clone https://github.com/andersevenrud/OS.js-v2.git

$ cd OS.js-v2
$ npm install
$ grunt --force
```

[![asciicast](https://asciinema.org/a/8t4w7pgzsq0xdwo3bhdnm8dpx.png)](https://asciinema.org/a/8t4w7pgzsq0xdwo3bhdnm8dpx)

If building was successful, you can now start up a server.

## Setting up a server

Make sure the _VFS_ directories in `vfs/` are given the same permissions as the web-servers running user.

**Windows users:** dist-dev does not work at the moment because it relies on symbolic links intended for POSIX type systems.

## Standalone

You can run OS.js in `file://` (locally in browser), but this will disable any server-call and filesystem functions.

Just open `dist/index.html` after you build.

## Node

* Production: `./bin/start-node-dist.sh` or `bin\win-start-node-dist`
* Developement: `./bin/start-node-dev.sh` or `bin\win-start-node-dev`

## PHP5

### Internal Web-server for PHP 5.4+

* Production: `./bin/start-php-dist.sh`
* Developement: `./bin/start-php-dev.sh`

### Apache

Run `grunt apache-vhost` to generate config file (or look in doc/ for example)

*Note* You have to enable mod_rewrite for Apache and make sure htaccess is allowed.
<commit_msg>INSTALL: Clarify a section<commit_after># Installation instructions

Server runs on Linux, OS X, BSD and Windows.


If you just want to check out OS.js without building or running a server, I provide a minimalistic [nightly build](http://osjsv2.0o.no/OS.js-v2-minimal-nightly.zip).
Please note that it might be unstable, also Networking and Filesystem functions is disabled.

# Dependencies

You just need **node** and **npm**. Install them with your package manager or download the [official installer](https://nodejs.org).

# Installation

To easily apply updates and other changes, I recommend using **git** to download instead of using a zip-file (or the automated installer and then build manually).

## Automated

### NIX

Simply run `curl -sS http://os.js.org/installer | sh`

### Windows

Download and run `http://os.js.org/installer.exe`.

### Vagrant

A [Vagrant](https://www.vagrantup.com/) file is also included so you can easily set up a development or testing environment in a Virtual Machine.

Just use [this configuration file](https://raw.githubusercontent.com/andersevenrud/OS.js-v2/master/Vagrantfile).

## Manual

This only requires a few simple steps.

```shell
# Install grunt (Windows users: Run "cmd" as Administrator for this without sudo in front)
$ sudo npm install -g grunt-cli

# In this example we clone with git, you can also download the zip-file from github and extract it.
$ git clone https://github.com/andersevenrud/OS.js-v2.git

$ cd OS.js-v2
$ npm install
$ grunt --force
```

[![asciicast](https://asciinema.org/a/8t4w7pgzsq0xdwo3bhdnm8dpx.png)](https://asciinema.org/a/8t4w7pgzsq0xdwo3bhdnm8dpx)

If building was successful, you can now start up a server.

## Setting up a server

Make sure the _VFS_ directories in `vfs/` are given the same permissions as the web-servers running user.

**Windows users:** *development environment* (aka dist-dev) does not work at the moment because it relies on symbolic links intended for POSIX type systems.

## Standalone

You can run OS.js in `file://` (locally in browser), but this will disable any server-call and filesystem functions.

Just open `dist/index.html` after you build.

## Node

* Production: `./bin/start-node-dist.sh` or `bin\win-start-node-dist`
* Developement: `./bin/start-node-dev.sh` or `bin\win-start-node-dev`

## PHP5

### Internal Web-server for PHP 5.4+

* Production: `./bin/start-php-dist.sh`
* Developement: `./bin/start-php-dev.sh`

### Apache

Run `grunt apache-vhost` to generate config file (or look in doc/ for example)

*Note* You have to enable mod_rewrite for Apache and make sure htaccess is allowed.

{'fraction_non_alphanumeric': 0.1099133782483157, 'fraction_numerical': 0.008084696823869105, 'mean_word_length': 4.129318854886476, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7092073', 'n_tokens_mistral': 1669, 'n_tokens_neox': 1620, 'n_words': 628}