not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.1 KiB

  1. Server
  2. ======
  3. Running a local server
  4. ----------------------
  5. [Clone the server](https://github.com/tchx84/turtleblocksjs-server) and
  6. [change the api key]
  7. (https://github.com/tchx84/turtleblocksjs-server/blob/master/settings.py#L26)
  8. to your TurtleJS key.
  9. ##### Linux:
  10. Install apache and turtleblocksjs.
  11. **Setup a link to** `/var/www/html`
  12. ```
  13. sudo apt-get install apache2
  14. cd /var/www
  15. sudo ln -s /home/path/to/app/ html
  16. ```
  17. ##### OSX(10.10+):
  18. Apache 2.2 is already installed at `/etc/apache2`
  19. **Setup a link to** `/Library/WebServer/Documents`
  20. ```
  21. cd /Library/WebServer/
  22. sudo ln -s /home/path/to/app/ Documents
  23. ```
  24. ##### Linux:
  25. Then, enable the 'proxy' modules in apache.
  26. ```
  27. cd /etc/apache2/mods-enabled
  28. sudo ln -s ../mods-available/proxy* .
  29. sudo ln -s ../mods-available/xml2enc.load .
  30. sudo ln -s ../mods-available/slotmem_* .
  31. ```
  32. Remove the alias module.
  33. ```
  34. sudo unlink alias.conf
  35. sudo unlink alias.load
  36. ```
  37. ##### OSX(10.10+):
  38. Enable Proxy modules and disable alias module as in linux version. Main Config with module configurations is located in `/etc/apache2/httpd.conf`
  39. Apache TurtleJS Config
  40. ----------------------
  41. ##### Linux:
  42. * Copy the code below into `/etc/apache2/sites-enabled/turtlejs.conf`
  43. ##### OSX(10.10+):
  44. * Copy the code below into `/private/etc/apache2/other/turtlejs.conf`
  45. * If the turtlejs.conf is not loaded and is not working then add the line `/private/etc/apache2/other/turtlejs.conf` in **httpd.conf**
  46. * In the code below change the document root to `/Library/WebServer/Documents`
  47. ```
  48. <VirtualHost *:80 *:443>
  49. DocumentRoot /var/www/html
  50. ProxyPreserveHost On
  51. ProxyPass /server http://127.0.0.1:3000
  52. ProxyPassReverse /server http://127.0.0.1:3000
  53. <Location /server>
  54. Order allow,deny
  55. Allow from all
  56. </Location>
  57. </Virtualhost>
  58. ```
  59. Then, restart apache.
  60. ##### Linux:
  61. ```sudo service apache2 restart```
  62. ##### OSX(10.10+):
  63. `sudo apachectl start` / `sudo apachectl restart`
  64. Now, you need to run the TurtleJS server.
  65. ```
  66. cd /home/path/to/server/
  67. ./server.py
  68. ```
  69. If everything is ok in your browser you should able to access to
  70. <pre>localhost</pre> and see TurtleJS instance.