12/02/05

Lately I've been working on the new webserver machine for VTK. Today I configured mod_security for Apache2, partially by using the rules one can find on gotroot.com.
On the site a little script is provided to update the rules automagicly (in a cronjob or something alike), but when I started using the script I didn't like it for several reasons.
So I decided to rewrite it to suit my needs. You can find my enhanced version here.

The machine now also runs PHP4 and PHP5 side by side thanks to this great documentation (and the Gentoo PHP herd developers, obviously). PHP4 as an Apache module (because this is the "default", so it must run as efficient as possible), PHP5 using the CGI interface for all .php5 files.
We can't make "the big switch" to a PHP5-only server due to our bloody PhpBB forum which is not PHP5 compatible. And as our forum is one of the biggest PHP consumers on the server, I don't want to run PHP4 as CGI and only run the forum this way.

[edit]
I enhanced the script a little more, here's a diff:

--- update_mod_security_rules.sh        2005-12-02 14:46:02.000000000 +0100
+++ update_rules_v2.sh  2005-12-04 14:34:33.000000000 +0100
@@ -15,6 +15,7 @@
 APACHESTART="/etc/init.d/apache2 restart"
 MODSECPATH="/etc/modsecurity"
 APACHEPID="/var/run/apache2.pid"
+APACHECTL="/usr/sbin/apache2ctl"

 #Modules
 #If you want the "exclude" rules, they should be the first entry in the list
@@ -59,10 +60,21 @@

 echo "Make sure you got \"Include ${MODSECPATH}/all.conf\" somewhere in your Apache config"

+${APACHECTL} configtest > /dev/null 2>&1
+if [ ! "x$?" = "x0" ]; then
+        echo
+        echo "There's something wrong in Apache's configuration:"
+        echo
+        ${APACHECTL} configtest
+        echo
+        echo "Exiting, not restarting Apache"
+        exit 1
+fi
+
 # try restart
 if [ "$UPDATED" -gt "0" ]; then
         echo -n "Restarting apache: "
-        /bin/kill -HUP ${PID} 2>/dev/null
+        ${APACHECTL} graceful
         # did it work?
         if `/bin/kill -CHLD ${PID} >/dev/null 2>&1`; then
                 echo "ok."

The script

Permalink . Ikke . 03:01:15 pm . 414 Words . Technology, Linux, Networks . . 818 views . 2 comments

11/25/05

Spam attack

This blog is under a massive referer spam attack at the moment by multiple spambots. I'm trying to get rid of them using .htaccess, but it hardly works.
Those spambots already consumed all my monthly bandwith, so I really need them to go away. If someone knows how to do this (I googled around, no usable help), please let me know asap, otherwise I'll be forced to take this blog down for some days I'm afraid... Maybe I should switch to WordPress here too.

My sincere apologies if I broke something in the blog setup, or if some people are unable to reach the site although they're not spammers.

Permalink . Ikke . 11:24:29 am . 109 Words . Technology . . 389 views . 6 comments

11/23/05

Non-tech people on tech stuff

Read this.

Reminds me on an article on "Web 2.0" in our newspaper some days ago, and a "readers reaction" on it yesterday. Obviously 2 people who don't understand what it's all about. Sadly enough.

Permalink . Ikke . 01:31:34 pm . 33 Words . Life, Linux . . 477 views . 3 comments

11/19/05

OOo2 on 770
Permalink . Ikke . 09:17:00 pm . 23 Words . Desktop . . 1059 views . 5 comments
Remote X on Nokia 770: schreenshots

Due to the fact that the screenshot tool had a bug at the time I gave remote X windows a try on the N770, I could't post any 'proof'.

But, that screenshot-bug has been solved, and I connected my N770 to the fresh install of Ubuntu Linux so I could take shoot some screens. It took me about 4 minutes to make my N770 talk to the pc (Ubuntu recognised my usb bluetooth key immediately, it really wasn't hard at all). I installed the openssh-server on the pc (enabled it in Synaptic, and pressed Apply, easy stuff), started it, and logged in with my N770.

This time I used some new command line options (thank you daf):

ssh -X user@server -c blowfish -C

And I started oowriter2 again:

oowriter2 starting...
(Larger image)

and a few seconds later (the pc is quite old):

oowriter2 on N770
(Larger image)

Then I gave The Gimp another try, but the lag was still there. It was better a bit faster than without the compression settings for the ssh connection, but nowhere near usable. :-(

btw, has anyone tried this keyboard with the N770 yet? Does it work? Or should/will it work? Plz let me know!

Permalink . RealNitro . 19:54:46 . 261 Words . Coding . Email . 1229 views

<< Previous Page :: Next Page >>