jnewing none

Joined: 27 Sep 2008 Posts: 12 Location: Marathon
|
Posted: Oct 17, 2008 7:53am Post subject: Tutorial: Part 1 - Setting up ratbox-ircd |
|
|
Okay I know this seems like a lot to cover but its really simple, and ratbox is just such a great IRCd I really think it needed its own tutorial. I have broken this tutorial into three parts as described below.
Part 1 - Setting up ratbox-ircd
Part 2 - Setting up ratbox-respond
Part 3 - Setting up ratbox-services
Small Intro:
ratbox-ircd is an advanced, stable and crazy fast IRCd, it's also the primary IRCd used on EFNet. ratbox-ircd is great for large and small networks alike and is rock solid and includes a VAST set of options and features.
Before we get started I just wanted to say thanks for checking this out, and if you have any questions and/or comments please feel free to come find me on irc.binslashbash.org (tk) usually in #binslashbash and I will try to keep this tutorial as up to date as possible. Also please keep in mind I'm going to assume that you have some basic *NIX skills, ideas and concepts down. (I'm not going to hold your hand through unzipping and moving around directories.
Pre-Notes:
Everything that I'm going to do here will be done as a normal user with NO special privileges (in other words DO NO DO THIS AS ROOT) there is simply no need for that and it's a security risk.
[size=large]Part 1[/size]
First up login to your shell account and make sure you are in your home directory and lets download our sources.
Hint: I like to make a sources folder in my home directory (being a neat freak) I like to keep things organized. So if my home folder is /home/jnewing/ I would make a sources folder located /home/jnewing/sources.
Now grab the latest stable sources:
| Code: | wget ftp://ftp.ircd-ratbox.org/pub/ircd-ratbox/ircd-ratbox-2.2.8.tgz
wget ftp://ftp.ircd-ratbox.org/pub/ircd-ratbox/ratbox-services/ratbox-services-1.2.1.tgz
wget ftp://ftp.ircd-ratbox.org/pub/ircd-ratbox/ratbox-respond/ratbox-respond-1.0.tgz |
Got em? GREAT! Let's move on to the IRCd!
After I downloaded my sources and unzipped the IRCd. | Code: | | tar zxvf ircd-ratbox-2.2.8.tgz |
I entered my ircd-ratbox-2.2.8/ directory and am ready to start compiling.
Now keep in mind these are just the options I have selected for this tutorial and are general what I use when compiling for irc.binslashbash.org servers. I'll go over them one by one and even talk about others that I have not included in this example.
| Code: | | ./configure --prefix=/home/jnewing/ircd --enable-small-net --enable-ipv6 --with-maxclients=1024 --enable-services |
--prefix=/home/jnewing/ircd - By default ratbox will try and install itself to /usr/local/ircd this option just does not fly with me and I've chosen to install it to /home/jnewing/ircd (my home directory) you can point this to where ever you like just make sure that you have access to it.
--enable-small-net - This is a good idea to pass your ratbox IRCd if you are on a small network (less then 5000 users)
--enable-ipv6 - I'm always nice to the IPv6's out there. (This will just compile IPv6 support)
--with-maxclients=1024 - It's always a good idea to configure how many clients your server will support (Change the number "1024" to one that suites your network)
--enable-services - This option is if you wish to compile support for ratbox-services (In this tutorial we are going to use them)
Other Options
--with-nicklen=### - If you wish to set your own maximum nickname length (Default: 9)
--with-topiclen=### - If you with to set your own maximum topic length (Default: 160)
There are even more options for setting specific paths for includes and enabling or disabling features. If you wish to see them all:
Now if you compile went as planned. You should be looking at some output that give or take, resembles the following:
| Code: | Compiling ircd-ratbox stable
Installing into: /home/jnewing/ircd
Ziplinks ....................... yes
OpenSSL ........................ yes
Modules ........................ shared
IPv6 support ................... yes
Net I/O implementation ......... epoll
IO Debugging hooks ............. no
Assert debugging ............... no
Small network .................. yes
ratbox-services compatibility .. yes
Configured limits:
NICKLEN ................. 9
TOPICLEN ................ 160 |
If you are then you are ready to make and install.
| Code: | | make && make install |
Everything went perfect? Wonderful! That's what I like to hear. So we now have a ALMOST ready to rock IRCd server up. On to the .confs... (Or the fun part as I like to call it)
So we need to change directories over to our new installed IRCd location.
Hint: Remember your --prefix=/home/jnewing/ircd
If you do a ls while in your ircd directory you should see something that resembles the following:
| Code: | jnewing@tbox:~/ircd$ ls
bin etc help help-old logs man modules modules-old
jnewing@tbox:~/ircd$
|
As you can see ratbox has been busy creating all kinds of goodies in here! Basic layout is as follows.
bin/ - Binaries
etc/ - Configuration files
help/ - Here there be tigers!
help-old - More tigers!
logs/ - ... Do I really need to say it?
man - Manual
modules/ - Modules
modules/autoload - Modules that are autoloaded by the IRCd
modules-old - Old modules perhaps?
For the most part their are four directories you will be in and out of: bin, etc, logs and modules. Anyway enough of this jibber-jabber on with the .conf editing!
So for this demo I'm going to spit out a very watered down ircd.conf file that is bear bones and will get you up and running. HOWEVER that being said I STRONGLY recommend you read top to bottom the example.conf file located in your etc/ directory. Then once you have read it, read it again! Take a break, grab a nice glass of scotch and then READ IT AGAIN! I will be going through this ircd.conf block by block.
Server Block (OLD M
Holds all information about this server... What did you think?
| Code: |
# Server Info Block (OLD M:)
serverinfo {
name = "my.ircdserver.com"; # name of your server
use_ts6 = yes; # TS6 protocol
sid = "01A"; # unique server id (Must be three characters long and the first character MUST be a digit)
description = "my first ratbox server"; # your server descritpion
network_name = "MyNetwork"; # your network name
network_desc = "This is MyNetwork"; # your network description
hub = no; # allow this server to act as a hub?
vhost = "192.168.1.10"; # ip to bind this server too (useful on multi-ip homes)
default_max_clients = 500; # this is the maximum numbers of clients allowed to connect to this server
};
|
Admin Block (OLD A
Holds the information on the server administrator.
| Code: |
# Admin Block
admin {
name = "Admins Name";
description = "The Big Cheese!";
email = "<please@nospan.com>";
};
|
Log Block
In my experiences the more I can log the more I will log, makes things simpler at some point.
| Code: |
# Log Block
log {
fname_userlog = "logs/userlog"; # user logs
fname_fuserlog = "logs/fuserlog"; # failed user connections
fname_operlog = "logs/operlog"; # oper usage
fname_foperlog = "logs/foperlog"; # failed oper attempts
fname_serverlog = "logs/serverlog"; # server connects / disconnects
fname_glinelog = "logs/glinelog"; # glines
fname_klinelog = "logs/klinelog"; # klines
fname_killlog = "logs/killlog"; # kills
fname_operspylog = "logs/operspylog"; # operspy usage
fname_ioerrorlog = "logs/ioerror"; # input / output errors
};
|
Class Block (OLD Y
This blocks defines the classes for users (and connections in general) on our server.
| Code: |
# Class Block
class "users" { # please note "users" this is the name of the class we are defining
ping_time = 2 minutes; # frequency to ping users
number_per_ident = 2; # max number allowed per identity
number_per_ip = 3; # max number allowed per ip
number_per_ip_global = 5; # max number allowed per ip over the entire network
max_number = 500; #max number of connection in this class
sendq = 100 kbytes; # send queue
};
class "server" { # again note "servers" this is the name of the class we are defining
ping_time = 5 minutes; # frequency to ping servers
connectfreq = 5 minutes; # frequency to attempt to connect
max_number = 1; # max number of connections in this class
sendq = 2 megabytes; # send queue
};
|
Listen Block (OLD P
Block contains the info. as to what ports it should be listening for incoming connections on.
| Code: |
# Listen Block
listen {
host = "192.168.1.10"; # host address to listen on
port = 5000, 6661 .. 6669; # ports to open (in our case port 5000 and ports 6661 all the way up to 6669)
};
|
Auth Block (Old I
The auth block like the old I lines allows users to connect to the IRCd.
| Code: |
# Auth Block
auth {
user = "*@*";
class = "users";
};
|
Oper Block (Old O
The oper block in here might look a little different, in particular there is no password in sight and this is because in this tutorial we are setting up password-less opering using ratbox-respond. One thing to take note of is the rsa_public_key_file and its path. This NEEDS to be set correctly for this to work. I know the public.key file does not exist yet but it will and it will then be placed in the /home/jnewing/ircd/etc/ directory in my case. Make sure you change this to suit your own needs.
| Code: |
operator "joe" { # note the name of the oper defined in "'s (in this case our opers nickname would be: joe)
user = "*@*.ls.shaw.net"; # its always a good idea to set host masks for your opers (these can have multiple entries)
rsa_public_key_file = "/home/jnewing/ircd/etc/public.key"; # path to the public key
flags = encrypted, global_kill, remote, kline, unkline, gline, # flag for this oper (contd. on second line)
die, rehash, admin, xline, operwall;
};
|
Connect Block (Old C: N: H: L
This block controls the servers and services (they are servers) that we may establish connections with and that may establish connections with us. In our case we only really need one connect defined, and thats the connection our ircd will make with our services. However its a good idea to take note of this spot as its used also in linking servers
| Code: |
# Connect Block
connect "test.services" { # name of the server or services we are connecting to here
host = "192.168.1.10"; # ip address of the services (for this demo I'm assuming the services are running on the same ip as the server itself)
send_password = "testpassword"; # password to send to server or services
accept_password = "testpassword"; # password to receive from server or services
port = 5000; # port we are trying to connect to
class = "server"; # class this connection belongs in
};
|
Service Block
If you are running ratbox-servies (or at least will be) and have compiled with --enable-services we can add this special services block and it will define servers that get "special privileges" on our server. Things like setting login names, introducing clients with +S etc...
| Code: |
# Services Block
service {
name = "test.services";
};
|
Channel Block
Simple put this block defines options for your server pertaining channels. Keep in mind there are no right or wrong things in this block its really where this server shines, in terms of you can customize this however you like! There are a lot of options here and I'm going to to go through them one by one I'm just going to show you some defaults that I use. However again I would STRONGLY suggest you read your etc/example.conf to see what all these options are, what they do, and why they do it!
| Code: |
# Channel block
channel {
use_invex = yes; # enable / disable channel mode +I
use_except = yes; # enable / disable channel mode +e
use_knock = yes; # enable / disable knock ability
invite_ops_only = yes; # only channel ops may /invite
knock_delay = 5 minutes; # delay between knock
knock_delay_channel = 1 minute; # knock channel delay
max_chans_per_user = 15; # max number of channels one user can be on
quiet_on_ban = yes; # stop a banned user from talking
max_bans = 25; # max number of bans on any one channel
};
|
General Block
The general block, much like the channel block this block contains options that pertain to this server and many of these options where once options that you had to change in config.h before compiling. However here they are in a handy dandy general block. Also much like channel there are tones of options here that I am not even going to touch on. I can't stress this enough READ YOUR EXAMPLE.CONF file for a complete list of options and what they all do.
| Code: |
# General Block
general {
hide_error_messages = opers; # hide error messages from the server
default_invisible = no; # set clients to +i on connect
default_floodcount = 10; # default flood count value (amount of lines a user may send in one second)
failed_oper_notice = yes; # let other opers know when there is a failed oper attempt
anti_nick_flood = yes; # enable / disable nick flood control
max_nick_changes = 5; # max number of nick changes
max_nick_time = 20 seconds; # in specified amount of time
anti_spam_exit_message_time = 5 minutes; # min amount of time user must be connected before allowing a custom /quit msg to be sent
dline_with_reason = yes; # show reason for dline on connect?
kline_delay = 0 seconds; # delay in kline
kline_with_reason = yes; # show the user reason when klined
non_redundant_klines = yes; # flag and ignore redundant klines
short_motd = no; # send short motd?
connect_timeout = 30 seconds; # time we should wait for a connection request to succeed before we drop
glines = yes; # enable / disable glines
gline_time = 1 day; # default gline time
max_targets = 4; # max number of users another user can notice or privmsg at once
client_flood = 20; # max number of lines in a clients queue before they are dropped
use_whois_actually = yes; # enable / disable whois actually
max_unknown_ip = 2; # max number of pending connections per IP
# modes and oper will be able to set
oper_only_umodes = bots, cconn, debug, full, skill, nchange,
rej, spy, external, operwall, locops, unauth;
oper_umodes = locops, servnotice, operwall, wallop; # modes and oper will automatically get when they operup
};
|
Modules Block
Modules block simply defines paths that the IRCd will look for modules to load. You need to set this correctly.
| Code: |
# Modules Block
modules {
path = "/home/jnewing/ircd/modules"; # remember the path we set in --prefix upon compile?
path = "/home/jnewing/ircd/modules/autoload";
};
|
YAY! We are done with the ircd.conf we can now save that bad boy and we are ready to test our conf and launch our IRCd!
After you have saved your conf file to PREFIX/etc/ircd.conf (In my case /home/jnewing/ircd/etc/ircd.conf) we can take a peak in our bin/ folder and you should see something that resembles the following:
| Code: |
jnewing@tbox:~/ircd/bin$ ls
convertilines convertklines ircd mkpasswd servlink viconf viklines vimotd
jnewing@tbox:~/ircd/bin$
|
So lets test our newly created .conf file we can do that by issuing the following command while in the bin/ folder.
If everything goes as planned you should get something close to the following for output:
| Code: | | "/home/jnewing/ircd/etc/ircd.conf", line 73: Ignoring operator block for joe -- rsa_public_key_file cant be opened |
All this means is that the oper block for you will be ignored for the time being, simply because we have not created our public.key for ratbox-respond yet. Don't worry we will be doing that in Part 2 of this tutorial for now we can still test out our IRCd.
So lets launch. We can do this by issuing the command:
If everything is working you should see a message that loosely resembles the following:
| Code: |
jnewing@tbox:~/ircd/bin$ ./ircd
ircd: version ircd-ratbox-2.2.8
ircd: pid 10352
ircd: running in background mode from /home/jnewing/ircd
jnewing@tbox:~/ircd/bin$
|
If you see that (or something to that effect) congrats on your running ratbox IRCd! Go ahead, connect, have fun! |
|