You are looking at the HTML representation of the XML format.
HTML is good for debugging, but is unsuitable for application use.
Specify the format parameter to change the output format.
To see the non HTML representation of the XML format, set format=xml.
See the complete documentation, or API help for more information.
<?xml version="1.0"?>
<api>
  <query-continue>
    <allpages gapcontinue="Setting_up_Tilestream_VM_on_CEDEUSDB" />
  </query-continue>
  <query>
    <pages>
      <page pageid="113" ns="0" title="Setting up Elgg VM on CedeusGeoNode">
        <revisions>
          <rev contentformat="text/x-wiki" contentmodel="wikitext" xml:space="preserve">&gt;&gt; return to [[Cedeus_IDE]]
----

== Elgg VM setup ==

# copying basicubunutu1404.vdi file and renaming to elgg.vdi
# creating the elgg VM on CedeusDB (ip.18):
#* &lt;code&gt;VBoxManage createvm --name elgg --ostype Ubuntu_64 --register&lt;/code&gt;
#* &lt;code&gt;VBoxManage modifyvm elgg --memory 4096&lt;/code&gt;
#* &lt;code&gt;VBoxManage modifyvm elgg --cpus 4&lt;/code&gt;
#* &lt;code&gt;VBoxManage modifyvm elgg --nic1 nat&lt;/code&gt;
#* &lt;code&gt;VBoxManage storagectl elgg --name &quot;SATA Controller&quot; --add sata --controller IntelAhci&lt;/code&gt;
#* assign the (old) disk image a new uuid
#*: &lt;code&gt;VBoxManage internalcommands sethduuid elgg.vdi&lt;/code&gt;
#* attach the (old) disk image:
#*: &lt;code&gt; VBoxManage storageattach &quot;elgg&quot; --storagectl &quot;SATA Controller&quot; --port 0 --device 0 --type hdd --medium elgg.vdi&lt;/code&gt;
#* &lt;code&gt; VBoxManage storagectl elgg --name &quot;IDE Controller&quot; --add ide --controller PIIX4&lt;/code&gt;
#* set the nat rules (ports):
#*: &lt;code&gt; VBoxManage modifyvm elgg --natpf1 &quot;ssh,tcp,,15022,,22&quot;&lt;/code&gt;
#*: &lt;code&gt; VBoxManage modifyvm elgg --natpf1 &quot;apache,tcp,,15080,,80&quot;&lt;/code&gt;
# optional - set VRDE port:
#* &lt;code&gt;VBoxManage modifyvm elgg --vrdeport 7765&lt;/code&gt; (Note: 3389 is the default port anyway)
# start the VM
#: &lt;code&gt;VBoxHeadless -s elgg --vrde on &amp;&lt;/code&gt; 
#: the VM will listen on port 7765
# The following step do not seem to be necessary with Ubuntu 14.04 and new VirtualBox - however, are necesary for 12.04. But if so: connect with VRD and adjust network card settings (remember the existing VM have an old password)
#* open ''/etc/udev/rules.d/70-persistent-net.rules'' and comment out existing network adapters
#* reboot
#* check if ssh connection works
# change the computers name in ''/etc/hosts'' and ''/etc/hostname''
# restarting Apache gives the error message: &quot;apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 ...&quot;
:: =&gt; solve this by adding ''ServerName elgg'' as the last line in ''/etc/apache2/apache2.conf'' file

== Elgg Setup ==

General Docs: http://learn.elgg.org/en/latest/

Install docs: 
* http://learn.elgg.org/en/latest/intro/install.html and http://learn.elgg.org/en/latest/intro/install.html#ubuntu-linux
* https://www.digitalocean.com/community/tutorials/how-to-install-and-setup-elgg-on-a-debian-or-ubuntu-vps--2

