a document
This is where you'd want to start. It will take you from a plain FreeBSD installation to a platform that is ready for Berylium and much, much more.
Asparagus FreeBSD setup notes Serial Console Install
Pretty simple (once you learn that the cu command on Red Hat is provided by the uucp package). To enable serial console access in the future, configure TTYs from the main sysinstall menu, and make sure the console looks like:
console "/usr/libexec/getty Pc" cons25 on secureThis is insecure for a remote installation, but perfect for now. Reboot, reconnect, and everything should just work. If not, mess with it till it does. :-/
One final step-- if you didn't add a regular user during install, you may want to permit root access via ssh:
# ee /etc/ssh/sshd_configUncomment the "permit root logins" line and change it to yes. Restart sshd or reboot. Make sure you can connect via both the console (serial cable) and ssh.
Finally, you'll need to edit /etc/make.conf in order to set up a proper build environment for your software. (use asparagus/templates/make.conf as a base)
Update, Update, Update
Before you install anything else, get cvsup working and update both your /usr/src directory and the ports collection. Oh boy, it's fun because you'll be rebuilding the kernel and everything. See: Updating FreeBSD Using cvsup and Keeping Installed Packages Up to Date.
- Install cvsup-without-gui from ports:
cd /usr/ports/net/cvsup-without-gui
make install- Copy the cvsup recipes to /usr/local/etc:
cp /usr/share/examples/cvsup/stable-supfile \
/usr/local/etc/stable-supfile
cp /usr/share/examples/cvsup/ports-supfile \
/usr/local/etc/ports-supfile- Edit the cvsup recipes for both stable and ports -- you just need to specify the server to use, see the list of cvsup mirrors:
ee /usr/local/etc/stable-supfile
ee /usr/local/etc/ports-supfile- Update your sources:
cvsup -g /usr/local/etc/stable-supfile
cvsup -g /usr/local/etc/ports-supfile- Follow the instructions in Updating FreeBSD Using cvsup to make world and build a custom kernel
.- On reboot, install portupgrade and update all previously installed ports:
cd /usr/ports/sysutils/portupgrade
make install
portsdb -Uu
portupgrade -aiRr- Go have a beer / smoke / coffee / etc
Build Up Your Software Collection
Once FreeBSD is installed and up to date, you will need to add a bunch of software and further configure the system:
- Install bash2 from ports: /usr/ports/shells/bash2
- Create a symbolic link to the updatedb script for locate:
cd /sbin
ln -s /usr/libexec/locate.updatedb updatedb
updatedb- (get .bashrc into /root)
- (make changes to make.conf)
- Install your editor of choice from ports: /usr/ports/editors
I recommend nano, a pico clone- simple and straightforward.
Those with previous Unix experience may prefer vi or emacs.- mm: Shared memory allocation library for pre-forked process models
/usr/ports/devel/mm
- proftpd: Highly configurable ftp daemon
/usr/ports/ftp/proftpd
nano -w /usr/local/etc/proftpd.conf
-- add the following to the default config:DeferWelcome on
DisplayLogin /etc/motd
IdentLookups off
UseReverseDNS on
RequireValidShell off
ScoreboardFile /var/run/proftpd.scoreboard
DefaultRoot ~
PassivePorts 3300 3400/usr/local/libexec/proftpd
test it!- add mysql user (and/or create /home/mysql)
remember not to give it a shell or even a password (to prevent logins)
- mysql: Multithreaded SQL database
/usr/ports/databases/mysql40-server
-- after installing the port, you may need to...
cd work/mysql-4.0.14/scripts
./mysql_install_db
cd /home/mysql/data
chown -R mysql.mysql mysql test
-- start the server
mysqld_safe --user=mysql --datadir=/home/mysql/data --skip-networking &
-- set a root password
mysqladmin -u root password new_password
-- make all access localhost
mysql -u root -p mysql
delete from user where Host!='localhost';- postfix: A secure alternative to widely-used Sendmail
/usr/ports/mail/postfix
follow additional recommendations re: disabling sendmail
be sure to alias root to your address
- UW-IMAP: University of Washington IMAP4rev1/POP2/POP3 mail servers
install from source (ignore the port, it won't work with php)
cd /tmp
wget
cd /usr/local/src
tar xzvf /tmp/imap-2002d.tar.Z
cd imap-2002d
echo "SSLDIR=/usr SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib" > SPECIALS
nano -w Makefile
-- edit the makefile, setting the following two options in their respective locations:EXTRACFLAGS='-DSSL_CERT_DIRECTORY=/usr/local/certs'
SPECIALS='SSLDIR=/usr SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib'make bsf
cp -v imapd/imapd /usr/local/libexec
cp -v ipopd/ipop3d /usr/local/libexec
chmod 700 /usr/local/libexec/imapd
chmod 700 /usr/local/libexec/ipop3d
cd c-client
cp -v c-client.a /usr/local/lib/libc-client.a
cp -v c-client.h imap4r1.h rfc822.h mail.h linkage.h env.h \
env_unix.h fs.h ftl.h misc.h nntp.h nl.h osdep.h smtp.h \
tcp.h /usr/local/include/
nano -w /etc/pam.conf
-- comment out existing imap and pop3 lines, add:imap auth required pam_unix.so
imap account required pam_unix.so
imap session required pam_unix.sopop3 auth required pam_unix.so
pop3 account required pam_unix.so
pop3 session required pam_unix.sonano -w /etc/inetd.conf
-- add:pop3 stream tcp nowait root /usr/local/libexec/ipop3d ipop3d
imaps stream tcp nowait root /usr/local/libexec/imapd imapdkillall -HUP inetd
make cert <-- not documented yet...- ImageMagick-noX11: Image processing tools
/usr/ports/graphics/ImageMagick- wget: Retrieve files from the Net via HTTP and FTP
/usr/ports/ftp/wget- aspell: Spelling checker
/usr/ports/textproc/aspell- gd-nox11: A graphics library for fast creation of images
/usr/ports/graphics/gd-nox11- bison: A parser generator from FSF (for compiling PHP)
/usr/ports/devel/bison- Install Apache/mod_ssl/PHP from source -- see Apache_SSL_PHP_install.html
- p5-Geo-IP: Gets country name by IP or hostname
/usr/ports/net/p5-Geo-IP- awstats: Free real-time logfile analyzer to get advanced web statistics
/usr/ports/www/awstats- Copy Apache icons to /usr/local/www/icons (so that all icons are in one place)
cp -rv /usr/local/apache/icons/* /usr/local/www/icons/- procmail: A local mail delivery agent
/usr/ports/mail/procmail- libmcrypt: Multi-cipher cryptographic library
/usr/ports/security/libmcrypt
Asparagus Custom Configuration Files
Custom configuration files are suggested (aside from the small mods indicated above) in only four cases: make.conf, httpd.conf, php.ini, and awstats's domain configurations.
Need to hook into mergemaster somehow in order to deploy these.
Startup Scripts
Creating Jails
By Chris Snyder on September 5, 2003 at 3:41pm