Category: Ubuntu
Install pandoc 1.9 on ubuntu lucid/oneric
Don't install pandoc with apt-get. Follow those instructions to get the latest version,
You need haskell-platform. Don't install haskell with apt-get, too.
Use this guide how to install haskell on ubuntu.
As soon as you are done, you can install pandoc with this:
2
$ cabal install pandoc
Remember to do this NOT with sudo, because you want to have cabal locally available with the current user.
But if it fails with:
2
3
cabal: dependencies conflict: base-3.0.3.2 requires syb ==0.1.0.2 however
syb-0.1.0.2 was excluded because json-0.5 requires syb >=0.3.3
you did accidently installed haskell-platform with apt-get. Do
and follow the link from the beginning of this post!
Remote logging with rsyslog, php and agavi
When I tried to get rsyslog running with php I didn't face much problems. Anyways I want to share some things I noticed while getting it to work.
First of all ubuntu uses rsyslog already. Just a simple
and all syslog messages went directly into the database "syslog". Configure /etc/rsyslog.d/mysql.conf to insert this information into a remote machine.
Now let's get to php. You have the option to set:
This however does log all messages with
If you want to replace "php" with a custom message, you have to call
before any error happens. Because LOG_ODELAY is given, it won't connect to syslog unless any error happens, so one should be save to put this call at the top of your dispatcher file.
The final log message will look like that (254 is the process id):
Finally I wanted to log all messages created by agavi's logging system. Since I didn't found an existing AgaviSyslogLoggerAppender, I wrote one and put it up on a github-gist.
Have fun logging!
Installing php 5.3.5/5.3.6 on Ubuntu Maverick/Lucid
Latest Version for PHP 5.3 on Ubuntu is just PHP 5.3.3. This is not so good, if you want to have some of the plenty bugfixes which will be shipped with a later version.
If you want to upgrade to 5.3.5 (5.3.6 support may come later), you can use this inofficial ppa by the nginx user at launchpad: https://launchpad.net/~nginx/+archive/php5.
For ubuntu maverick just create a file:
with the contents
2
3
deb-src http://ppa.launchpad.net/nginx/php5/ubuntu maverick main
and run:
2
$ sudo apt-get dist-upgrade
Now you have php-5.3.5 installed on your ubuntu box! Have fun.
Mysql with INNODB crashes always on startup
When I upgraded my ubuntu server to a more recent mysql version, the mysql server didn't come up anymore.
The error.log said:
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
110103 23:55:57 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Error: tried to read 65536 bytes at offset 0 4220416.
InnoDB: Was only able to read 23040.
InnoDB: Fatal error: cannot read from file. OS error number 17.
110103 23:55:57 InnoDB: Assertion failure in thread 140594203866912 in file ../../../storage/innobase/os/os0file.c line 2291
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html
InnoDB: about forcing recovery.
The deamon.log only stated:
On the web I found the hint to add skip-innodb, which didn't help, because I needed innodb for this project.
The solution was (thanks sr):
This moved the inno db index files and after that I restarted mysql and everything was fine again.
mcrypt and PHP 5.3 on Ubuntu Jaunty
My dedicated server still runs on ubuntu jaunty. I wanted to move on to php 5.3 (php 5.2.16 was the final release of the php 5.2 series). The issue is: php 5.3 is not available in jaunty repositories, because it will stay at 5.2.
Installing php 5.3 was simple, just add to:
the following:
2
deb-src http://php53.dotdeb.org stable all
Install the dotdeb pgp key:
Update the apt cache and upgrade php5:
But when you want to install phpmyadmin again now, it fails.
Luckily you can get that (mcrypt) by adding the lenny updates repository manually:
add:
Install the debian gpg:
Now update again:
and install php5-mcrypt flawlessly:
I commented out the new sources.list entries after the install, because I don't need them to be checked on every update.
HTTPS + NGINX with self signed SSL certificate
If you want to use https with nginx on your dedicated server, you have the option to buy a certificate. The other way, even though less secure for your clients: create a self signed certificate.
I want to show, how you can create a self signed certificate and how to use it with nginx on an ubuntu linux.
Open a root shell and head to the nginx configuration folder.
2
# cd /etc/nginx
Generate the self signed certificate and answer the questions.
Now make the files only visible to the owner (root).
Add the ssl section as new site:
with this code:
2
3
4
5
6
7
8
9
10
11
12
13
14
15
listen 443;
ssl on;
ssl_certificate /etc/nginx/server.crt;
ssl_certificate_key /etc/nginx/server.key;
server_name ssl.example.org;
location / {
root /var/www/ssl.example.org;
index index.php;
}
# ... and so on
}
Reboot nginx:
Head to your site: https://ssl.example.org. You'll recieve a message in your favorite browser saying that the certificate is insecure, because the author signed it on his own. You have to make an exception.
This does not look very professional. So you should use this procedure only for projects, where you can live with this 'error message'.