* Elgg needs LAMPS (MySQL 5+, PHP 5.3.3+), so:
* check what software packages are installed on the VM with &lt;code&gt;dpkg -l&lt;/code&gt;
: =&gt; looks like 14.04 comes with MySQL 5.5 and PHP 5.5
* however, I am missing php5 gd lib, so lets (re-)install the bunch of libs
: &lt;code&gt;sudo apt-get install php5 php5-gd php-xml-parser php5-mysql&lt;/code&gt;
* Apache ''rewrite'' module should be enabled too
:: &lt;code&gt;sudo a2enmod rewrite&lt;/code&gt;
* downnload Elgg from http://elgg.org/download.php  =&gt; I downloaded 1.8.19, the latest available and stable (= non RC) version
* unzip and place in www folder of server 
::&lt;code&gt;unzip elggXXX&lt;/code&gt;
::&lt;code&gt;mv elggXXX elgg&lt;/code&gt; (i.e. rename folder)
::&lt;code&gt;sudo cp -r elgg /var/www/html/&lt;/code&gt; (copy folder to www/html to be accessible for Ubuntu 14.04)
* create a ''data'' folder outside of ''/www'' or ''/public_html'' (e.g. under ''/usr/share/elgg/'' )and make it accessible via for elgg:
:: &lt;code&gt;sudo chown -R www-data:www-data FolderPATH/elggdata&lt;/code&gt;
: =&gt; ''www-data'' is apache's user that writes to file system. The above command grants apache ownership of the data directory.
* create a database for elgg:
:: &lt;code&gt;mysql -u root -p&lt;/code&gt; (pw 20...s)
:: &lt;code&gt;CREATE DATABASE elgg;&lt;/code&gt;
:: &lt;code&gt;CREATE USER elgguser IDENTIFIED BY 'elggpassword';&lt;/code&gt; -- (elggpwd: elggc...s) -- perhaps may be better to use &lt;code&gt;CREATE USER 'elgguser'@'localhost' IDENTIFIED BY 'elggpasswd';&lt;/code&gt;
:: &lt;code&gt;GRANT ALL ON elgg.* TO elgguser;&lt;/code&gt;
:: &lt;code&gt;\q&lt;/code&gt;
* to be enable .htaccess in document root the access settings need to be changed in ''/etc/apache2/sites-available/default'' from ''AllowOverride None'' to ''AllowOverride All'' for the directory /var/www/html/ =&gt; Problem, this was for older Apache version, now in Ubuntu 14.04 we have 000-default.conf that does not contain this setting yet. So we do the following:
:: &lt;code&gt;sudo nano /etc/apache2/sites-available/000-default.conf&lt;/code&gt;
:: Search for ''DocumentRoot /var/www/html'' and add the following lines directly below::
:: &lt;code&gt;&lt;Directory &quot;/var/www/html&quot;&gt;&lt;/code&gt;
::: &lt;code&gt;AllowOverride All&lt;/code&gt;
:: &lt;code&gt;&lt;/Directory&gt;&lt;/code&gt;
:: and do restart apache2


'''N.B.:''' The following instructions do not seem to be necessary for Elgg 1.11. Instead visit the Elgg directly, i.e. 146.xxx.xxx.19/pathToElgg. (Btw. I adjusted the the document root before that, so that my elgg1-11 folder is now the doc root folder). If there appears an access error do a: &lt;code&gt;sudo chown -R www-data:www-data /path/to/elgg/&lt;/code&gt;

* move and rename files (perhaps use &lt;code&gt;sudo&lt;/code&gt;)
:: &lt;code&gt;mv /var/www/html/elgg/htaccess_dist /var/www/html/elgg/.htaccess&lt;/code&gt;
:: &lt;code&gt;mv /var/www/html/elgg/engine/settings.example.php /var/www/html/elgg/engine/settings.php&lt;/code&gt;
* Open up the ''settings.php'' file and fill in the database access details:
:: &lt;code&gt;sudo nano /var/www/html/elgg/engine/settings.php&lt;/code&gt;
:: set:
::* &lt;code&gt;$CONFIG-&gt;dbuser = 'elgguser';&lt;/code&gt;
::* &lt;code&gt;$CONFIG-&gt;dbpass = 'elggc...s';&lt;/code&gt;
::* &lt;code&gt;$CONFIG-&gt;dbname = 'elgg';&lt;/code&gt;
::* &lt;code&gt;$CONFIG-&gt;dbhost = 'localhost';&lt;/code&gt;
::* &lt;code&gt;$CONFIG-&gt;dbprefix = '';&lt;/code&gt;
* navigate to http://146.155.17.19:15080/elgg/install.php to perform the setup
* some settings I did:
** registration open/public accessible
** name Cedeus - miCiudad
** login ssteinig (2..s) : registered email is uzh (2nd user: ment...r : s...o4...)
** outgoing email fuer elgg(!): ssteiniger-uc (not shure if this works, though)

