Home | Networks | Community | Need Help? 

 
 Quick search

 
 
 RegisterRegister   Log inLog in 

Tutorial: Part 1 - Setting up ratbox-ircd

 
Post new topic   Reply to topic    SearchIRC Forum Index -> IRCD & Network Services
Author Message
jnewing
none
none


Joined: 27 Sep 2008
Posts: 42
Location: Ontario

PostPosted: Oct 17, 2008 7:53am    Post subject: Tutorial: Part 1 - Setting up ratbox-ircd Reply with quote

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:
Code:
./configure --help


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 MSmile
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 ASmile
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 YSmile
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 PSmile
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 ISmile
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 OSmile
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: LSmile
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.
Code:
./ircd -conftest


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:
Code:
./ircd


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!
Back to top
darkwarrior
Lurker
Lurker


Joined: 02 Aug 2008
Posts: 194

PostPosted: Oct 17, 2008 7:51pm    Post subject: Reply with quote

Excellent tutorial! I am sure many beginners looking to utilize the ratbox ircd will find this tutorial useful. I may follow up on your tutorial with some for ircu and possibly even Unreal. Thank you for your contribution to the IRC community!
Back to top
mouselike
Idler
Idler


Joined: 09 Dec 2003
Posts: 380
Location: IRC

PostPosted: Oct 18, 2008 3:21am    Post subject: Reply with quote

or they could just 'RTM' Smile
Back to top
Raggradarh
none
none


Joined: 26 Dec 2011
Posts: 8

PostPosted: Dec 26, 2011 6:34pm    Post subject: Reply with quote

i know it's an old thread but can you give me part 2 and 3 of the tutorials?
i got an unexpecting errors trying to $make ratbox-respond.... Any help is welcome. thanks
Back to top
Bertrum
Eleet
Eleet


Joined: 30 Mar 2008
Posts: 573
Location: Venus

PostPosted: Dec 27, 2011 2:09pm    Post subject: Reply with quote

Did you try searching for parts 2 and 3.

If you did, and couldn't find them then it's likely they don't exist
Back to top
Raggradarh
none
none


Joined: 26 Dec 2011
Posts: 8

PostPosted: Dec 31, 2011 8:35pm    Post subject: Reply with quote

Bertrum wrote:
Did you try searching for parts 2 and 3.

If you did, and couldn't find them then it's likely they don't exist


Sure, they gone. that's why i'm asking for help....
I got this message when i try to do "make" command and install ratbox-respond...


Code:
freyja@freyja:~/ratbox-respond-1.0/ratbox-respond$ make
gcc -g -O2 -I /usr/include  -o ratbox-respond ratbox-respond.c  -L /usr/lib -lcrypto
ratbox-respond.c: In function ‘read_challenge’:
ratbox-respond.c:200:9: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
ratbox-respond.c:204:14: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
freyja@freyja:~/ratbox-respond-1.0/ratbox-respond$ ./ratbox-respond /home/freyja/IRCD/etc/private.key
Error: Could not open the private keyfile.


Can someone help me?
Back to top
PingBad
Post Whore
Post Whore


Joined: 05 Feb 2005
Posts: 3086
Location: New Zealand

PostPosted: Dec 31, 2011 9:18pm    Post subject: Reply with quote

more often than not it's up to the user to generate their keyfile - is there any form of binary that accomplishes this task?
Back to top
Raggradarh
none
none


Joined: 26 Dec 2011
Posts: 8

PostPosted: Jan 03, 2012 1:21pm    Post subject: Reply with quote

PingBad wrote:
more often than not it's up to the user to generate their keyfile - is there any form of binary that accomplishes this task?


I don't know, that's why i'm asking here... Sad(( This ratbox-respond is the only problem that i have.... and i can't fix it
Back to top
chaz
Idler
Idler


Joined: 15 Jun 2005
Posts: 304

PostPosted: Jan 07, 2012 3:43pm    Post subject: Reply with quote

freyja@freyja:~/ratbox-respond-1.0/ratbox-respond$ ./ratbox-respond /home/freyja/IRCD/etc/private.key
Error: Could not open the private keyfile.

Does /home/freyja/IRCD/etc/private.key exist?

(created by running ./makekeypair)
Back to top
jobud9
none
none


Joined: 15 Jul 2012
Posts: 1
Location: United States

PostPosted: Jul 15, 2012 10:00pm    Post subject: Reply with quote

I'm having trouble. Here is what -conftest tells me:

Quote:

Syntax OK, doing second pass...
Second pass reports OK
"/home/ircd/ircd/conf/ircd.conf", line 2: Warning connect::class invalid for irc.jobud9_com


Note, I had to change the domain name because I'm a new user. (It really says that domain with the `_` replaced with a `.`.

Can anyone tell me whats wrong? Also, when do you plan on releasing the next tutorial?
Back to top
mouselike
Idler
Idler


Joined: 09 Dec 2003
Posts: 380
Location: IRC

PostPosted: Jul 16, 2012 4:50am    Post subject: Reply with quote

posting part or all of the config in question is a good starting (removing ip's & passwords), that only tells there is an error on line 2, but line 2 error could be caused by something missing like open / close quotation or braces on a line above.

I am a little confused by what you were saying about the domain part, you trying to say or arn't aware that the name of the server in the connect class isn't correct from the error you posted?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    SearchIRC Forum Index -> IRCD & Network Services All times are GMT - 6 Hours
Page 1 of 1

 
 
Forum powered by phpBB
 
 © 2000 - 2008 EverythingIRC, Inc. All rights reserved. Please read our disclaimer