Websites on Bat

If you need FTP access to a web site, you can create one on Bat, in a chrooted jail that should be secure.

Addresses

Apache binds these addresses on Bat:

IP addressDNS namePurpose
212.74.28.156bat.ourshack.com
212.74.28.157customers.ourshack.com

How to create a new vhost and ftp account

Log on to customers.ourshack.com. If you don't have an account on Bat yet, contact Nic. The motd contains a couple of hints. The easiest way to add sites and users is to use the command:

Check that you're not seeing any error messages then restart apache with the command:

One thing to note is to set the domain up as xxxx.com rather than www.xxxx.com. The script automatically puts in a ServerAlias for www.xxxx.com in the apache config. It also makes the directory listing look a lot tidier.

You can add users to an existing domain with add_ncftp_user.rb They will get a chroot environment rooted at the vhost root.

By adding ncftp passwd entries directly you can get other useful effects. e.g. www.kites.org has many maintainers, each of whom looks after one subtree. They all share one uid/gid but their 'home' directories are set to prevent them seeing each other's files. The overall maintainer of the site has 'home' set to the site root and can thus work on any subtree.

Changing FTP passwords

Log on to customers.ourshack.com.

	sudo ncftpd_passwd -f /usr/local/etc/ncftpd/ncftp_passwd -p <username> -c -P <passwd>

NOTE: You now have the cleartext passwd in your Bash history, which will be saved when you logout so it is very important to clear it:

	history -c

You can also insert pre-crypted passwords (Unix-style, MD5, or Blowfish):

	sudo ncftpd_passwd -f /usr/local/etc/ncftpd/ncftp_passwd -p <username> -P <crypted-passwd>

More options can be found by running ncftpd_passwd with no args.

Where to put the files

Using you ftp client of choice, connect to customers.ourshack.com. Log in using the username and password you specified when you created the vhost. Put the files into htdocs. Your logs will appear in logs.

META


$Id: bat-websites.html,v 1.4 2005/04/29 09:33:00 root Exp $

Simon Wilcox