=== Setting as Landing Page ===

I wanted that I get the Elgg page directly when I call http://miciudad.geosteiniger.cl.
The files for Elgg 1.9.2 are physically in the folder ''var/www/html/elgg''.

Therefore (aside from the change at my gesosteiniger.cl domain) I  needed to change ''&quot;/etc/apache2/sites-available/000-default.conf&quot;'' as follows:

&lt;code&gt;
 &lt;VirtualHost *:80&gt;
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com
 
        ServerName cedeusgeonode.ing.puc.cl:15080
        ServerAlias miciudad.geosteiniger.cl
 
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/elgg
        &lt;Directory &quot;/var/www/html/elgg&quot;&gt;
           AllowOverride All
        &lt;/Directory&gt;
 
        Alias /elgg18/ /var/www/html/elgg18/
        &lt;Directory &quot;var/www/html/elgg18&quot;&gt;
           AllowOverride All
        &lt;/Directory&gt;
 
        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn
 
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
 
        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with &quot;a2disconf&quot;.
        #Include conf-available/serve-cgi-bin.conf
 &lt;/VirtualHost&gt;
 # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
&lt;/code&gt;

I also have an elgg18 installation (v 1.8.19) in ''var/www/html/elgg18'' that is accessible viha ttp://146.155.17.19:15080/elgg18/

== Settings after Elgg installation ==

