Advertisement
opexxx

hsn2-webgui_install

Nov 25th, 2013
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.30 KB | None | 0 0
  1. == install on webserver ==
  2. -- install MySQL
  3. -- install apache
  4. -- install mod_wsgi for apache
  5. -- install couchdb (if it's not installed for HSN2 framework yet)
  6.  
  7. == on Ubuntu the following was required before proceding ==
  8. apt-get install python-dev
  9. apt-get install libmysqlclient-dev
  10.  
  11. == install python packages ==
  12. # packages can also be installed using setuptools (easy_install)
  13. pip install Django==1.4.6
  14. pip install MySQL-python
  15. pip install pika
  16. # pycrypto is required by paramiko
  17. pip install pycrypto
  18. pip install paramiko
  19. pip install CouchDB
  20. pip install APScheduler
  21. pip install croniter
  22.  
  23. -- install dateutil for python 2.X
  24. # first check which version of dateutil will be installed,
  25. # on some occasions it will install the python 3.X version of dateutil
  26. # if so install from source:
  27. wget http://labix.org/download/python-dateutil/python-dateutil-1.5.tar.gz
  28. # unpack and cd to python-dateutil-1.5
  29. python setup.py install
  30. # otherwise pip or easy_install can be used (pip install python-dateutil)
  31.  
  32. -- install protobuf like you would do when installing HSN2 Console:
  33. # install from source
  34. wget http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.gz
  35. ./configure
  36. make
  37. make install
  38. # cd TO PYTHON SUBDIR
  39. python setup.py install
  40.  
  41. # install using pip (not tested)
  42. pip install protobuf
  43.  
  44. == install HSN2 protobuf files ==
  45. # Go to trunk/software/Commons/protocol/python
  46. mkdir -p /opt/hsn2/python/proto
  47. # do 'make' and ignore the error
  48. cp -r ./pb/*.py /opt/hsn2/python/proto
  49.  
  50. == install HSN2 communication lib ==
  51. # at time of writing not all comm. lib files are in software/Commons,
  52. # but partly in software/Commons and partly in software/Console
  53. mkdir /opt/hsn2/python/commlib
  54. cp trunk/software/Commons/communication-lib/*.py /opt/hsn2/python/commlib
  55.  
  56. == install HSN2 web GUI ==
  57. -- copy web gui files to /srv/www/hsn2
  58. -- login to mysql as root
  59. -- create mysql user and HSN2 database:
  60. mysql> CREATE USER 'hsn2'@'localhost' IDENTIFIED BY 'somepassword';
  61. mysql> CREATE DATABASE hsn2;
  62. mysql> GRANT ALL ON hsn2.* TO 'hsn2'@'localhost';
  63.  
  64. # check/change settings in /srv/www/hsn2/web/settings.py
  65. # change SECRET_KEY setting in settings.py to a random string! (Used to provide a seed in secret-key hashing algorithms)
  66. # create database tables and admin for web gui:
  67. cd /srv/www/hsn2/web
  68. python manage.py syncdb
  69.  
  70. == set file rights for web gui and scheduler ==
  71. # note that files which are uploaded in upload dir
  72. # must be readable for the user who started the scheduler
  73. -- create an hsn2 user on machine
  74. adduser hsn2
  75. -- set file permissions and ownership accordingly:
  76.  
  77. /srv/www
  78. drwxr-xr-x  apache apache hsn2
  79.  
  80. /srv/www/hsn2
  81. drwx------  apache apache apache
  82. drwxr-x---  apache hsn2   etc
  83. drwx------  hsn2   hsn2   test
  84. drwxr-x---  apache hsn2   web
  85.  
  86. drwxr-x---  apache hsn2   analysis
  87. -rwxr-x---  apache hsn2   couchdb_views.py
  88. -rw-r-----  apache hsn2   README
  89. drwxr-x---  apache hsn2   url
  90.  
  91. /srv/www/hsn2/web
  92. drwxr-x---  apache hsn2   app
  93. -rw-r-----  apache hsn2   hsn2.conf
  94. -rw-------  apache apache __init__.py
  95. -rwxr-----  apache hsn2   logging.conf
  96. -rw-------  apache apache manage.py
  97. -rwxr-x---  apache hsn2   settings.py
  98. drwx------  apache apache templates
  99. drwxr-s---  apache hsn2   upload
  100. -rw-------  apache apache urls.py
  101.  
  102. /srv/www/hsn2/web/app
  103. -rw-------  apache apache admin.py
  104. drwx------  apache apache custom
  105. -rw-------  apache apache feeds.py
  106. -rw-------  apache apache forms.py
  107. -rw-------  apache apache __init__.py
  108. -rw-r-x---  apache hsn2   models.py
  109. drwx------  apache apache static
  110. drwx------  apache apache static_admin
  111. drwx------  apache apache templatetags
  112. -rw-r-x---  apache hsn2   tools.py
  113. -rw-------  apache apache views.py
  114.  
  115. == sync couchdb views ==
  116. # insert views into couchdb
  117. # hsn db has not yet been created in couchdb:
  118. curl -X PUT http://localhost:5984/hsn
  119.  
  120. # sync views:
  121. cd /srv/www/hsn2/etc/couchdb_views
  122. python couchdb_views.py -s
  123.  
  124. == add HSN2 to apache conf ==
  125. # add /srv/www/hsn2/apache/hsn2.conf to apache conf in /etc/apache...
  126. # restart apache
  127.  
  128. == Scheduler ==
  129. # change settings in /srv/www/hsn2/etc/schedule.conf
  130. # for sftp settings, if password is supplied, pkey settings will be ignored
  131. # start scheduler
  132. python scheduler.py start
  133. # stop scheduler
  134. python scheduler.py stop
  135.  
  136. == Wokflows ==
  137. # sync workflows
  138. python synchronizer.py workflows
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement