FRAG Blog

Home brew IRC Server PART 1 (the server)

by on Aug.14, 2009, under Uncategorized

First off i would like to welcome you all to the first instalment of our “Home brew” series. This will be a series of articles focusing on hosting, development, programming/scripting and much more all done on windows machine. These articles are written by Blade and Silurian. We will try keep things simple and explain as much as we can. If you get stuck you are more than welcome to contact us on the FRAG IRC channel and/or pm us on the forums. Hope you enjoy our contributions. Have fun.

First off i would like to welcome you all to the first instalment of our “Home brew” series. This will be a series of articles focusing on hosting, development, programming/scripting and much more all done on windows machine. These articles are written by Blade and Silurian. We will try keep things simple and explain as much as we can. If you get stuck you are more than welcome to contact us on the FRAG IRC channel and/or pm us on the forums. Hope you enjoy our contributions. Have fun.


So, down to business. As you can see by the title today we will be showing you how to set up your own IRC server either for use at work (to chat and organize) or at home to get the family chatting (why would we want that right). Or if you really want to set up your own internet IRC server like ShadowFire and others like it, we will be walking you through step-by-step. This may seem like a daunting task at first but through the miracles of modern technology it is actually not that hard at all but it’s still nice to have someone to guide you through and point you in the right direction.
First off you will need some software (as usual). We will be showing you how to set up an IRC server, how to get it on the internet, and how to install services (these are things like Nickserv, Chanserv ect these help to moderate your irc server if you will) so down to the software list.
UnrealIRCd -      This is the software responsible for running the irc server itself and is called a daemon (a program that runs in the background like a service.)

Right, so once you have downloaded UnrealIRCd, it’s time to install. To install its the usual next, next, finish setup. Here you can decide if you want to install UnrealIRCd as a service and you can change where to install it to. So now you have an IRC server installed on your PC or Virtual Machine where ever. Don’t jump ahead and install services because we’ll cover that in part 2.

To edit the configuration of your server you must create a file named “unrealircd.conf” in the root directory (“C:\Program Files\Unreal3.2\” by default).
Now for the the nitty gritty part. I will be giving a break down of all the “blocks” (as they are called) in the config explaining what they do what you can change and what you should leave as is. At the end i will give you all a link to a tried and tested config which you can download and edit to your hearts content.

Note: We will use pastebin to give you a example config that you can edit to your setting
The first two lines of your config are as follows

loadmodule “modules/commands.dll”;
loadmodule “modules/cloak.dll”;

These two lines are important and are dependent on which OS you are using, since we are using windows we have to utilise the above line as windows uses .dll files not .so files like Linux. So as long as you are running your server on a windows PC the first two lines of your configuration will always remain the same (good to know hey).
Next we will be initialising a few other Config files that will be used with your server and be called up on with different commands
include “help.conf”;

include “aliases/anope.conf”;
include “badwords.channel.conf”;
include “badwords.message.conf”;
include “badwords.quit.conf”;
include “spamfilter.conf”;

lets take a look at the include “help.conf”; this line tell the server to also look at the help configuration file which thanks to the unreal developers is already set up this config file will be used when people type the /help command on your server and it will blurt out a whole bunch of nonsense (it’s actually rather helpful) about certain commands ect the same is done for all the other “include” lines the only other line i would like to point out is the include “aliases/anope.conf”; this line will only be needed if you are going to be installing services with your IRC server (I suggest doing this as it’s just more to experiment with) i will explain it more when the time comes (this will be the second instalment of Home Brew IRC server)

hmmm what’s next, AHH yes
now unfortunately even though you have installed your irc server it really has no clue who it is what it does ect
this next line will remedy the first problem of who it is by giving your server an identity and a description

me
{
name “irc.namehere.net”;
info “namehere IRC Server”;
numeric 1;
};

Name – here we are naming our server this can be anything you like it doesn’t really matter but keeping it in the irc.namehere.net format is probably best                                                        info – this is just giving your server some info so when people join they will see whatever you put here  again can be anything                                                                                             Numeric – this is important leave this as one for now, it is mainly used for multi server setups no server can have the same numeric

right so now that your server knows who it is we can continue with the rest of the config
this next part is not important but i will put it here just cause i felt like it and it has it’s uses

admin {
“Bob Smith”;
“bob”;
widely@used.name;
};

