Posts Tagged ‘apache’

Ubuntu Server Setup Checklist

June 20th, 2009

I’ve now set up half a dozen or so Ubuntu Server installations over the past year or two.  For the last few, I created a checklist to make sure I don’t leave any of the smaller, less obvious things out.  I present it here, completely unmodified.  Note, this is more of a preliminary checklist, as it doesn’t include installation of Apache, MySql, PHP or any other programs such as Postfix.  Basically, I’ll perform these steps regardless of whether It’ll be a web or mail server.  These also assume you like the vi text editor, if not, you can substitute emacs, nano, or whatever your preference when neccesary.  Also, some of these are already done depending on your server host.

Time/Date/Language
Fix Locale Warnings:
# apt-get install language-pack-en

Set Timezone:
# dpkg-reconfigure tzdata

Install Time Daemon:
# apt-get install ntp

General
Install Manual Pages:
# apt-get install man

Add Domain name
# vi /etc/hosts
127.0.0.1 localhost
123.456.789.012 computername.domain.com computername (replace external ip)

Security
Add Administrative User (with home directory):
# useradd myusername -m

Give Admin user Sudo Powers
# visudo
myusername ALL=(ALL) ALL

Set Admin Password
# passwd myusername

Set Admin Shell Preference (optional)
# vi /etc/passwd
myusername: [...] :bash

Disable Root SSH Login:
# vi /etc/ssh/sshd_config
PermitRootLogin no <–MAKE SURE YOU CREATED ADMIN & PASSWORD

Tighten default permissions for file & directory creation:
# vi /etc/profile
umask 027 (no default access for others)

Install and Set Up Firewall
# apt-get install ufw
# ufw allow ssh <–DO NOT FORGET THIS
# ufw enable

Book Review: Apache Cookbook

November 30th, 2008
Apache Cookbook

Apache Cookbook

I just finished reading Apache Cookbook, Ken Coar and Rich Bowen. I’d give it a solid 4 stars. I found it to be very readable, and not overly verbose or cryptic, a problem that can plague computer books. The book is quite the opposite, if I had one criticism, it would be that it could be a little thicker. It’s only 264 pages, and the font is plenty big, which makes for a fast read.

Having set up and run an apache server for a few months, I skipped over many of the early parts of the book. However, I did find lots of useful tips, tricks and tidbits, that I know will come in handy later. For example, I didn’t know you could make a custom log for any site, with any file, that contains almost any information. You simply specify a CustomLog directive for whatever host you want to monitor. I now set up several specific logs show me only the information I find useful.

Other useful directives are RewriteEngine and RewriteRule. You can do almost anything you want with the URLs from your site, including redirection, query string modification, folder modification, clean URLS and more. This all comes from the module mod_rewrite. There’s useful info on authentication and authorization, dynamic content, custom error pages, email notification, and much more.

Here’s a doozy: you can now use apache’s mod_proxy_balancer to balance a load between a cluster of computers! Who knew it was so easy! You can even specify with the ProxyPass directive whether to distribute by bandwith, or by requests!

A few other tidbits that I’m sure will be useful are the Apache bench utility for benchmarking site performance, and server-status which can monitor your server health and display it somewhere in your website.

All in all, I’d recommend the book, and I see it being a useful reference in the future