rulururu

post Installing wiki on a2hosting with latex support on A2Hosting

January 20th, 2008

Filed under: A2Hosting — zedr0n @ 8:37 pm

Installing MediaWiki

Getting MediaWiki up and running is pretty simple. Here is the installation script which will download mediawiki 1-11.0 and do the necessary preconfiguration (see more here on that)

Setting up database for Wiki

Go to CPanel->MySQL Databases and add new database(e.g wikidb - I’m not sure but to be on the safe side I recommend to select name which isn’t the same as one of subdomains on your website). Then Add User(e.g wikiuse) and Add User to database with all privileges.

Configuring

You can try to do the first part automatically by running the script in the intended wiki directory - bash installwiki.sh
If everything went ok, then just point your browser to the config directory. Follow the direction on-screen - you should enter the data you used when creating the database in the Database config section - don’t forget to add your a2hosting username to db name and db username.
Now some postinstallation stuff

mv ./config/LocalSettings.php ./
rm -rf ./config

It will just delete ./config directory and move localsettings.php to its intended place

Enabling TeX

To enable tex you need to have texvc compiled in your wiki/math subdirectory. Unfortunately, a2hosting doesn’t have ocaml installed so you won’t be able to compile it on-site. But I managed to find the precompiled binary for CentOS 5 for x86_64 platform which is what a2hosting runs. You can grab it here. You’ll need to put it into your wiki/math subdirectory and maybe do chmod 777 ./texvc on it.
Then you’ll have to add the following lines(or change the value if they exist already) to your LocalSettings.php file

$wgUseTex = true;
$wgTmpDirectory = "/home/your_username/www/your_wiki_directory/images/tmp";
$wgMathDirectory = "/home/your_username/www/your_wiki_directory/images/math";

You’ll also have to actually create the directories in question by ssh’ing to your server and executing

cd ~/www/your_wiki_directory/images
mkdir tmp
chmod 777 tmp
mkdir math
chmod 777 math

post Installing OpenID with WordPress

January 16th, 2008

Filed under: A2Hosting — zedr0n @ 5:14 pm

The first part is to allow openID users to post comments on your blog, this can be easily achieved by installing Wordpress OpenID plugin. The installations is simplicity itself - just copy the plugin and activate it, nothing else required.

The other part is being able to use your blog as an openID server. I wasn’t able to find this as a plugin so I decided to go with a standalone
phpMyID. Grab the 0.7 beta here and follow the instructions in README file, they are pretty straightforward and they worked for me with no problems.

Just to note that if you want it to work with your wordpress blog you need to add to the header.php file of your current theme

<link rel="openid.server" href="http://<your-blog>/MyID.config.php" />
<link rel="openid.delegate" href="http://<your-blog>/MyID.config.php" />

If your blog is on a subdomain then MyID.config.php and MyID.php should be uploaded to the subdomain root(i.e. your-domain/subdomain).
Otherwise if you just put it into your root, it will point to your openID server - i.e. the root of your domain

post Setting up Latex with WordPress on A2Hosting

January 16th, 2008

Filed under: A2Hosting — zedr0n @ 12:20 pm

A good thing is that latex is already installed by default on the server.You can check it by logging to the server with ssh and typing “latex”

You should get smth like

xxx@yyy.com [~]# latex
This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)

Now we need to install Steve Mayer’s LatexRender plugin. To simplify the installation I used the bash installation script from Gunnlaugur Þór Briem.

Unfortunately, for some reason, the access to wget is denied to me, while curl is ok - go figure. You can check if it works for you by ssh again. In my case it just gives

xxx@yyy.com [~]# wget
-jailshell: /usr/bin/wget: Permission denied

While you are at it, check that curl is available by typing “curl”

xxx@yyy.com [~]# curl
curl: try 'curl --help' for more information

Now you can grab the updated installer script from this post - LatexRender installation script. Copy it to your /wp-content/plugins directory and run it from there.

xxx@yyy.com [~/www/blog/wp-content/plugins]# bash install-latexrender.bash
Commands latex and dvips are present.
Commands convert and identify are present.
Current directory seems correct.
Installing with BLOG_URL_BASE ''
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 20761  100 20761    0     0  83637      0 --:--:-- --:--:-- --:--:--  141k
Installing into directory latexrender
Installing with beta vertical-offset-tweaking functionality
Setting up correct php file paths and HTTP virtual paths
Setting up correct paths to tex commands and ImageMagick commands
Correcting bugs in the offset beta code
Correcting transparency bug
Plugin setup complete.
Now go to WP admin, Plugins panel, and activate the plugin LatexRender.

After activating the plugin in WordPress, the latex support can be easily obtained by using tex tag, for example

[tex] \int xdx = \frac{x^2}{2} [/tex]

will promptly show   \int xdx = \frac{x^2}{2}

P.S. If you are interested what’s the other difference in my version of installer script it also corrects the bug in offset_beta, where the ‘\’ signs weren’t all escaped. Specifically, ‘\f’ wasn’t escaped and this led to it disappearing(e.g. \formulawidth changed to ormulawidth in .tex file).
Also transparency didn’t seem to work with black on white(maybe it’s just my theme) so I had to negate the image before making it transparent…

ruldrurd
© quant0r.com , Designed by Stealth Settings
Entries (RSS) and Comments (RSS)