RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


Install OpenBSD to Secure Your Web Server : Page 3

Designed to be "secure by default", the OpenBSD server operating system offers comprehensive security features. Learn how to perform a network install of this OS—along with PHP4 and MySQL—to keep sensitive data protected.


Install Ports and the Package Collection

Now that su is installed and working, OpenBSD’s functionality considerably expands with the installation of both the ports and the package collections. Installing new functionality on OpenBSD requires Root or pseudo (su) Root privileges. All of the following instructions require that you be logged in as the SuperUser (root).

Issue the following commands to install several thousand program skeletons:

  1. ftp ftp://ftp.openbsd.org/pub/OpenBSD/3.6/ports.tar.gz
  2. mv ports.tar.gz /usr
  3. cd /usr
  4. tar -xzf ports.tar.gz

Pop back into your open root console:


Notice that true root keeps track of all uses of su. Press ENTER to get your prompt back, and type "login". Log in as the user you created. Type "su", enter the root password, and voila!

Using Ports: Invoking the tcsh Shell

All of the ports work in a similar fashion. Navigate to the port directory you want and type "make && make install" within the port directory that includes the Makefile. For example, to install the tcsh shell:
  1. TYPE: "cd /usr/ports/shells/tcsh".
  2. TYPE: "make && make install".

And that is the basic formula for installing ports. Many ports, like tcsh, have special instructions that appear during or following the install. In this case:

  1. TYPE: "vi /etc/shells".
  2. Add the line /bin/tcsh to this file.
  3. Save and quit (ESC, :wq).

At the root prompt, type "/usr/local/bin/tcsh" to invoke the tcsh shell. I like this shell for its up-arrow command history function (never type the same thing twice). You can perform subsequent invocations of this shell by typing tcsh at the command prompt. I suggest continuing to use the tcsh shell for the rest of the tutorial.

Packages Collection

The packages collection is the preferred way of installing software onto your OpenBSD system. Packages "automagically" install the required dependencies. As with the Ports system, you must be logged in as the SuperUser (root). You can browse the packages online. (Note: Intel architecture is i386.) Tell pkg_add where to find the packages via FTP. Do not attempt to install packages from an older or a newer release number of OpenBSD. Because this tutorial builds OpenBSD version 3.6, make sure you get the packages from the version 3.6 folder (setenv as seen below):

 TYPE setenv PKG_PATH ftp://ftp.openbsd.org/pub/OpenBSD/3.6/packages/i386/

Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date