Showing posts with label administration. Show all posts
Showing posts with label administration. Show all posts

Monday, April 27, 2015

Apache mod_status page mangled by mod_rewrite?

Quicktip: if a complicated mod_rewrite setup is making your /server-status inaccessible, just paste the following two lines above all the rewrite rules:

RewriteCond %{REQUEST_URI} /server-status
RewriteRule .* - [L]

and you're ready to set up monitoring of Apache processes.
If the rules are in /etc/apache2, not in .htaccess, you need to reload the web server too:

/etc/init.d/apache2 reload

You know you shouldn't use .htaccess anyway because it hurts performance, right?

Wednesday, January 8, 2014

e503 no service

Pound is a popular load balancer / SSL terminator. As it usually happens with open source programs, there is plenty of documentation and self-help available on the internet, but there's one error message I could not find. Pound denied access to the web site and logged the following message:

pound: (756000001700) e503 no service "GET / HTTP/1.1" from 12.34.56.78 www.thedomain.com

I've found out that access to a service has been blocked by a HeadDeny directive. The specific problem was denying requests containing the X-Forwarded-For header - which blocked access by users behind proxies. Changing HeadDeny in service to a HeadRemove in listener fixed the problem.

Friday, March 8, 2013

MySQL administration tool

Administrating a server set up by someone else can be a real pain. One of the problems I have regularly encountered on clients' systems has been database administration. While you can perform some tasks from command line, I really can't imagine working without a tool like PHPMyAdmin.

PHPMyAdmin, however, has a number of problems. The main one for me is its installation process which is much harder than necessary and involves editing configuration files. Consulting time spent installing PMA vs doing actual work is rather hard to explain to customers. So I started looking for alternatives.

The tool I've found performed beyond my wildest expectations. It consists of a single file (which is, by the way, interesting - they "compile" a nice, readable PHP source tree into a single minified PHP file). Not only it supports MySQL, but works with Postgres, SQLite, MS SQL and Oracle. It has a pretty, minimalistic interface. It's fast - not only it executes fast on the server, but it generates small pages so working on a slow network isn't a problem. And - best of all - the one-step installation process consists of uploading a single PHP file to the server.

Adminer, the tool I'm writing about, supports everything I care for. Some things could be done better or easier, but it's a really viable PHPMyAdmin alternative - I never found myself in a position where I couldn't do something and had to install PMA.

As usual, if you need help making your website faster, be sure to contact us.

Friday, January 11, 2013

Rails + supervisord (named sockets)

A recent upgrade of our project management software, Chili Project, was a good opportunity to make it run like other services - ran from Supervisord, connected via FastCGI. Unfortunately, Rails doesn't make it easy to listen for FCGI connections on a named socket.

After some research, I've found a way to run Chilli Project (and, in fact, any rails app) this way. I've put this little script into scripts/ subdirectory of the rails app:

Also, for completeness: contents of /etc/supervisor/conf.d/redmine.conf

Need help hosting Rails?

Tuesday, August 28, 2012

Cron log in Debian 6

By default, Debian only sends results of cron jobs by email. In some cases, however (no direct internet connection), you want them logged in a regular log file in /var/log. In Debian Squeeze it's not the default but it's very easy to change it. Just edit /etc/rsyslog.conf and uncomment the following line:

cron.*                          /var/log/cron.log

Then, restart rsyslogd by executing service rsyslog restart. Viola!