Updating README for server.
[iotcloud.git] / version2 / src / server / README.txt
1 Setup on Ubuntu 14.04.6 LTS (GNU/Linux 3.13.0-165-generic x86_64):
2 ==================================================================
3
4 Required Packages:
5 ------------------
6 1) Requires apache2
7
8 2) Requires fastcgi (libapache2-mod-fastcgi and libfcgi-dev)
9
10 Installation:
11 -------------
12 1) Install modules
13
14 2) Add .htaccess file in /var/www/html
15 RewriteEngine on
16 RewriteBase /
17 SetHandler cgi-script
18 RewriteRule ^([a-zA-Z0-9._]*\.iotcloud/([a-zA-Z0-9._]*))$ /cgi-bin/iotcloud.fcgi/$1
19
20 3) Create account directory.  For example, create the directory test.iotcloud in /var/www/html
21    -- To password protect, create the following .htaccess file in the account directory:
22 AuthType Basic
23 AuthName "Private"
24 AuthUserFile /var/www/html/foo.iotcloud/.htpasswd
25 Require valid-user
26
27 4) In apache2.conf (/etc/apache2/apache2.conf), add to the /var/www directory section:
28 AllowOverride FileInfo AuthConfig
29
30 5) In the sites-enabled/000-default.conf (/etc/apache2/sites-enabled/000-default.conf) file, add the line:
31 SetEnv IOTCLOUD_ROOT /iotcloud/
32
33 6) Create the /iotcloud directory.
34
35 7) Create the account directory in the /iotcloud directory.  
36 For example, test.iotcloud and give it permissions that the apache daemon can write to.
37
38 8) Compile cloud server by typing make
39
40 9) Copy it to the cgi-bin directory.
41
42 10) Make sure that the 'rewrite' module is loaded. Run on the command prompt:
43 sudo a2enmod rewrite
44
45 11) Make sure that the 'cgid' module is loaded. Run on the command prompt:
46 sudo a2enmod cgid
47
48 12) Restart the apache server. Run on the command prompt:
49 sudo service apache2 restart
50
51
52
53 Additional Resources
54 ====================
55
56 Apache2 Debugging Commands
57 --------------------------
58 Please check the following log files for any errors after installation.
59
60 sudo cat /var/log/apache2/access.log
61 sudo cat /var/log/apache2/error.log
62
63
64 Curl command for testing salt creation
65 --------------------------------------
66 1) Once the server is set up, run:
67 curl -X POST http://dc-6.calit2.uci.edu/test.iotcloud/?req=getsalt
68
69 2) If there is any error, error messages will be printed.
70 Then we need to double check the steps as listed above.
71
72 3) If everything is good, then there is no error message to be printed.
73 At this point the folder /iotcloud/test.iotcloud/ should contain the 
74 "queuestatus" and a number of "SLOTx" blocks.
75