Setup / Install instructions for cPanel on FreeBSD

hicom

Well-Known Member
May 23, 2003
290
4
168
I've last revised install instructions on January 22nd, 2006:

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.x/5.x & cPanel 9.x

All command line executions starts with ">>"

The following is needed to properly installed FreeBSD: perl 5.8.x (need to upgrade the perl that comes with FreeBSD 4.x before proceeding)

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)

1)
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:

You can check if you have the source by going to:

>> cd /usr/src/sys/i386
If you are able to change to the above directory, then sources are installed

Logged in as root type:

>>/stand/sysinstall

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




2)

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 (this is for 32-bit machines only):

/usr/src/sys/i386/conf

If you are using 64-bit OS and installed 5.4 amd64 version, your kernel is:
/usr/src/sys/amd64/conf

go to that path and run the following:

>>cp GENERIC MYKERNEL
>>edit MYKERNEL

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 5.x, for FreeBSD 4.x use "cd ../../compile/MYKERNEL")

>>make depend

Will take a minute or so

>>make

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:

enable_quotas="YES"


To disable checking quotas at startup (recommended):

check_quotas="NO"


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.




3)

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:

>>fetch http://layer1.cpanel.net/latest

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.



5)

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

http://<your.IP.address.here>:2086/


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



6)

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.


7) It seems that BIND on some FreeBSD systems comes not configured properly. So this is what need to do to enable BIND:

>>edit /etc/namedb/named.conf

look for the line:
// If named is being used only as a local resolver, this is a safe default.
// For named to be accessible to the network, comment this option, specify
// the proper IP address, or delete this option.
listen-on { 127.0.0.1; };
Change these to:
// If named is being used only as a local resolver, this is a safe default.
// For named to be accessible to the network, comment this option, specify
// the proper IP address, or delete this option.
// listen-on { 127.0.0.1; };
Exit and save the file, then restart BIND from within WHM.

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

inteltechs

Active Member
Mar 2, 2003
26
0
151
it's freebsd 5.1

wonder if anyone knows how to fix it.

==> Checking to see if you have the latest version.....Compare: Cpanel-7.2.1-RELEASE_125-FreeBSD-i386-libc.tar.gz != Cpanel--FreeBSD-i386-libc
Nope! You have
==> Fetching the main installation program; please be patient...
Receiving /usr/local/cpanel/cptmp/cp3installer.61 (10121943 bytes): 100%
10121943 bytes transferred in 9.5 seconds (1.01 MBps)
done.
==> Checking hostname.....done.
==> Requesting License File..../usr/local/cpanel/cpkeyclt: not found
done.
==> Cleaning up temporary files...
done.
==> Running installer...
No matching processes were found
/usr/local/cpanel/cptmp/cp3installer.61063: 1: Syntax error: word unexpected (expecting ")")
==> Cleaning up installer...done.
Scanning suexec_log...Done

cPanel.net Support Ticket Number:
 

jw

Member
Aug 16, 2001
6
0
301
Does that on all FreeBSD versions. I filled out a ticket 2 days ago, but they haven't done anything.

cPanel.net Support Ticket Number:
 

inteltechs

Active Member
Mar 2, 2003
26
0
151
finally, thanks cpanel.

WHM 7.4.0 cPanel 7.4.0-R4
FreeBSD 5.1-RELEASE - WHM X v2.1

it's working beautifully on my FreeBSD 5.1 :)

cPanel.net Support Ticket Number:
 

psimon

Registered
Aug 4, 2003
2
0
151
Athens
Installation Error FreeBSD 4.7 - latest

We 've repeatedly tried to setup the 'latest' distribution above FreeBSD 4.7 installed according to the instructions on this thread.Unfortunately we had no success.Please check the installation log attached.

We will appreciate any help very much.

cPanel.net Support Ticket Number:
 

Attachments

JamesSmith

Well-Known Member
Sep 17, 2003
185
0
166
UK, Luton
Hi.

Just to add something about the kernel recompile.

You said:

cd ../compile/MYKERNEL


But it should be:

cd ../../compile/MYKERNEL

cPanel.net Support Ticket Number:
 

JamesSmith

Well-Known Member
Sep 17, 2003
185
0
166
UK, Luton
I tried your way on a 4.8 install im setting up right now, it says no such directory.

So I did it the usual way and it works.

cPanel.net Support Ticket Number:
 

X-Istencedotcom

Well-Known Member
Apr 14, 2003
223
0
166
just a note, its not /home, but /usr/home that you want.

This is because in a normal install all that /home is is a symlink to /usr/home.

cPanel.net Support Ticket Number:
 

X-Istencedotcom

