Category: Ubuntu

rss

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:

1
$ gedit /etc/apt/sources.list.d/php5-ppa.list

with the contents

1
2
3
deb http://ppa.launchpad.net/nginx/php5/ubuntu maverick main
deb-src http://ppa.launchpad.net/nginx/php5/ubuntu maverick main

and run:

1
2
$ sudo apt-get update
$ sudo apt-get dist-upgrade

Now you have php-5.3.5 installed on your ubuntu box! Have fun.

In Linux, php & Ubuntu By DracoBlue @ 22:02 13.04.2011

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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
InnoDB: Log scan progressed past the checkpoint lsn 0 726937418
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:

1
Jan 3 23:55:57 myhostname init: mysql post-start process (28722) terminated with status 1

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):

1
# mv /var/lib/mysql/ib* /root/

This moved the inno db index files and after that I restarted mysql and everything was fine again.

1
# restart mysql
In Linux, mysql & Ubuntu By DracoBlue @ 00:03 04.01.2011

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:

1
$ vim /etc/apt/sources.list

the following:

1
2
deb http://php53.dotdeb.org stable all
deb-src http://php53.dotdeb.org stable all

Install the dotdeb pgp key:

1
# curl http://www.dotdeb.org/dotdeb.gpg | apt-key add -

Update the apt cache and upgrade php5:

1
# apt-get update
1
# apt-get install php5

But when you want to install phpmyadmin again now, it fails.

1
php5-mcrypt: Depends: libltdl3 (>= 1.5.2-2) but it is not installable

Luckily you can get that (mcrypt) by adding the lenny updates repository manually:

1
# vim /etc/apt/sources.list

add:

1
http://security.debian.org/debian-security lenny/updates main

Install the debian gpg:

1
# gpg --keyserver wwwkeys.eu.pgp.net --recv-keys 9AA38DCD55BE302B

Now update again:

1
# apt-get update

and install php5-mcrypt flawlessly:

1
# apt-get php5-mcrypt

I commented out the new sources.list entries after the install, because I don't need them to be checked on every update.

In Articles, Linux, php & Ubuntu By DracoBlue @ 12:37 19.12.2010

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.

1
2
$ sudo -s
# cd /etc/nginx

Generate the self signed certificate and answer the questions.

1
# openssl req -new -x509 -nodes -out server.crt -keyout server.key

Now make the files only visible to the owner (root).

1
# chmod 600 server.key

Add the ssl section as new site:

1
# vim sites-enabled/ssl.example.org

with this code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
server {
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:

1
# /etc/init.d/nginx restart

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'.

In open source, Articles, Linux, Ubuntu & NGINX By DracoBlue @ 12:32 19.12.2010

LFE (sub-woofer) disabled in Ubuntu 10.10 Maveric Meerkat

When I updated to ubuntu 10.10, I had this mysterious problem.

The sub-woofer just worked one time right after I clicked the "5.1 System" in the ubuntu sound options. As soon as a song ended, the sub-woofer was mute again.

I expected this to be an issue of the pulseaudio integration in 10.10. The reason was way simpler!

In 10.10 by default:

1
enable-lfe-remixing = no

is set in

1
/etc/pulse/daemon.conf

Just change this to

1
enable-lfe-remixing = yes

and pulseaudio will mix the 2 channel sound tracks up to the 5 channels including LFE!

In open source, Articles, Linux & Ubuntu By DracoBlue @ 13:00 05.12.2010

Cannot connect to ICQ on Ubuntu Maveric Meerkat

Today I expirienced the issue, that empathy (the ubuntu icq, msn, facebook, ... client) was not able to connect to ICQ anymore.

To fix that issue, just install pidgin ppa (yes, I know you want empathy, but you'll need libpurple to fix it for empathy!).

Then

1
$ sudo apt-get update && sudo apt-get dist-upgrade

You'll see something like:

1
2
Configuring libpurple-bin ein (1:2.7.5-1ubuntu2+pidgin1.10.10) ...
Configuring libpurple0 ein (1:2.7.5-1ubuntu2+pidgin1.10.10) ...

and everything is fine again. Just restart empathy!

Thanks to twenty-three for the hint.

In open source, Articles, Linux & Ubuntu By DracoBlue @ 21:26 18.11.2010