Hopefully you have been following along with us in setting up a FreeBSD Server with Ruby on Rails. If you haven’t, just review so that you will be up to speed.
Lets get started by setting up lighttpd from the ports. If you want to use MySQL to install vhosts in, please have a look at our Install MySQL 5.x on FreeBSD how-to.
[server][root][~]# portinstall lighttpd
Make sure OpenSSL is selected along with any other options you might want.
Now lets make sure lighttpd gets started when the server boots.
[server][root][~]# echo 'lighttpd_enable="YES"' >> /etc/rc.conf
Create your directory structure where you web site documents go. We can change this later, so lets just give it what lighttpd is expecting without modifying them /usr/local/etc/lighttpd.conf file.
[server][root][~]# mkdir -p /usr/local/www/data
Now lets give the www user and the www group that was setup during the lighttpd install ownership.
[server][root][~]# chown -R www:www /usr/local/www
Lets create our log fils and chown (change owner) of the files so that lighttpd can write to them.
[server][root][~]# touch /var/log/lighttpd.access.log [server][root][~]# touch /var/log/lighttpd.error.log [server][root][~]# chown www:www /var/log/lighttpd.*.log
Now lets see how everything worked out.
[server][root][~]# /usr/local/etc/rc.d/lighttpd.sh start
Open Firefox and point it to your IP, http://127.0.0.1 if you are doing this on your workstation. If you receive 404 – Not Found in your browser, then your all set.
We will do some lighttpd configuration later when we get ready to install a Ruby on Rails application.
Until next time… adios amigo’s.
Rails Server Setup:
Part 1: New Server Setup
Part 2: Setup FreeBSD 6.x
Part 3: FreeBSD Usability
Part 4: Setup FreeBSD To Use Blowfish
Part 5: Install and Setup PostgreSQL
Part 6: Install Lighttpd on FreeBSD
Part 7: Install MySQL 5.x on FreeBSD
Part 8: Install Ruby On Rails with FreeBSD