Well-Known Member
Apr 14, 2003
223
0
166
New way of compiling for FreeBSD 4.8 and FreeBSD 5.1 and up.

Note, the old way is supported, but deprecated.

cd /usr/src/sys/i386/conf/
cat GENERIC > HOSTNAME
edit HOSTNAME
cd /usr/src
make buildkernel KERNCONF=HOSTNAME
make installkernel KERNCONF=HOSTNAME

Another thing, instead of installing the src from sysinstall, use cvsup instead. read up on http://www.bsdguides.org/guides/freebsd/misc/update_ports_tree.php

But add to the end of your supfile, src-all so it will download the entire source as this is needed :).

cPanel.net Support Ticket Number:
 

bjarne

Well-Known Member
Mar 23, 2002
135
0
316
Somethings

Thanks for the tips - they realy was helpful

I did a 4.8 install and it looks preatty good.

A couple of things:

1. Expect is not getting installed, and you need this one to copy accounts from a difrent server.

2. A symlink from linux path to bsd path of Mysql is needed to be made for all mysql stuff to be added propper. Also Horde will break because of this - I think.
(as WHM for FreeBSD is from Linux there typical are som linux paths that breaks the system if diferent on FreeBSD.)

Also accoring to cpanel support wwget latest is for Linux only, so download the isntaller and run it from the server.

BTW There are no working Mailscanner install for FreeBSD so don't try the autinstaller from layer one, it will mess up Exim.
 
Last edited:

eperdeme

Well-Known Member
Oct 15, 2003
58
0
156
Manchester, UK
cPanel Access Level
DataCenter Provider
works!

Ah cool well Cpanel latest -Stable works pritty good on FreeBSD 5.1-10, few problems but they can be fixed with /scripts, pritty obviouse tho its ported linux version. Some of the scripts that come with it do chmod user:group _R whilst on FBSD it needs to be chmod -R user:group etc. ProFTPD also sometimes like to kill itself and send me lovely emails etc, but apart from minor problems it works and for £1,000 I would expect it to.
 

denisdekat09

Well-Known Member
Mar 2, 2002
266
0
316
San Francisco
Great post, I am now going to switching from RedHat over to freeBSD going forth, as it was what I use to do anyways. I am curious if anyone ran into this. I noticed the redhat versions of WHM and Cpanel are more recent/advanced, should I expect freeBSD to be generally behind in features? Does it take long? Also, I noticed that moving sites from my redhat servers to freeBSD were all failing in checksum :( I have been able to do the old backup tarball trick to recreate the account and it seems to work so far. Does any one have any thoughts or comments on this? So far all else seems just as good and better wityh freeBSD :)
 

eperdeme

Well-Known Member
Oct 15, 2003
58
0
156
Manchester, UK
cPanel Access Level
DataCenter Provider
No no no no, yes no....Ok the FreeBSD version of Cpanel is like the Linux version but alot less poorly coded(ported) to work on FreBSD. I do not have any "problems" that are fatal to running the web services, but our last major update was months ago, Aug 30, whilst the Linux has had updates/fixed every week or so. There's a few bugs in the FreeBSD port of cpanel/whm and it likes to try and use Linux style system layout to store files(/var for apps /etc for logs). I'm gona hope now RedHats gona funky and pay to use the dev's are gona conentrate on the FreeBSD port, but we can only hope. So to sum up, it does work but not as good, as cleanly as Linux.
 

wyatt12

Member
Mar 19, 2002
24
0
301
few comments

Hi,

I used your step by step tutorial tonight to install on FreeBSD 4.9 ... and it all went pretty well... here are my notes...

Before your Step #3::::

I would suggest installing cvsup-without-gui
and update the ports collection. Documentation is here:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html (CVSup Method)

Also, rsync is also not installed upon first load of FreeBSD. So you have to install from ports collection.

cd /usr/ports/net/rsync
make install



During Installation of Cpanel:::

Cpanel installation hangs on frontpage installation. It hangs looking for a file... looks like it hangs because it has asssumed fp has already been installed, even though it hasn't.



After Cpanel Installation::::


I installed FP after cpanel installation was done using:

cd /usr/ports/www/frontpage
make install


Everything seems to have installed and looks like its working.


Regards,


Wyatt
 

sloop

Well-Known Member
May 4, 2003
68
0
156
north carolina
For step #3, I had a problem with the wget port being unable to find the correct diff file..

After running CVS to update the ports collection, go to /usr/ports/www/links and do a make install clean. then go to /usr/ports/distfiles and run

/usr/local/bin/links http://neva.vlink.ru/ftp/ftp/

then download the wget diff file and then try to install the wget port.