Linode.com has good deals on VPS
I tried installing MindTouch Deki Wiki on CentOS 5 at OpenHosting, but there were too many problems, so I gave up after about a day and a half of trying to get all the packages working, and despite having various guides on the MindTouch OpenGarden site. Reading OpenGarden wiki and forums, I found that Deki Wiki had been designed on Debian, so I looked for a VPS that would support Debian or Ubuntu.
There are a couple out there, but Linode came recommended by a friend at MindTouch, so I signed up.
After checking with a few people signed into the Linode IRC Channel
about how long the signup would take and hearing "very quickly", I
signed up for a Linode 300 with 10GB of disk and 300MB of RAM for 19.95
USD / month. My Linode was provisioned literally 5 minutes after
clicking submit in the webform. I am sure it would take longer if
people were offline or asleep, but I have to say I was impressed by the
speed of response.
Once you give your card info, an email comes with further instructions. You click a link and are taken to a page that lets you choose the Linode's location. There were two datacenters available - Atlanta and Dallas (Fremont CA was full) - and again checking with people on IRC, I tested downloading a 10MB Video file from both to see how the performance would be from Japan. I got 175 Kbps / sec from the Dallas site, as opposed to 130 Kbps / sec for the Atlanta site, so I chose to create the linode VPS at the Dallas facility.
Once the Linode is created, you can sign into the control panel
and decide which Linux Distro to use. I was trying to decide between
Debian and Ubuntu having read a number of point-counterpoint type web
reviews, and after imposing upon the good souls at the Linode IRC
channel, decided to try Ubuntu.
Once you have your Linode's IP address it is easy to log in via ssh:
> ssh root@123.123.123.123
Obviously, root access via ssh is not an optimal situation, so you should quickly set up sshd to disallow this, and start using ssh keys to prevent unwelcome people from accessing.
The Ubuntu 7.10 that gets set up has no hostname initially (/etc/hostname has "none") so you need to set one. Edit the hostname file. I set my host name to "fire".
# nano hostname # hostname -F /etc/hostname
If you logout and then log back in, your prompt should look like this:
root@fire:~ #
Now set your hosts file to include your IP, FQDN for the host and hostname.
root@esolia-fire:~ # nano /etc/hosts root@esolia-fire:~ # cat /etc/hosts 127.0.0.1 localhost 123.123.123.123 fire.mydomain.com fire ...
Make sure your DNS zone has an A record for the FQDN - in my case, I set one up for fire.mydomain.com, pointing at my IP address 123.123.123.123 (obviously that is not the real IP).
I set my timezone thus:
# cp /etc/localtime /etc/localtime.original # ln -sf /usr/share/zoneinfo/Japan /etc/localtime # ls -la /etc/localtime lrwxrwxrwx 1 root root 25 Nov 24 14:32 /etc/localtime -> /usr/share/zoneinfo/Japan
I installed the "ubuntu-standard" package which is convenient to have, and which is availble in the standard repository.
# aptitude install ubuntu-standard
During the install, prompts come up for lilo and postfix (switching postfix for sendmail). I accepted the defaults for both and removed lilo later like this:
# aptitude remove lilo
Later
in this tutorial you will install other software such as php5-mcrypt
and procinfo. You cannot find php5-mcrypt in the default
repositories any longer (used to be there, apparently), so you can
update the
repository file to include the "universe" and "multiverse" extras. Your
/etc/apt/sources.list should look like this:
root@esolia-fire:/etc/apt # cat sources.list deb http://archive.ubuntu.com/ubuntu/ gutsy main restricted deb-src http://archive.ubuntu.com/ubuntu/ gutsy main restricted ## Uncomment the following two lines to add software from the 'universe' ## repository. ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team... deb http://archive.ubuntu.com/ubuntu/ gutsy universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ gutsy universe multiverse deb http://security.ubuntu.com/ubuntu gutsy-security main restricted deb-src http://security.ubuntu.com/ubuntu gutsy-security main restricted
Note, gutsy is the current Ubuntu release.
For
now, I just installed mutt to allow easy mailing from scripts (mutt
works where mail does not) and procinfo to allow easy mailing of system
info from scripts. Mutt is available in the standard repository, but
procinfo requires the above update.
aptitude install mutt procinfo
root@fire:~ # procinfo Linux 2.6.23.1-linode36 (root@nova1.theshore.net) (gcc 3.3.3 20040412 ) #1 Sun Nov 4 12:03:06 EST 2007 1CPU [fire.(none)] Memory: Total Used Free Shared Buffers Mem: 295528 261984 33544 0 36284 Swap: 262136 52 262084 Bootup: Sat Nov 24 10:52:31 2007 Load average: 0.21 0.05 0.04 1/85 10513 user : 0:05:37.18 0.3% page in : 266409 disk 1: 16589r 122332w nice : 0:00:00.00 0.0% page out: 3484604 disk 2: 15r 11w system: 0:00:42.51 0.0% page act: 309583 IOwait: 0:00:16.48 0.0% page dea: 174393 hw irq: 0:00:00.00 0.0% page flt: 14903418 sw irq: 0:00:00.58 0.0% swap in : 16 idle : 21:06:52.33 62.4% swap out: 18 uptime: 1d 9:50:56.38 context : 8358765 irq 0: 12185633 SIGVTALRM timer irq 5: 278255 SIGIO eth0 irq 2: 0 SIGIO console irq 9: 0 SIGIO mconsole irq 3: 0 SIGIO console-write irq 10: 0 SIGIO winch irq 4: 458796 SIGIO ubd irq 11: 0 SIGIO write sigio
Next I installed the various prerequisites for Deki Wiki. This is where CentOS 5 just falls apart. Maybe if I understood yum repositories and their myriad dependencies better (or maybe with a different application) I would have had better luck, but I spent too much time on this next part in CentOS and then just gave up. With Ubuntu 7.10, it was relatively painless.
This command initially failed because
of php5-mcrypt NOT being available in the default Ubuntu repositories.
You have done the update above, so it should work for you.
# aptitude install apache2 php5 php5-cli php5-mysql libapache2-mod-php5 php5-mcrypt php5-mhash \ php5-gd php5-curl imagemagick wv pdftohtml html2text html2ps wv ppthtml htmldoc aspell \ links php-pear curl mysql-server-5.0
You can install or reinstall, as needed:
# aptitude install php5-mcrypt # aptitude reinstall mysql-server-5.0
And, the above does NOT need to be all on one line. You can separate the package installs:
# aptitude install apache2 php5 # aptitude install php5-cli # aptitude install php5-mysql etc...
If you get this:
# aptitude install apache2 ... apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
... use a text editor to edit /etc/apache2/httpd.conf and
add the following to the bottom of the file (actually, the httpd.conf
is blank by default and is just for "local" settings):
ServerName localhost
Note, do not substitute your servername for ServerName. ServerName is a directive here, not a literal.
Install the prerequisite mono so that the dekihost and its C# stuff will run:
# aptitude install mono-gmcs mono-mcs libmono-sqlite2.0-cil libmono-sqlite2.0-cil libmono-system-web2.0-cil
* See http://sourceforge.net/projects/dekiwiki for the tarballs. Extract the Source archive to a directory such as your home directory:
cd ~/ tar xfvz Deki_Wiki_1.8.XX_Hayes_source.tar.gz cd Deki_Wiki_1.8.XX_Hayes_source
Copy web files to your apache "Document Root":
mkdir /var/www/deki-hayes cp -r web/* /var/www/deki-hayes chown -R www-data /var/www/deki-hayes
Assuming [DEKI_SOURCE] is /var/www/deki-hayes, copy the conf file to "sites-available", and edit it:
cp [DEKI_SOURCE]/config/deki-apache.conf /etc/apache2/sites-available/deki nano /etc/apache2/sites-available/deki
Change
the following values according to your setup. The ServerName directive
must be your FQDN (the "dekiwiki.mydomain.com" in this document).
NOTE:
The following instructions reflect an Apache configuration when no other apache
websites are configured or needed. It is beyond the scope of this
documentation to configure DekiWiki with other sites.
ServerName dekiwiki.mydomain.com DocumentRoot "/var/www/deki-hayes"
Remove
the 000-default config file in sites-enabled. Create a soft-link
(symbolic link) from sites-available to sites-enabled in the
/etc/apache2 directory:
cd /etc/apache2/sites-enabled rm 000-default ln -s /etc/apache2/sites-available/deki /etc/apache2/sites-enabled/001-deki-hayes
Your sites will look like the following:
root@fire:/etc/apache2 # ls -la sites-available/ total 16 drwxr-xr-x 2 root root 4096 Nov 24 16:28 . drwxr-xr-x 7 root root 4096 Nov 24 18:01 .. -rw-r--r-- 1 root root 1183 Oct 5 07:54 default -rw-r--r-- 1 root root 995 Nov 24 18:22 deki root@fire:/etc/apache2 # ls -la sites-enabled/ total 8 drwxr-xr-x 2 root root 4096 Nov 24 16:29 . drwxr-xr-x 7 root root 4096 Nov 24 18:01 .. lrwxrwxrwx 1 root root 33 Nov 24 16:29 001-deki -> /etc/apache2/sites-available/deki
Enable the mod_rewrite module
a2enmod rewrite
Enable mod_proxy_http module
a2enmod proxy_http
The deki-api is a .NET application which runs under the mono runtime. deki-api runs as a standalone mono application which uses MindTouch Dream's built-in webserver. mod_proxy proxy is used to proxy requests from apache to deki-api.
Edit the mod_proxy config file (/etc/apache2/mods-available/proxy.conf) and make sure you have the following:
<Proxy *>
AddDefaultCharset off
Order deny,allow
Deny from all
Allow from all
</Proxy> Edit your deki apache config file /etc/apache2/sites-available/deki and make sure the following lines are uncommented:
# mod_proxy rules ProxyPass /@api http://localhost:8081 retry=1 ProxyPassReverse /@api http://localhost:8081 SetEnv force-proxy-request-1.0 1 SetEnv proxy-nokeepalive 1
Make sure your php5.conf is correct (Ubuntu 7.10 had only the top two lines and the web installer would not work):
root@fire: /etc/apache2/mods-available # cat php5.conf <IfModule mod_php5.c> AddType application/x-httpd-php .php .phtml .php3 AddType application/x-httpd-php-source .phps AddType application/x-httpd-php .php4 .php5 </IfModule>
Restart apache to enable the module and apply the new settings
/etc/init.d/apache2 restart
Create the deki-api logfile:
touch /var/log/deki-api.log chown www-data:www-data /var/log/deki-api.log
Create the mono .wapi directory:
mkdir /var/www/.wapi chown www-data:www-data /var/www/.wapi
Edit the [DEKI_HOME]/config/dekihost init script. This script can be used to test the status of deki-api or start/stop the mindtouch.host.sh (deki-api) process. Change the following values to match your configuration:
# path to your wiki DEKI_PATH=/var/www/deki-hayes # this should match your Apache ServerName directive DEKI_SERVERNAME=dekiwiki.mydomain.com
Launch a browser and go to the installer, assuming the FQDN is working (otherwise use the IP):
http://dekiwiki.mydomain.com/config/index.php
Fill in the required information and click "Install Deki Wiki".
Complete the installation by running the additional commands as instructed by the installer.
If deki-api failed to load try the following - make sure the mono process is running:
ps ax|grep mindtouch.host
You should see a process like:
www-data 3401 0.5 15.9 67292 40892 pts/0 Sl 19:25 0:03 mono \ /var/www/deki-hayes/bin/mindtouch.host.exe apikey 92669 script \ /etc/dekiwiki/mindtouch.deki.startup.xml \ server-name http://deki-hayes path-prefix @api http-port 8081 ip localhost notty
If you don't see the process above, check the dekiapi error logs (/var/www/deki-hayes/bin/logs/trace.log) for more details.
You can restart the deki-api process by:
/etc/init.d/dekihost restart
http://cogley.wik.is/Knowledgebase/Deki_Wiki/Installing_Deki_Wiki_on_VPS_from_Linode_Running_Ubuntu_7.10