My ongoing experiences with Ubuntu, and later Mythbuntu, as a media center with MythTV. I'm also using the system for a virtual machine server, a mediawiki server and a general all around home infrastructure base.

Saturday, August 9, 2008

Adding SSL support to Apache2

I wanted to increase security and add https support to my Apache2 install. Poking around I found directions here. Which I basically followed:

# apt-get install ssl-cert
# mkdir /etc/apache2/ssl
# make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/apache.pem
# a2enmod ssl
# cp /etc/apache2/sites-available/default /etc/apache2/sites-available/ssl
# vi /etc/apache2/sites-available/ssl
# diff /etc/apache2/sites-available/default /etc/apache2/sites-available/ssl
1,2c1,2
< NameVirtualHost *
< <VirtualHost *>
---
> NameVirtualHost *:443
> <VirtualHost *:443>
4a5,7
> SSLEngine On
> SSLCertificateFile /etc/apache2/ssl/apache.pem
>

# a2ensite ssl
# /etc/init.d/apache2 reload
# cp /etc/apache2/sites-available/default /etc/apache2/sites-available/default.orig
# vi /etc/apache2/sites-available/default
# diff /etc/apache2/sites-available/default.orig /etc/apache2/sites-available/default
1,2c1,2
< NameVirtualHost *
< <VirtualHost *>
---
> NameVirtualHost *:80
> <VirtualHost *:80>


But then I ran into this problem:
# /etc/init.d/apache2 start
* Starting web server (apache2)...
[Sat Aug 09 17:28:50 2008] [warn] The Alias directive in /etc/apache2/sites-enabled/001-mediawiki at line 1 will probably never match because it overlaps an earlier Alias.
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
...fail!


Which I fixed by commenting out the Listen directive in ports.conf:
# vi /etc/apache2/ports.conf
# cat /etc/apache2/ports.conf
#Listen 80


That got things working.

While I was playing with Apache configuration, I went ahead and fixed a warning about a undefined server name:

# vi /etc/apache2/apache2.conf
# grep ServerName /etc/apache2/apache2.conf
ServerName casey.vwelch.com

Wednesday, July 30, 2008

LIRC (remote) not working

I rebooted my Ubuntu system and suddenly the remote wasn't working. I poked around and noticed lirc was not running.

# ps auxwww | grep lirc
root 14915 0.0 0.0 2884 752 pts/0 R+ 21:09 0:00 grep lirc
#


Poking around in the logs, it looked like lirc was dying when lircmd was started (I verified this by starting them sequentially):

# tail /var/log/daemon.log
Jul 30 21:00:43 casey lircd-0.8.2-CVS[6792]: lircd(userspace) ready
Jul 30 21:00:48 casey lircd-0.8.2-CVS[6792]: accepted new client on /dev/lircd
Jul 30 21:00:48 casey lircd-0.8.2-CVS[6792]: could not get file information for /dev/lirc
Jul 30 21:00:48 casey lircd-0.8.2-CVS[6792]: default_init(): No such file or directory
Jul 30 21:00:48 casey lircd-0.8.2-CVS[6792]: caught signal
#


So I downloaded LIRC 0.8.3 (I had been running 0.8.1) from the project download page and build according to directions at: http://www.mythtv.org/wiki/index.php/LIRC_on_Ubuntu_Edgy_Eft

Then the daemon seemed to start fine, though I still had to reboot to get the remote working.

# /etc/init.d/lirc start
Starting lirc daemon: lircd lircmd.
# ps auxwww | grep lirc
root 14842 0.0 0.0 0 0 ? S 21:07 0:00 [lirc_dev]
root 14909 0.0 0.0 2876 552 ? Ss 21:09 0:00 /usr/sbin/lircd --device=/dev/lirc
root 14911 0.0 0.0 1636 236 ? Ss 21:09 0:00 /usr/sbin/lircmd
root 14915 0.0 0.0 2884 752 pts/0 R+ 21:09 0:00 grep lirc
#

Saturday, May 10, 2008

Fixing the auto-updating

A while ago I set up automatic updating of patches. Well, today I took a look and it didn't look like things were working (running 'apt-get dist-upgrade' produced a big, long list of stuff that needed to be installed).

I added "-y" to the "apt-get" command in /etc/cron.daily and that seemed to fix things:
# vi /etc/cron.daily/auto-update
# cat /etc/cron.daily/auto-update
#!/bin/bash
/usr/sbin/cron-apt
/usr/bin/apt-get -y dist-upgrade