CloudSurfer Code
A cloud brokering system for security requirements
Status: Beta
Brought to you by:
perhakon
File | Date | Author | Commit |
---|---|---|---|
CloudSurfer | 2012-12-19 |
![]() |
[ad0128] initial commit |
README.txt | 2012-12-19 |
![]() |
[ad0128] initial commit |
CloudSurfer Copyright (C) 2012 SINTEF (http://www.sintef.no) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. //////////////////////////////////////////////////////////////////////////////////////// INSTALLATION GUIDE Installation steps: Below are given steps for installation of the system on the server. They are same both for local host and for online host. The steps are: 0. If you don't have the LAMP (Linux, Apache, MySQL and PHP/Perl/Python) open source web application software stack already installed this should be done as a first step. 1. Download latest version from the GIT repository (git clone git://git.code.sf.net/p/cloudsurfer/code cloudsurfer-code) from SourceForge.org (http://sourceforge.net/projects/cloudsurfer/) All relevant files are in CloudSurfer folder. 2. Upload application files to the server All files need to be uploaded on the Web server. Files need to be put in public part of the server file system. Upload can be done using File Transfer Protocol (FTP), for instance FileZilla. It is important that uploaded files keep the same structure as when they were extracted. 3. Creation and population of database In order for application to work, a database is needed. For the database to become operational, a few steps need to be followed. The first thing is to a create database using server’s database management system (DBMS), usually phpMyAdmin. The database name should be cloudsurfer. Second, you need to import all the tables and data into database. That is done using cloudsurfer.sql file, which can be found in the database_sql folder. You should edit the line which inserts an admin user into the users table. By completing this, database is up and running. 4. Connecting the application to the database To make the connection between the database and rest of the files some changes in connect_to_mysql.php should be made. This file is located in scripts folder. The appropriate values for variables should be entered. Variables: $db_host – Keeps the name of the host. $db_username – Keeps the username that is used to login to database. $db_pass – Keeps the password that is used to login to database. $db_name – Keeps the name of the database. 5. For increased security: connect_to_mysql.php contains database user ID and password. Keeping these passwords in connect_to_mysql.php is risky because php files can be served as plain text under several different conditions revealing your database account to the world. If you want to keep your account a secret never put your mysql passwords in a text file that is within the web root. You can avoid doing so by doing this: Make a directory outside your web root. For example, if your website is located at "/htdocs/CloudSurfer", then make a directory called "external_includes" outside of your webroot: mkdir /external_includes Create a file in the directory you just made called something like "mysql_pw.php" and place a variable on a separate line for each of your mysql user name, password, hostname, and database name, each variable being set to the real values. For example, using nano as your editor: nano /external_includes/mysql_pw.php Type the following lines using the real values of course in place of the bracketed "mysql_" fillers: <?php $db_host="[mysql_host]"; $db_name="[mysql_db_name]"; $db_username="[mysql_user]"; $db_pass="[mysql_password]"; Take care to leave no whitespace (blank lines) after the text. Check with your distro for what the webserver's user is (this varies, examples include "apache", "nobody","httpd"). Then set the permissions for the password file like so: chgrp apache mysql_pw.php chmod 640 (removes the access rights from other and write rights from webserver) (probably repeat with g-rxw ... for connect_to_mysql.php ) make sure that u has r (or chmod 400 connect_to_mysql.php) Edit your connect_to_mysql.php file and add the following line in the beginning of the file: require_once("/external_includes/mysql_pw"); //require_once("[FULL ABSOLUTE PATH TO mysql_pw.php]") Now remove these variables from connect_to_mysql.php: $db_host $db_name $db_username $db_pass This way if somebody is able to access and display connect_to_mysql.php, all they will see is some settings rather than the password, username, etc. to your mysql database and the real file containing that information is off limits to the web server. You still need to make sure connect_to_mysql.php is only readonly to the apache user as described above.