Posts Tagged ‘server’
May 4th, 2009
Are you seeing errors for content length in your Apache Bench tests of your webserver?
I had a hell of a time wondering what was going wrong with my webserver under load and finally found the answer here.
Turns out that Apache Bench takes the first pulled request and compares the length to all subsequent requests. Makes sense for a purely static page, but when you have a random image cropping up, you’re sure to see at least a couple bits difference in length.
So if you’re serving straight, hand coded HTML, enjoy the feeling of knowing that you’re getting the same length content each and every time… but if you’re like the rest of us (and anyone who would actually be using Apache Bench) feel free to rage that there’s no command line switch to turn off that silly notification.
Tags: apache, benchmarking, commandline, server, system, testing, tools
Posted in system | No Comments »
April 20th, 2009
So the Sweetcron documentation isn’t altogether clear on what you should put in cron for it to update automatically, rather than slowing down a user every 30 minutes.
It’s fairly intuitive, but for those missing this logical step, do the following.
Change the setting in the admin panel from psuedo-cron to true-cron, and take note of the URL.
Then put the following in your crontab file (easily accessed with ‘crontab -e’ on a debian machine):
1
| */5 * * * * curl http://your/true-cron/url |
You can change the 5 to be the number of minutes between updates that you want, and you’ll definitely want to change the URL to the one listed in your Sweetcron’s admin page.
Tags: amdavidson.me, host, lifestream, server, sweetcron, system
Posted in site updates | No Comments »
April 20th, 2009
Had a Tumblr setup for a while at amdavidson.me but I already have a webserver and didn’t like dealing with another host.
So I searched around a bit and Sweetcron came up as a viable alternative for an aggregator for all my internet activities. It’s a pretty cool little app, very lightweight and seems to be pretty extensible, if I get around to it.
Anyways, check it out, it has a good summary of all the useless stuff that I do on the internet, all three of the blogs, my twitter account, my delicious bookmarks, and my flickr pictures. One stop shopping.
Tags: amdavidson.me, blog, configure, lifestream, server, sweetcron, theme, tumblr
Posted in Uncategorized | No Comments »
April 3rd, 2009
Switch…
That’s all I have to say. Passenger/mod_rails is so much faster and more competent at serving my crappy RoR code than my hacked together mongrel/nginx scheme that I had before.
My ram usage spikes much more when visitors hit the site, but never starts swapping. The increased ram usage is more than worth it for the HUGELY increased speed that I’m seeing by the dynamic mongrel management.
Even better, when the visitors leave (as often happens), the ram usage settles down to the same place it did with my nginx and mongrel combo.
Enjoy the increased speed and stability AMDavidson.com visitors.
Tags: apache, mod_rails, mongrel, nginx, rails, server, site
Posted in rails, system | No Comments »
March 31st, 2009
I was ignorantly happily letting my gems be pulled in automatically on my previous server using Nginx + Mongrel_Cluster and this seemed to pose no problems.
BUT! when I switched to a new host, I went with an Apache + Passenger (mod_rails) setup and my servers would start but would just offer “Error 500″.
I checked the logs and it seemed that it wasn’t loading RedCloth so I added the following to my environment.rb file and it all worked fine!
1 2 3
| # config/environment.rb
require 'rubygems'
require 'redcloth' |
Tags: apache, mod_rails, mongrel, nginx, passenger, rails, server, update
Posted in rails, system | No Comments »
March 23rd, 2009
Here are some highlights for configuring Postfix to use Courier-Maildrop for local delivery.
This allows some advantages over just having postfix deliver, because you can do server-side filtering of spam and mailing list messages to de-clutter your inbox.
All these notes are based on configuring the setup on Ubuntu 8.10 (Intrepid Ibex) with Debian Lenny’s courier-maildrop
The following are snippets from my configuration files, highlighting the changes that I had to make, from an already existing mail server. If these look unfamiliar, or you need more assistance setting up the basic framework of a Postfix + Courier-IMAP mail server, start here.
1 2 3 4 5 6 7
| #/etc/courier/maildroprc
EXTENSION="$1"
RECIPIENT=tolower("$2")
USER="$3"
HOST="$4"
SENDER="$5"
DEFAULT="/home/vmail/$HOST/$USER/." |
1 2 3
| #/etc/postfix/main.cf
virtual_transport = maildrop
maildrop_destination_recipient_limit = 1 |
1 2 3
| #/etc/postfix/master.cf
maildrop unix - n n - - pipe
flags=ODRhu user=vmail argv=/usr/bin/maildrop -w 90 -d ${user}@${nexthop} ${extension} ${recipient} ${user} ${nexthop} |
So if you have a working mail server: make these changes, sudo /etc/init.d/postfix restart, and then get to work writing your .mailfilters!
Tags: configure, courier, debian, email, intrepid, lenny, maildrop, postfix, server, ubuntu
Posted in email, system | No Comments »
March 23rd, 2009
Ubuntu 8.10’s courier-maildrop is not compiled against courier-authlib and so cannot read from many of the supported authentication schemes that authlib can support.
Fortunately, Debian Lenny’s can. So if you’re having trouble you can try and install the package from that distribution, YMMV.
To save you the effort of going out and locating it, I’ll attach a version of it here. Use it at your own risk, but it’s working for me.
courier-maildrop_0600-2_amd64
Tags: courier, debian, email, intrepid, lenny, maildrop, server, ubuntu
Posted in email, system | 1 Comment »
March 21st, 2009
Here are the steps that I went through to migrate my Postfix/Courier server from Slicehost to Mosso.
- Check current DNS MX records for applicable domains. I had mine set to all go through a central A record (my mail server) so it was easy.
- Set MX records to expire quickly (I think the minimum is 60 minutes). This can take 24 hours to propogate, so do this early, and then you’ll have time to do the rest of the processing.
- Configure Postfix/Courier/IMAP as desired on new server. There are a lot of howtos on this, and some hints on this site, so I won’t go over how to do this here.
- Test server to ensure that email can go in and out and that any spam filtering or other processes are operating well.
- I use MySQL for managing users and forwardings, so I dumped and locked my existing database, and copied that to the new database.
- Rsync maildirs over from the old server to the new server. This can take a while, depending on server speed and bandwidth.
- Ensure that Postfix and Courier are up and running on the new server.
- Change central DNS record to point to new server IP address.
- Stop Postfix and Courier on old server. This could lead to a couple of bounced emails, but in all likelihood the sending email servers will retry and find their way to the new server.
- Watch closely.
There should be very little loss of email, connectivity, or data using this path.
If anyone has any better suggestions, let me know.
Tags: configure, courier, email, postfix, server
Posted in email, system | No Comments »
March 20th, 2009
If you are having issues getting an SSL connection to Courier IMAP. Check your certificate files.
1 2
| # In /etc/courier/imapd-ssl
TLS_CERTFILE=/etc/ssl/private/certificate.pem |
Courier is expecting a PEM file for TLS_CERTFILE with your certificate and private key. Do not use just your certificate.
Also, if you require intermediate certificates to complete the trust chain, you can include them in this file.
MAKE SURE that you have proper permissions on this file to the security of your private key.
Tags: certificate, configure, courier, email, postfix, server, ssl
Posted in email, system | No Comments »
March 20th, 2009
If you need postfix to listen on multiple ports (like I do) add lines like the following (replace numbers with whatever ports you desire):
1 2 3
| # In /etc/postfix/master.cf
25 inet n - - - - smtpd
26 inet n - - - - smtpd |
Make sure to open the ports in iptables as well.
Tags: configure, email, iptables, ports, postfix, server
Posted in email, system | No Comments »