Run Your Own Unix Web Server (part 1 of 3)
Part 1 of 3 / Install FreeBSD
Setting up and running a Unix web server is surprisingly easy. Recently, on del.icio.us, I ran across the article Become Your Own Web Host in 75 Steps. Without too much explanation, the article describes how to install FreeBSD, MySQL, PHP, and Apache. Hopefully the following series will expand on that article and go a little deeper.We will be installing:
- FreeBSD (STABLE)
- MySQL
- Apache
- PHP
- and some other apps helpful to webmasters
- 1 blank CD
- A CD burner
- A computer with an ethernet card
- An Internet connection with a static IP address
Download FreeBSD
Your new webserver can be any old, cheap, Intel-based box, as FreeBSD will run on any old piece of crap.
-
First, make sure your computer is compatible
- Go to the FreeBSD Releases page
- Check Hardware Notes for the Stable Release
- Make sure your hardware is compatible with that release. I can almost guarantee that it is...
-
Download FreeBSD
- Go to the FreeBSD home page
- Follow instructions for downloading the production/stable release
- Download just the disc1.iso ISO image
- Burn the iso to your blank CD
Boot up Install CD
Now you should have:
- 1 FreeBSD ISO CD
- 1 computer (with a network card) ready to be transformed into a web server
Installer Notes:
- Use the arrow keys to move
- Use space to select
- Use enter to execute/select
- Don't use the number pad; stick to the regular number keys
- Boot up
Put your freshly burned CD into the soon-to-be webserver and turn it on. If all goes well you'll see the FreeBSD daemon asking you what you want to do - Select the default option:
Boot FreeBSD - Use the arrows to select
Standard - Begin Standard Installation, then hit Enter
The FreeBSD Installer
- Select
Standard, hitEnter - Use arrow keys to delete all current partitions:
Ddeletes current partition;Auses entire partition;Qwhen you're done Boot ManagerSelectBoot Mgr, hit enterDisk Label Editor: Create disk partitions: TypeCto create a new partition. Create custom partitions, something like below. Create the partitions in this order:
2GB FS Mount Point: /
1GB SWAP
1GB FS Mount Point: /tmp
1GB FS Mount Point: /var
10GB FS Mount Point: /usr
[all remaining] FS Mount Point: /home
The 2nd partition (SWAP) should be 2x the amount of RAM installed. Partitions/,/tmp, and/varcan stay rather small (use the defaults above) no matter how big your HD is.
TypeQto finishSelect DistributionChooseAllPorts CollectionYes you want the ports skeleton (you'll go back to the Select Distribution screen. Scroll up, selectExitInstaller SourceSelectCD/DVDLast ChanceHell, yeah. Delete everything, reformat the HD, give me some BSDLove
Disk Label Editor, and begins installing stuff. During the installation, you can see what's going on in a number of different views:ALT-F1 - default GUI viewALT-F2 - verbose installation logALT-F4 - emergency interactive shellAfter extracting the source, and installing the source, you'll get to a screen that says:
Congratulations
Hit
OK and move on...
Configuration
would you like to configure any ethernet or SLIP/PPP network devices?YesSelect Your Network CardSelect the first option unless you're sure your network card is one of the other optionstry IPV6?Notry DHCP?No-
Network Info:
Host[servername] If you want your server to be "foo.example.com", enter "foo" here
Domainexample.com
enter the rest of your net info, clickOK function as a network gateway?Noinetd and network services that it provides?Noenable SSH?Yesanonymous FTP?NoNFS server?NoNFS client?Nocustomize system console settings?Yes
I just selectSAVERand select a really retro screen saver...like snake...Set this machine's timezones now?YesLinux binary compatibility?Yes - this should let you run compiled linux binaries through FreeBSD's emulator.Does this system have a PS/2, serial, or bus mouse?No - mice are for wimps.FreeBSD Package Collection - Browse the collection now?No - we'll add ports later onAdd any initial user accounts?Yes
SelectUser; hitEnter
- Login ID: web
- UID: [default]
- Group: [leave blank]
- Password: *******
- Full Name: Web Master
- Member Groups: wheel
- Home Directory: /home/web
- Login Shell: /bin/csh (I like csh better than the default, sh)
Set Root's PasswordVisit the general configuration menu for a chance to set any last options?No- Use the right arrow to select [
Exit Install]
HitEnter Are you sure you want to exit? Hell, fricken' yes, I'm sure
First Startup
You'll see a verbose startup messages page across the screen. The first startup, you'll eventually be asked to create an SSH key. To do this, just type a screenful (maybe 10 lines) of random junk then hit enter.
Your system will finish booting up and eventually prompt you with:
FreeBSD/i386 (foo.example.com) (ttyv0)login: []Login
Log in as
web and the password you made, and start familiarizing yourself with some unix commands:
Next Steps
Now you have a FreeBSD web server connected to the internet. SSH is enabled, but not FTP. More importantly, to serve web pages, you'll need to install some additional software.In the next lesson, we'll install:
- PHP
- MySQL
- Apache
- ...and more.
Run Your Own Unix Web Server (part 1 of 3) - FreeBSD Installation
Run Your Own Unix Web Server (part 2 of 3) - Software
Run Your Own Unix Web Server (part 3 of 3) - Configuration
Comments
I will too...Until then I need to figure out how to transfer my poxy strings from my internal database to the external IODB conflict on port 4.
Thanks Dave!
Thanks! Me and a few of my friends have been running a forum for a while, and always wanted our own server. But up till now, we didnt know how. Again thanks, I found this very usefull!
Great tutorial champ!
I have come across many sites. Very few sites give the useful information. This site is one among the best.
Tom Goodman http://www.Computerserverscore.com
Hi your site is pretty neat. This site also has some tips for you unix aficionados out there - cheers.
Awesome guide! Just one thing that seems to be left out -- Steps Number 2 and 3 in "FreeBSD Installer," leaves out something like "Remember to set the partition as Bootable by pressing 's'."
Again, excellent guide!
Szornes
Thanks to you, i have replace my puppy linux os 2.2 with freebsd 6 ... aside from having to do everything from the shell the os is a big step. I'm running a webserver using these very steps, check it out: http://isff.isff.com http://y.uk.to
On personal opinion, I find this very helpful. Guys, I have also posted some more relevant info further on this, not sure if you find it useful: http://www.bidmaxhost.com/forum/
This tut, has helped me alot, on setting up my web on my personal server, thanks....
Happy about this!I now know exactly what am going to do with my pc
Read something more recent.
Statements and opinions expressed in this blog and any comments made are the private opinions of the respective poster, and, as such, iMarc LLC is neither responsible nor liable for such content.
Visitors
Nice one..!! Now I know what to do with my old PC Thanks.
Will wait for the next part