Elgg 1.8.19 ist installed/accessible now via http://146.155.17.19:15080/elgg/
(the test version with Elgg 1.8.3: if the VM is running http://146.155.17.19:31080/elgg/)

* in Administration &gt; Settings &gt; Advanced Settings
** set &quot;default access permissions&quot; to &quot;friends&quot;
** uncheck &quot;Allow new users to register&quot;
* Plugins:
** activated Embed 1.8
** activated Diagnostics 1.8
** download and install : Spanish Formal Core language pack for Elgg 1.8 : http://community.elgg.org/plugins/1479860/1.0/spanish-formal-core-language-pack
*: Note, the user can define his language. So, the admin pages can be English while new user will have Spanish as default.
** download and install : Friend request for Elgg 1.8 : http://community.elgg.org/plugins/384965/3.3/friend-request
** download and install: Honeypot Spam Catcher for Elgg 1.8 : http://community.elgg.org/plugins/1131529/1.0/honeypot-spam-catcher
** todo check: User validation by admin for 1.8.X for Elgg 1.8 : http://community.elgg.org/plugins/875414/1.1/user-validation-by-admin-for-18x
** todo check: Member Selfdelete 1.8.x for Elgg 1.8 : http://community.elgg.org/plugins/860132/1.1/member-selfdelete-18x
** todo check: Elgg Captcha for Elgg 1.8 : http://community.elgg.org/plugins/1172111/1.8.15C/elgg-captcha
** todo check: Spam Checker for Elgg 1.8/1.9 : http://community.elgg.org/plugins/1650435/1.9/spam-checker
** todo check: Speak Freely Plugin

== Some notes on programming with Elgg ==
* dev environment: IDE PhpStorm (start it using &lt;code&gt;sh ./dev/PhpStorm-133.1777/bin/phpstorm.sh&lt;/code&gt;)
** Note, I have setup the programming environment so, that the elgg plugin's project/files are directly modified in ''/var/www/html/elgg/mod/...''
** It is helpful to to load/import the folder /elgg/engine/ as library so elgg commands are found. 
* disable caching (in admin settings) and enable display of php errors
* documentation : 
** see in the elgg install folders: ''.../elgg/documentation/''
** some more elgg plugin tutorials can be found here: http://learn.elgg.org/en/latest/tutorials/index.html
* we also have the Elgg book by C Costello and M. Sharma : http://www.packtpub.com/web-development/elgg-18-social-networking 
* (plugin) examples can be found in ''.../elgg/documentation/examples/ + .../plugins'' in particular for ''start.php'' and ''manifest.xml'' files that have to be in a plugins root folder

== Notes on PYP Theming Plugin ==
* it looks like this was done overly complicated. After reading the book chapters with examples (chapter 7,8,9), it seems like a re-write is in order to using page one-column layout instead, e.g.: &lt;code&gt;elgg_view_layout('one_column', $vars);&lt;/code&gt;
=== Theming ToDos ===
# create Cedeus/MiCiudad Elgg style
#* '''done''': white background 
#* '''almost done''' cedeus font + text  color (CSS)
#* '''done''' Cedeus logo, see. e.g.: http://www.perjensen-online.dk/04/how-to-add-a-custom-logo-to-your-elgg-site/
# create Cedeus welcome page
#* with quick links to MapComment for cities?
#* see the &quot;Custom Index&quot; plugin shipped with Elgg, and http://learn.elgg.org/en/latest/tutorials/indexpage.html for details
#* that the map shows always the same city, may require a cookie
#** see: http://stackoverflow.com/questions/13097595/how-to-assign-php-variable-in-javascript-value-assign
#** and for Leaflet: http://leafletjs.com/reference.html#map-get-methods
# perhaps adapt Elgg CSS so it can be used as entry page for observatory website?

Btw. new name of ''PlanYourPlace'' platform now is ''e-Planning Platform''.

== Notes on MapComment/ Plugin ==
* there is no extra DB needed. Its all written to the default DB.
*: see also the php warning: ''&quot;Invalid argument supplied for  foreach()&quot; in file /var/www/html/elgg/modpypMapComment/pages/category.php (line 14)'' that seems to be resolved when initial items are added
* switching to the index page (i.e. vy clicking on &quot;Add new comment...&quot;) shows everything that is needed (no changes here?)
=== MapComment ToDos: ===
# the category page doesn't show a map after setup, as items in the like and dislike groups required. 
#: =&gt; after creation of an item/mapComment for each group, a map is shown!
# '''done''': set to OSM --- still ToDo: create custom tile map for south of chile
# '''almost done''': translate to Spanish --- still requires check by a spanish speaker
# '''done''' : there is an offset for locations (marker was placed a few blocks towards south, i.e. 1.5-2 times the dot-icon size, for a zoom level)
#: =&gt; note, when zooming in and out, while adding the item, the dot's position (not yet fixed) changes strongly in north-south direction :(
#: =&gt; there was a difference between map &lt;height&gt; definition in map.css (500px) vs category/index page (600px) but setting them the same did not fix the issue. So, maybe it is a marker issue (defined marker centre, and dimensions???).
#: ''Solution'': turns out the reason have been the marker size settings, i.e.
#:* settings in index.php did stem from the drop-marker coming with leaflet, while a circle marker was used, so I reset the icon image to the default leaflet marker and added also the shadow icon (already present under css/images)
#:* settings in category.php required adjustment for iconAnchor: [10, 0] =&gt; [10, 10]
# '''done''': perhaps remove header part (that allows search for an address and placing a comment) - as it seems a bit confusing to me 
# '''done''': add option to upload a image and to display the image
#* for uploading see: http://learn.elgg.org/en/latest/guides/actions.html#files-and-images
# '''done''': correct map focus on &quot;issue&quot; selection (map will sometimes not be centered on map comment location)
# '''done''': adjust comment privacy level as I am not able to see the map/comments when I am logged out (this may be a general setting issue?) 
#: =&gt; yes, mapcomments are private if the general user created comments are set to private. (friends can see friends comments). So the general elgg setting of &quot;privacy&quot; needs to be &quot;public&quot; to see comments without being logged in; or:
#: =&gt; see: e.g. &lt;code&gt;$blog-&gt;access_id = ACCESS_PUBLIC;&lt;/code&gt; in http://learn.elgg.org/en/latest/tutorials/blog.html
#: =&gt; ''solution'': replace in ''pypMapComment/action/save.php'' the line &lt;code&gt;$access_id = get_input('access_id');&lt;/code&gt; by  &lt;code&gt;$access_id = ACCESS_PUBLIC;&lt;/code&gt;
# '''to improve''': give user a feedback that new comment is added because the current message is not very visible (the user focus more one the change in the map)
# '''done''': add notice of a new mapcomment issue submission to the Elgg-River (=&gt; see how this is done, in the Blog plugin - requires creation of a new river view)
# '''done''': rename &quot;activities&quot; plugin/name (showing Elgg-River) to &quot;latest comments&quot;/&quot;ultimos comentarios&quot;
# '''done''': rename MapComment plugin; i.e. do i18n =&gt; non called '''''Cuantanos Map'''''
# there is a weird behavior when setting the map focus to an issue and using zoom level-17 =&gt; the tiles are not refreshed. However, there is no problem when I use zoom level-18.
# '''to improve''': beautify issue icons
# '''done''': on click: don't center on map issue when clicked on in the map
# '''done''': on click: show pop-up with subject title of map issue when clicked on in the map
# enable anonymous comment submission
# '''done''': create a button on the mapcomment info view/form to delete this particular comment
#* however, '''ToDo''', perhaps add an additional message, asking if the user is sure to delete - as done when files are deleted.</rev>
        </revisions>
      </page>
      <page pageid="100" ns="0" title="Setting up GeoNode 2 on 12.04 VM on CedeusGeoNode">
        <revisions>
          <rev contentformat="text/x-wiki" contentmodel="wikitext" xml:space="preserve">&gt;&gt; return to [[Cedeus_Technical_Architecture]]
----

== basic steps performed ==

* create a new VM with Ubuntu 12.04 - with openssh and mail installed
* remove the cl locale of /etc/apt/sources.list
* update and upgrade =&gt; important because of hardbleed bug
* shutdown + remove the iso from the VM
* copied the VM =&gt; basicUbuntu1204.zip

== setting up GeoNode ==
* a listing of necessary packages is here: http://docs.geonode.org/en/master/tutorials/admin/install/custom_install.html#custom-install
* so we need to install 
**(i) apache2, 
**(ii) Java + Tomcat7, 
**(iii) postgresql (postgis only if we want to store the geodata locally), 
**(iv) python stuff for django
* install apache2  &lt;code&gt;sudo apt-get install apache2&lt;/code&gt;
* install tomcat7 &lt;code&gt;sudo apt-get install tomcat7&lt;/code&gt;
* install python &lt;code&gt;sudo apt-get install python-software-properties&lt;/code&gt;
* to install postgresql is not really necessary, as postgres 9.1 will be also installed by geonode, and I am using for my data an external postgresql-postgis db. However, I want 9.3 so:
*: see here about adding the repo: http://www.postgresql.org/download/linux/ubuntu/
*: &lt;code&gt;sudo apt-get update&lt;/code&gt;
*: &lt;code&gt;sudo apt-get install postgresql-9.3 pgadmin3 postgresql-contrib&lt;/code&gt;
*: perform: &lt;code&gt;sudo -u postgres psql&lt;/code&gt; and then &lt;code&gt;CREATE EXTENSION adminpack;&lt;/code&gt;
*: =&gt; note, after installing my postgresql 9.3 will be accessed via port 5432 
*: for doc see also: http://docs.geonode.org/en/master/tutorials/admin/install/install_postgresql.html#install-postgresql
* install GeoNode:
*: add the geonode repo key: &lt;code&gt;sudo add-apt-repository ppa:geonode/release&lt;/code&gt;
*: update the package list: &lt;code&gt;sudo apt-get update&lt;/code&gt;
*: install geonode:&lt;code&gt;sudo apt-get install genode&lt;/code&gt; NB:this wil also install postgres9.1!
*: &lt;code&gt;sudo geonode-updateip 127.0.0.1&lt;/code&gt;
*: &lt;code&gt;geonode createsuperuser&lt;/code&gt;
*: modify setting in /etc/geonode/local_settings.py and restart apache
*: =&gt; now the geonode webpage should be running! 
*: Btw. the psotgres 9.1 version installed together with geonode will be accessed via port 5433, while 5432 is used by 9.3 already

== modify GeoNode styling ==

* change webpage colors and add cedeus logo 
**: create folders /etc/geonode/media/geonode/img/ and /etc/geonode/media/geonode/css/
**: copy cedeus logo.png and cedeus base.css into its corresponding folder (may require chmod 777)
**: perform &lt;code&gt;sudo geonode collectstatic -v0&lt;/code&gt;
**: =&gt; check if it worked

* change welcome text for es/en/de 
*: change django.po files for each language in /usr/local/lib/python2.7/dist-packages/geonode/locale (for german file, check around line 3600) (may require switch of chmod 777 from originally 755)
*: run &lt;code&gt;sudo geonode compilemessages -l de&lt;/code&gt; from &quot;/usr/local/lib/python2.7/dist-packages/geonode/&quot; for each particular language
**: =&gt; check if it worked

== fine tuning for working with Geonode ==

see also http://docs.geonode.org/en/latest/tutorials/admin/production.html

* direct access to the db with PgAdmin:
** modify ''/etc/postgresql/9.3/main/postgresql.conf'' and ''/etc/postgresql/9.3/main/pg_hba.conf'' (for pq_hba.conf see http://www.glom.org/wiki/index.php?title=Initial_Postgres_Configuration)
*: =&gt; be sure to edit the right postgres files with respect to the installed postres versions
** &lt;code&gt;sudo service postgresql restart&lt;/code&gt;
** check if connection with pgAdmin to geonode db works (which contains user and metadata)
* set the memory for tomcat7: create file ''/usr/share/tomcat7/bin/setenv.sh'' and add the following lines
&lt;pre&gt;
#!/bin/sh 
JAVA_OPTS=&quot;-Xms512m -Xmx4g -XX:MaxPermSize=270m -server -Djava.awt.headless=true -Djava.util.prefs.systemRoot=$CATALINA_HOME/content/thredds/javaUtilPrefs&quot; 
export JAVA_OPTS
&lt;/pre&gt;
* disallow user self registration - Note, does not seem necessary. Default seems to be &quot;False&quot;.
** add to /etc/geonode/local_settings.py the line &lt;code&gt;REGISTRATION_OPEN=True&lt;/code&gt; for enabling registration to all
* create users and user groups
** use the admin option from within geonode, which links to the django admin pages
** eg. I created two user groups cedeusadmin and cedeususer with user ''stefanS'' (1...a) as member of the latter group, and ''stefanadmin''(20..s) as &quot;staff member&quot; a default group. also I created a &quot;cedeus_testuser&quot; (fo...p2...3)
* adjust geoserver settings as described under http://docs.geonode.org/en/latest/tutorials/admin/production.html
** add proxy address under global settings
** change admin pw, plus create &quot;cedeus&quot; user for backup resasons (pw same as for external postgisdb)
** add host IP for printing to ''/usr/share/geoserver/data/printing/config.yaml''
* create /robots.txt file in var/www/ (for conent see link above)
* modify /etc/tomcat7/server.xml by adding &lt;code&gt;maxThreads=&quot;50&quot;&lt;/code&gt; to connector 8080 settings.
* GeoServer &gt; JAI settings: disable Tile Recycling and enable jpg and png acceleration</rev>
        </revisions>
      </page>
    </pages>
  </query>
</api>