Admin gives information on the server admin. you may put as many lines under admin { as you wish. What this does is when people who on your server type /admin it will show then whatever you have put in the above block useful sometimes though more often never used but hey it’s good manners to put it there for all those people who have no clue what they doing
next we have classes

A class is a group setting for connections. Example, server connections, instead of going to a client’s class, you direct it to the server class. you can define how many connections of a certain class are allowed to connect and other miscellanies settings

class           clients
{
pingfreq 90; (how often to ping a user/server in seconds better to leave these as defaults)
maxclients 500;(how many connections for this class this is the only option we would need to change)
sendq 100000;(maximum send queue from a connection again this is better to lease as default)
recvq 8000;(maximum receive queue from a connection again better to leave as default)
};

class           servers
{
pingfreq 90;
maxclients 10;        /* Max servers we can have linked at a time */
sendq 1000000;
connfreq 100; /* How many seconds between each connection attempt */
};

next up we have the block of configuration that tells your server who exactly is allowed to connect

allow {
ip             *@*;
hostname       *@*;
class           clients;
maxperip 5;
};
right so above we are telling the server that any ip may join the server and well as any host name we have no restrictions here it’s easier to do it this way also, we are also saying that the class clients is allowed to connect with these rules Basically for clients, it allows them to connect so you can have some control

allow           channel {
channel “#help”;
};
this allows a user to join the specified channel even if they have an unregistered nickname ect ect you don’t really need this but it’s good to put it in so anyone can join your default channel on your server

official-channels {
“#Help” { topic ; };
“#Home” { topic ; };
};
it’s kinda obvious as the block title states but for those of you who are a little slow this sets your default/official channels on your server you can set as many channels as you like by putting the second channel under the first line and so on
moving right along next i will show you a the oper block this is how you gain control over your server and lets the server know whose boss IRC operators are there to keep sanity to the server and usually keep it maintained and connected to the network.

oper bobsmith {
class clients;
from {
userhost *@*;
};
password “CHANGEME”;
flags {
netadmin;
can_gkline;  //This is global kill line. A global network ban that can be applied to a user.
can_gzline;
can_zline; //This is zap line. Similar to gkline but applied to user IP ranges and only used it extreme cases.
can_restart;
can_die;
global;
can_override;
};
swhois “Example of a whois mask”;
snomask frebWqFv;
};

this block allows you to log into oper status by typing /oper username password (/oper bobsmith CHANGEME in this example) and it will set your permissions this block can be repeated as many times as you like with a whole bunch of different flags (you can find a list of flags in the unreal documentation) the block show above gives the oper all permission he is basically the server boss and can do what he likes
The next block in this seemingly endless explanation on configuration is the listen block this is what makes it possible for other people to join your server and start talking to each other it is a rather simple block in design and should be left as is to make life easy though you can edit it to allow SSL(security socket layer) connection for those wanting to be extra safe

listen *:6667 {
options {
clientsonly;
};
};
basically(well it’s pretty basic to begin with but anyway) you are listening on all ip’s (that’s the *) on port 6667 for a irc client to initiate connection the clients only flag mean only clients can connect on this port(kinda Obvious)

listen         *:7000;
this second listen block is for your services which we will be doing in the next article

link            services.yournetwork.net
{
username    *;
hostname     127.0.0.1;
bind-ip     *;
port         7000;
hub             *;
password-connect “password”;
password-receive “password”;
class           servers;
options {
};
};
this block is so your services can link to you server and go about it’s business of nick and channel registrations and any other services that are requires

drpass {
restart “calciareasino”;
die “calciareasino”;
};
the block above will set the two password needed for an oper (defined above somewhere) to restart and shutdown the server

log ircd.log {
flags {
errors;
kills;
oper;
kline;
tkl;
connects;
server-connects;
oper-override;
};
};
this block is used for logging purposes and there really isn’t a need to change anything here all you need to know is that your server will be logging all connection made any error when an oper signs in (pretty much everything that happens on your server)

ulines {
services.network.net;
};
this line

and now for the last and biggest part of the config it can get confusing i woudl advise agains’t changing too much here everything that has change me as a name is safe to change but lets just go ahead

set {
network-name “CHANGEME”;”;/* Put your networks name can be anything remember it*/
kline-address *@*;
auto-join “CHANGEME”;/* Put any channel you would like your user to be auto joined too*/
modes-on-join +nt;
options {
hide-ulines;
show-connect-info;
dont-resolve;
allow-part-if-shunned;
fail-oper-warn;
};
hosts {
local oper.CHANGEME.net;”;/*these should be changed to oper.network.net*/
global oper.CHANGEME.net;
coadmin oper.CHANGEME.net;
admin oper.CHANGEME.net;
servicesadmin oper.CHANGEME.net;
netadmin oper.CHANGEME.net;
host-on-oper-up yes;
};
oper-only-stats *;
allow-userhost-change force-rejoin;
services-server “services.network.net”;
cloak-keys {
“adfhpua4pbPUFH938JJcnedk3″;
“JDJiov834kJJDklfah3dkLnvl”;
“9384KJHdkcv83JnvnJfaAv034″;
};
hiddenhost-prefix “hide”;
maxchannelsperuser 15;
default-server “irc.networkhere.net”;”;/*should be your server name as defined in the me block*/
help-channel “#help”;
};

http://pastebin.com/f6fc61784

there is a complete example config file which you can copy and edit
there we go you are finally done with your configuration ( was long and slightly boring wasn’t it) but if you still reading you can now save your config and start your server and play around have fun and if you have any problem you can come onto mirc and join the shadowfire server come over to #frag and talk to either me or blade and we will be more then happy to help


Comments are closed.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Archives

All entries, chronologically...