-
Notifications
You must be signed in to change notification settings - Fork 0
Linux Setup
-
sudo apt-get install tasksel
-
sudo tasksel install lamp-server
-
sudo apt-get install php5-dev php5-cli php-pear (taskel may have already installed some of these)
-
sudo apt-get install git (if you don't already have it!)
-
sudo pecl install mongo (requires php pear)
-
sudo apt-get install mongodb
-
Optional:
- Download rockmongo (web ui for mongodb) from here http://code.google.com/p/rock-php/wiki/rock_mongo Extract into the KyotoUI folder (created in the next step)
- create a folder ~/www/
- cd into the folder and clone the KyotoUI repository
- change the permissions on rockmongo folder recursively to be full access (chmod 777 -R rockmongo)
- do the same to the templates_c folder which has been cloned into the repo (chmod 777 -R templates_c) (you may need to be sudo to change these permissions I'm not sure)
-
modify php.ini so that it has the line: extension=mongo.so (sudo gedit /etc/php5/apache2/php.ini)
-
Optional:
-
modify rockmongo/config.php: (just paste this bad boy in)
<?php /** * RockMongo configuration * * Defining default options and server configuration * @package rockmongo */ $MONGO = array(); $MONGO["features"]["log_query"] = "off";//log queries $MONGO["features"]["theme"] = "default";//theme $MONGO["features"]["plugins"] = "on";//plugins $i = 0; /** * Configuration of MongoDB servers * * @see more details at http://code.google.com/p/rock-php/wiki/configuration */ $MONGO["servers"][$i]["mongo_name"] = "Localhost";//mongo server name $MONGO["servers"][$i]["mongo_host"] = "127.0.0.1";//mongo host $MONGO["servers"][$i]["mongo_port"] = "27017";//mongo port $MONGO["servers"][$i]["mongo_timeout"] = 0;//mongo connection timeout //$MONGO["servers"][$i]["mongo_db"] = "presage";//default mongo db to connect, works only if mongo_auth=false //$MONGO["servers"][$i]["mongo_user"] = "";//mongo authentication user name, works only if mongo_auth=false //$MONGO["servers"][$i]["mongo_pass"] = "";//mongo authentication password, works only if mongo_auth=false $MONGO["servers"][$i]["mongo_auth"] = false;//enable mongo authentication? $MONGO["servers"][$i]["control_auth"] = false;//enable control users, works only if mongo_auth=false $MONGO["servers"][$i]["control_users"]["admin"] = "admin";//one of control users [USERNAME]=PASSWORD, works only if mongo_auth=false $MONGO["servers"][$i]["ui_only_dbs"] = "";//databases to display $MONGO["servers"][$i]["ui_hide_dbs"] = "";//databases to hide $MONGO["servers"][$i]["ui_hide_collections"] = "";//collections to hide $MONGO["servers"][$i]["ui_hide_system_collections"] = false;//if hide the system collections $i ++; /** * mini configuration for another mongo server */ /** $MONGO["servers"][$i]["mongo_name"] = "Localhost2"; $MONGO["servers"][$i]["mongo_host"] = "127.0.0.1"; $MONGO["servers"][$i]["mongo_port"] = "27018"; $MONGO["servers"][$i]["control_users"]["admin"] = "admin"; $i ++; **/ ?>
-
-
Now...we need to set up our hosts file and virtual hosts...
-
Hosts:
- Go to the command line and type sudo gedit /etc/hosts (tab complete it) make sure the line: 127.0.0.1 localhost is present.
-
Virtual Hosts:
-
sudo gedit /etc/apache2/sites-available/default
-
Replace the contents with this (note that Document Root and Directory refer to the path where your KyotoInterface repo was cloned to):
<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /home/max/www/KyotoUI <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /home/max/www/KyotoUI> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> </VirtualHost>
-
-
-
Now type on the command line: sudo service apache2 restart also check mongo is ok: sudo service mongodb restart
-
head to your browser and navigate to localhost - you should see the project! if you installed rockmongo, localhost/rockmongo/index.php should be the rockmongo ui
If not...give me a call or something!!
You may also wish to install netbeans - the .gitignore will ignore all netbeans files so feel free to make the project in the KyotoInterface directory. It is a great IDE for php :). You could use eclipse but it is pretty crap - if you do please update the .gitignore to match the ecplise files (same as in the kyoto repo).
NB if you haven't run the web ui by Sam for presage2 you won't have the presage collection in the database which may cause a bit of database connection trouble. So if you have that problem either run the presage2 web ui or give me a shout.
Lots of love,
Max