Setting up an IRC+cPanel box with freeBSD
Well this "guide" if you like, doesn't really have a purpose, it
both shows you how to setup a basic irc box (just installing
oidentd), its mainly targeted towards installing cPanel on
freeBSD.
I used freeBSD 5.4-RELEASE so you might not encounter problems I
did.
firstly login to your server and we will just install cpanel
straight away.
-----------------------------------------------------------------
--------------- mkdir /home/cpins cd /home/cpins wget
http://layer1.cpanel.net/latest sh latest
-----------------------------------------------------------------
---------------
This will take awhile so go grab a coffee. This will install
everything for cPanel.
Once this is complete, go to WHM
http://yourip/whm
and login with username root and your root password. Now you
will be prompted with the WHM setup screen. This is really
simple, just follow the onscreen instructions to setup whm. This
will setup your server hostname,resolvers,nameservers and
so on.
Once this is done, you have done it. You have installed cPanel,
but don't get your hopes up just yet. No doubt there will
be bugs, you are best to search google but I will go over what
ones I encounter. If I do that is.
So straight off I am going to go test the account creation, go
to Create A New Account in WHM, and input any domain you
want, for my example I just put google.com. After I hit created
it created the account but returned a bind error. So we
have to fix this first.
I ran
-----------------------------------------------------------------
---------------/scripts/fixnamed /scripts/fixndc
-----------------------------------------------------------------
---------------
Which returned
-----------------------------------------------------------------
---------------Found key in named.conf .. Found controls in
named.conf .. Found key in named.conf .. Adding key... Adding
controls... Restarting bind.....Waiting for named to
restart..............finished.
named has failed, please contact the sysadmin (result was "named
is not running"). Jun 7 14:03:26 serv named[52645]: starting
BIND 9.3.1 -u bind -c /etc/namedb/named.conf Jun 7 14:03:26 serv
named[52645]: could not configure root hints from
'/var/named/named.root': file not
found Jun 7 14:03:26 serv named[52645]: loading configuration:
file not found Jun 7 14:03:26 serv named[52645]: exiting (due to
fatal error) Done All fixed
-----------------------------------------------------------------
---------------
So I just created the /var/named/named.root file manually by
using the touch command then I re-ran /scripts/fixndc this done
the job.
-----------------------------------------------------------------
---------------serv# touch /var/named/named.root serv#
/scripts/fixndc Found key in named.conf .. Found controls in
named.conf .. Found key in named.conf .. Adding key... Adding
controls... Restarting bind.....Waiting for named to
restart..............finished.
bind 53378 0.0 0.7 5240 3744 ?? Ss 2:09PM 0:00.04
/usr/sbin/named -u bind -c /etc/namedb/named.conf
named started ok Jun 7 14:09:18 serv named[53378]: starting BIND
9.3.1 -u bind -c /etc/namedb/named.conf Jun 7 14:09:18 serv
named[53378]: command channel listening on 127.0.0.1#953 Jun 7
14:09:18 serv named[53378]: zone 0.0.127.IN-ADDR.ARPA/IN:
loading master file
/var/named/localhost.rev: file not found Jun 7 14:09:18 serv
named[53378]: zone
1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.I
P6.ARPA/IN: loading master file
/var/named/localhost-v6.rev: file not found Jun 7 14:09:18 serv
named[53378]: zone
1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.I
P6.INT/IN: loading master file
/var/named/localhost-v6.rev: file not found Jun 7 14:09:18 serv
named[53378]: running Done All fixed
-----------------------------------------------------------------
---------------
---
Now go back and terminate the test account and recreate it.
This time it created successfully.
-----------------------------------------------------------------
---------------Keeping Shell Access (y) Copying skel files from
/root/cpanel3-skel/ to /usr/home/google/ Using Freebsd Copy
/root/cpanel3-skel/public_html -> /usr/home/google/public_html
/root/cpanel3-skel/public_ftp -> /usr/home/google/public_ftp
Using redhat 6.x/freebsd support Name Virtual Host already
exists Added Entries to httpd.conf (noip) Bind reconfiguring on
serv using rndc Added Named File Using Frontpage 5.x!
Starting install, port: 80.
Creating web http://www.google.com. Chowning Content in service
/. Install completed.
Starting chown, port: 80, web: "/".
DocumentRoot: "/usr/home/google/public_html" Setting Password
Frontpage passthough auth enabled! Restarting apache Ftp
Password Files synced Vhost Passwords synced wwwacct creation
finished Account Creation Complete!!!
-----------------------------------------------------------------
---------------
Now we know account creation works, we can go on with setting up
the server.
Well what I done was first configure SSHD. Please remember this
is just how to setup the server as a basic server on freeBSD,
to really secure it you should read a freeBSD security guide.
Since im more of a pico guy, dont ask I have to install that
first.
/>
Lets install it with
-----------------------------------------------------------------
--------------- cd /usr/ports/editors/pico && make && make
install
-----------------------------------------------------------------
---------------
even when i typed pico i got command not found so you have to
type rehash
anyway lets continue, edit sshd config and add the following
-----------------------------------------------------------------
--------------- pico /etc/ssh/sshd_config Port 22 Protocol 2
SyslogFacility AUTH LogLevel INFO
-----------------------------------------------------------------
---------------
--
Of course that is not all, but you get the idea, disable direct
root login, forwarding, and so on.
Now its time to install oidentd, this is to use an ident on irc
servers.
-----------------------------------------------------------------
--------------- mkdir /root/scott cd /root/scott wget
target="_blank">http://umn.dl.sourceforge.net/sourc...td-2.0.7.ta
r.gz tar -zxvf oidentd-2.0.7.tar.gz rm -rf oidentd-2.0.7.tar.gz
cd oidentd-2.0.7 ./configure make make install
-----------------------------------------------------------------
---------------
Now create a user for oidentd and disable shell access.
adduser
then go threw the settings.
for shell make sure you set nologin
Shell (sh csh tcsh bash bash jailshell noshell ftpsh nologin)
[sh]: nologin
Make sure you set a secure password, ie
zUaxe^xXalvYtBPlTo]ZP]iayFIsq
--
Now create the config
-----------------------------------------------------------------
---------------pico
/etc/oidentd.conf------------------------------------------------
--------------------------------
/>
and put
-----------------------------------------------------------------
---------------# Configuration for oidentd # see oidentd.conf(5)
# default { default { allow spoof allow spoof_all allow
spoof_privport allow random allow random_numeric allow numeric
allow hide } }
-----------------------------------------------------------------
---------------
in it.
Now just start oidentd, please note you will have to change the
config to sure yourself, such as spoofing.
-----------------------------------------------------------------
--------------- /usr/local/sbin/oidentd -u oidentd -g oidentd
-----------------------------------------------------------------
---------------
Oidentd should now be installed. All you have to do now is add
users and set what shell access they have. I personally set
bash for each but I set permissions so they cannot access things
they should not.
IE
chmod -R 770 /home/*
Then set permissions on binaries, and so on. Personally, I made
a quick wget script, so maybe you can impliment it too.
First lets move the old binary to a random name, i choose
ekigrowbwo
-----------------------------------------------------------------
---------------cd /usr/local/bin mv wget ekigrowbwo pico
/usr/local/bin/wget
-----------------------------------------------------------------
---------------
and put this in it.
-----------------------------------------------------------------
--------------- #!/bin/bash ME=`whoami` TIME=`date` DIR=`pwd`
echo "$TIME - $ME - $1 - >> $DIR" >> /usr/local/bin/wget.log
/usr/local/bin/ekigrowbwo $1
-----------------------------------------------------------------
---------------
you better create the wget.log
-----------------------------------------------------------------
--------------- touch /usr/local/bin/wget.log
-----------------------------------------------------------------
---------------
It will then log in the format,
time - user - what they downloaded - >> where it was saved.
Just repeat that process for fetch and so on, so it logs them
all.
Well that is pretty much the server setup. This isn't really a
main guide, it shows you how to setup cpanel on freebsd,
setup a basic irc server, although you still have a bit to do.
It should get you on your way though.
--------------------------------------
UPDATE
I had problems with mysql, mainly the mysql server, I fixed this
by using.
-----------------------------------------------------------------
--------------- cd /usr/ports/databases/mysql40-server && make
&& make install /scripts/fixmysql
-----------------------------------------------------------------
---------------
Any other bugs feel free to reply, I will post as I find them.
other than that, so far cPanel seems to be working well, even
though I dont recommend using it for an irc server.