Configurar freebsd para webhosting

por | 29 Junio, 2006

Esto es del cpanel pero tambien aplica el mismo tutorial para webmin

Setup / Install instructions for cPanel on FreeBSD


Yo utilize esta configuración de prueba, compilando el kernel con las quotas
#df -h

Filesystem Size Used Avail Capacity Mounted on
/dev/ad0s1a 248M 55M 173M 24% /
devfs 1.0K 1.0K 0B 100% /dev
/dev/ad0s1g 2700MB 75M 2.4G 3% /home 2700MB
/dev/ad0s1e 248M 14K 228M 0% /tmp 250MB anque recomiendan 512MB
/dev/ad0s1f 2000MB 1.0G 734M 59% /usr
/dev/ad0s1d 248MB 2.4M 226M 1% /var



ve last revised install instructions on September 11th, 2005:

Since I couldn’t find detailed information about setup of cPanel on FreeBSD, I thought to share my experience. This is a step-by-step for newbies, please feel free to add or comment onto it

Notice: I shall not be held responsible for any information provided here, and I recommend an experienced administrator to manage your server. These steps should not be processed on current production systems.

These instructions are based on FreeBSD 4.8-Release & cPanel 7.x

All command line executions starts with “#”

The following is needed to properly installed FreeBSD: wget, rsync, perl 5.8.x (need to upgrade the perl that comes with FreeBSD 4.10/4.11)

Partition FreeBSD steps:

Partitioning is very important to be done properly. You need to take into account your current capabilities and your expectations in the future. So evaluate your needs carefully. As well, FreeBSD partition sizes different from Linux.

This is how much you’ll be USING after the installation of FreeBSD, cPanel and source / ports:

SWAP (double your memory size)MB
/ 50MB
/tmp 256MB
/var 48MB
/usr 1,927MB

This is my recommended minimal parition size assuming you have 40GB+ hard drive:

SWAP (double your memory size)MB
/ 256MB – 512MB (root , boot)
/tmp 512MB-1024MB (store temp files sometimes large)
/var 5,000MB+ (location for your mySQL db, logs)
/usr 10,000MB+ (your local files, system files, cPanel files, fantastico..etc)
/home (rest of hard drive)

To perform the following steps, you need to have installed the source code for your Kernel and the FreeBSD ports. If you’ve not done that during the installation, or if the source code still was not installed, you need to enter the setup console and install it as the following:

Logged in as root type:


choose “Configure”
choose “Distributions”
hit the space bar on “src”
this will take you to the src screen then hit the space bar on “all”
hit the space bar on “exit”
hit the space bar on “ports”
Press the tab key until you highlight “Ok” and hit Enter.
Exit out of the SysInstall


You need to enable quotas on the system and re-compile the kernel (be very careful with these steps):

Your default kernel is located at:


If you are using 64-bit OS and installed 5.4 amd64 version, your kernel is:

go to that path and run the following:


add the following lines to your MYKERNEL file

# To enable quotas on the system
options QUOTA

Hit ESC then (a) to exit and save.

To compile the Kernel type the following:

#/usr/sbin/config MYKERNEL

it will do some work then put you back to the prompt type:

#cd ../../compile/MYKERNEL
(This is on FreeBSD 4.x, for FreeBSD 5.x use “cd ../compile/MYKERNEL”)
#make depend

Will take a minute or so


Will take another minute

#make install

This should finish with no errors, if there are errors, go and check your MYKERNEL file for anything added or deleted improperly. It could also lead to a hardware conflict if kernel doesn’t compile properly.

Now we need to edit /etc/rc.conf:

#edit /etc/rc.conf

add the following line to the end of the file:


To disable checking quotas at startup (recommended):


We need to set the quotas on the partition for /home (if you’ve created one or /usr if you didn’t create a partition for it):

#edit /etc/fstab

And add the following to your /usr or /home partition (which ever you’re using), under the OPTIONS column add:

rw, userquota,groupquota

Press ESC to exit and (a) to save

Then reboot the system. If all works fine, you should be able to type:

#quota -v
and it will display current quotas.


You need to install the wget , rsync ports to retrieve the cPanel files properly:

The ports are located in /usr/ports , wget is considered an FTP port and is located in /usr/ports/ftp

#cd /usr/ports/ftp/wget
# make install

After wget, install rsync:

# cd /usr/ports/net/rsync
# make install

After your port had been installed (may take couple of minutes), reboot the FreeBSD system again.


Final step is to install the cPanel. If you’ve not created /home partition, then create a folder inside the /usr partition by:

#cd /usr
#mkdir /home
#cd home

Installation of cPanel:


It will take few minutes to download depending on your connection speed.

#sh latest

The process of installing cPanel will take about 30 minutes or more depending on your processor and connection speed.


Setup cPanel, after the installation is complete reboot the machine and try to access it from the web using the public IP address you’ve been provided

Your login is: root
Your password is the same as the root password for your local system.


After you setup the server and Apache is configured properly, you’ll need to install FrontPage extensions (for some reason this wasn’t installed for me with cPanel. I didn’t submit a bug about it though….can anyone confirm?).

Go to the ports collection

#cd /usr/ports/www
#cd frontpage
#make install

Reboot the system once installation is done.

I hope these information are of good value, from my demo testing, this is what I found out needed to setup FreeBSD properly with no need for additional configurations. If something else needed, please share it with the rest of us.

I would hope this makes it to install instructions for cPanel.