Jump to content
paxnWo

Setting up an IRC server with services on Linux

Recommended Posts

Posted

In this tutorial I will cover the full setup of an IRC server with services. The packages I shall use in this tutorial are:

Unreal IRCD 3.2.6

Anope 1.7.18

I will try to update this tutorial on the release of new versions of the above softwares. They are both well known and widely used on IRC servers.

Ok, lets get started...

First step is to find a place to run the tools from. This can be done in a number of ways. You can either install linux on a PC at home, or more commonly you can buy an IRCD shell from a company such as shellfusion.net. Shellfusion is a great service which I personally use and have had no problems with, and is certainly well worth having a look at.

The shell company should give you instructions as to connecting to it via SSH.

Once you are connected and at the command line you must download the tools shown above. The easiest way to do this is to use the *nix command wget.

Type the following 2 commands to download the files to your shell:

wget http://unrealircd.alert-net.com/Unreal3.2.6.tar.gz

wget http://kent.dl.sourceforge.net/sourcefo ... .18.tar.gz

Next you need to extract the 2 compressed files you have just downloaded. To do this you must use the *nix command tar.

Type the following 2 commands to extract the files:

tar -zxvf Unreal3.2.6.tar.gz

tar -zxvf anope-1.7.18.tar.gz

Now we must rename the anope directory to services. To do this type:

mv anope-1.7.18 services

Next task is to change directory to the directory you untared the files to. To do this type:

cd Unreal3.2

Once in this directory you must start the config of the IRCD. To start this process type:

./Config

You will now see a whole bunch of information about unreal IRCD. Just press enter until you see the config ask you the question:

Do you want to enable the server anti-spoof protection?

After all of the questions the config asks you, you will see just before the prompt by which you type in square brackets, a default answer to the question. In most cases this should be left as default and the enter key should just be pressed.

To the question:

Do you want to enable the server anti-spoof protection?

Just press enter

To the question:

What directory are all the server configuration files in?

Just press enter

To the question:

What is the path to the IRCD binary including the name of the binary?

Just press enter

To the question:

Would you like to compile as a hub or as a leaf?

Type LEAF

To the question:

What is the hostname of the server running your IRCD?

Just press enter

To the question:

What should the default permissions for your configuration files be?

Just press enter

To the question:

Do you want to support SSL (Secure Sockets Layer) connections?

Just press enter

To the question:

Do you want to enable IPv6 support?

Just press enter

To the question:

Do you want to enable ziplinks support?

Just press enter

To the question:

Do you want to enable remote includes?

Just press enter

To the question:

Do you want to enable prefixes for chanadmin and chanowner?

Just press enter

To the question:

What listen() backlog value do you wish to use?

Just press enter

To the question:

How far back do you want to keep the nickname history?

Just press enter

To the question:

What is the maximum sendq length you wish to have?

Just press enter

To the question:

How many buffer pools would you like?

Just press enter

To the question:

How many file descriptors (or sockets) can the IRCD use?

Just press enter

To the question:

Would you like any more parameters to configure?

Just press enter

The script will now start the config. Once that is done we need to make the binaries from the source. To do this type:

make

This will go through and make the binaries. Once this is done, it is time to do the config file.

First you need to move the example config file from the doc directory to the main directory. You also need to rename it to unrealIRCD.conf. To do this type the following 2 commands:

cp doc/example.conf .

mv example.conf unrealIRCD.conf

Now the file is all moved over we need to edit it. This can be done in a number of ways. The best way is to download the file to your own pc and edit it in your favourite text editor. Most services provide FTP access, so this can be used to download the file. If you use windows, I have found that notepad doesn't format the conf correctly, so you must open it in wordpad.

On opening the config file there are a number of things you must change. All I will outline in this tutorial are the core basics to get your server up and running. There are many other options which you may use to customise your server to your own needs. These are all detailed in the Unreal IRCD docs.

Once you open the file you will see a number of things in it. I will now take you through step by step editing of this file to your needs.

Firstly, you will see the following 3 lines:

/* FOR *NIX, uncomment the following 2lines: */

//loadmodule "src/modules/commands.so";

//loadmodule "src/modules/cloak.so";

You must uncomment the 2nd and 3rd lines, that is remove the // from the front of them so that that block will look like this:

/* FOR *NIX, uncomment the following 2lines: */

loadmodule "src/modules/commands.so";

loadmodule "src/modules/cloak.so";

A little further down the file you will see:

me

{

name "IRC.foonet.com";

info "FooNet Server";

numeric 1;

};

This needs changing to the details of your own server. This can be ANYTHING you want. For example:

me

{

name "IRC.pchowtos.co.uk";

info "pchowtos IRC server";

numeric 1;

};

A bit further down again you will see:

admin {

"Bob Smith";

"bob";

"widely@used.name";

};

This is just for informational purpouses and just needs changing to your details. For example:

admin {

"Phil Lavin";

"phil";

"phil@pchowtos.co.uk";

};

Now for config of the opers. Scroll down the file until you see the following:

oper bobsmith {

class clients;

from {

userhost bob@smithco.com;

};

password "f00";

flags

{

netadmin;

can_zline;

can_gzline;

can_gkline;

global;

};

};

This is an example oper block config. This can be done unlimited times in a row to add new opers. You will need to edit this to your own details. oper bobsmith { is the oper username. This is what is typed when you oper-up on the server using the command /oper USERNAME PASSWORD.

userhost bob@smithco.com; This line tells the server where you are allowed to oper from. This is for security reasons to stop anyone stealing your password and opering up. bob is the ident and smithco.com is the host. This can be repeated as many times as you please. For example if you were to connect from home and work you may do:

userhost phil@*.home.host.com;

userhost phil@*.work.host.com;

* in the host is a wildcard. This meens that those with a dynamic IP, like myself can still oper by using the static bit of the host.

The flags { section tells the server what you can do as oper. The only one you might want to add to this is "can_override". This allows opers to override channel modes in which they do not have the access to do so.

Now a full example. In this example we will add two opers, jim and dave. They both connect from home and work and both have override privs.

oper jim {

class clients;

from {

userhost jimbo@*.dynamic.dsl.as9105.com;

userhost jimbo@*.vnnyca.adelphia.net;

};

password "j1msp4ss";

flags

{

netadmin;

can_zline;

can_gzline;

can_gkline;

global;

can_override;

};

};

oper dave {

class clients;

from {

userhost davey@.ipt.aol.com;

userhost davey@.ip.alltel.net;

};

password "dav3sp4ss";

flags

{

netadmin;

can_zline;

can_gzline;

can_gkline;

global;

can_override;

};

};

Next onto the listen block. This tells the IRCD where to wait for connections. Scroll down until you see:

Posted

listen *:6697

{

options

{

ssl;

clientsonly;

};

};

listen *:8067;

listen *:6667;

I will not go into what each bit meens, but just trust me and change it to:

listen YOURIP:6667

{

options

{

};

};

listen YOURIP:7000;

Where I put YOURIP above, you must enter the IP that the shell provider gave you. This will be a 4 section number separated with .s.

The listen *:7000; is for when we link with Anope services later.

Next is the link block. This will give details as to how the IRCD will connect with services.

Scroll down until you see:

link hub.mynet.com

{

username *;

hostname 1.2.3.4;

bind-ip *;

port 7029;

hub *;

password-connect "LiNk";

password-receive "LiNk";

class servers;

options {

/* Note: You should not use autoconnect when linking services */

autoconnect;

ssl;

zip;

};

};

In this tutorial we will run services on the same server and on port 7000. For this you will need to change the link block to the following:

link services.YOURNET.COM

{

username *;

hostname YOURIP;

bind-ip YOURIP;

port 7000;

hub *;

password-connect "PASSWORD";

password-receive "PASSWORD";

class servers;

options {

};

};

You must change YOURNET.COM to whatever the name of your network is. YOURIP muts be changed to the IP given to you by your shell provider and PASSWORD must be changed to a hard to guess password of your choice.

Now scroll down until you see:

tld {

mask *@*.fr;

motd "IRCD.motd.fr";

rules "IRCD.rules.fr";

};

This is a really stupid ~censored~ bit of the conf about using different messages for different countries. Just delete this whole bit from tld { to };.

Now the easy "pretty pretty stuff". Scroll down to:

set {

network-name "ROXnet";

default-server "IRC.roxnet.org";

services-server "services.roxnet.org";

stats-server "stats.roxnet.org";

help-channel "#ROXnet";

hiddenhost-prefix "rox";

And change the bit in the "s to your own network details. For example:

set {

network-name "PchowtosNet";

default-server "IRC.pchowtos.co.uk";

services-server "services.pchowtos.co.uk";

stats-server "stats.pchowtos.co.uk";

help-channel "#help";

hiddenhost-prefix "pchowtos";

Just under that you will see:

cloak-keys {

"aoAr1HnR6gl3sJ7hVz4Zb7x4YwpW";

"and another one";

"and another one";

};

This is to do with cloaking the IPs of users. You need to edit the 2 lines shown here. You can make up your own keys, but unreal tends to ~censored~ about it so feel free to use the example shown below:

cloak-keys {

"aoAr1HnR6gl3sJ7hVz4Zb7x4YwpW";

"ksWj9ImW0k20dO3cWm9Ej2g9RbdG";

"phTl4EiF7n26sI0jDw2Dn1c6RlfK";

};

Next to set the final few details. Change:

kline-address "set.this.email";

To something like:

kline-address "phil@pchowtos.co.uk";

And FINALLY you're all done. Save this config file and re-upload it to the server in the Unreal3.2 directory.

Now type:

./unreal start

To start your IRC server. Now just connect to it from your IRC client.

And now for services...

In the shell you need to get into the services directory. To do this type:

cd services

Once in this directory we need to configure the services. To do this type:

./Config

You will be asked:

In what directory do you want the binaries to be installed?

Copy out the contents of the square brackets and follow it with /bin e.g. if the value in the square brackets is:

/usr/home/myIRC/services

You would type:

/usr/home/myIRC/services/bin

Now press enter

You MAY be asked:

DIRECTORY does not exist. Create it?

Just press enter

You will be asked:

Where do you want the data files to be installed?

Just press enter

You MAY be asked:

DIRECTORY does not exist. Create it?

Just press enter

You will be asked:

Which group should all Services data files be owned by?

Just press enter

You will be asked:

What should the default umask for data files be (in octal)?

Just press enter

You will be asked:

Do you want to use the MD5 message-digest algorithm to encrypt passwords?

Just press enter

You will be asked:

Allow anope to automatically check for mysql libaries?

Type NO and press enter

Anope will now configure itself. Once this is done you must type:

make

If you get an error such as: make: Permission denied you must type:

gmake

Anope will now compile.

Now we must bake the modules by typing:

make install if this errors you must type gmake install.

Once this is finished we are all ready to roll.

Now we must do the config. First step is to copy the example config file into the bin directory.

First change directory to the bin directory by typing:

cd bin

Next we must rename example.conf to services .conf. To do this type:

mv example.conf services.conf

Now we must do the config like we did with Unreal. Again best to download it via FTP then open it up in wordpad. Once this is done we will being...

First of all, scroll down a little bit until you see a list of IRCDs. Just under this you will see:

#IRCDModule "unreal32"

Because we are using unreal3.2 in this tutorial you can just uncomment this line (remove the # from the front so it reads:

IRCDModule "unreal32"

Now scoll down to the "Remote server configuration" section. In this you will see the line:

RemoteServer localhost 6667 "mypass"

This must be changed to the details you entered in the link block for the unreal config file:

RemoteServer YOURIP 7000 "PASSWORD"

YOURIP being the ip you were given by your shell provider and PASSWORD being the password you entered in the unreal config.

Next scroll down to the Services identification and pseudoclient names section. In this you need to change 3 values:

ServerName "services.localhost.net"

ServerDesc "Services for IRC Networks"

ServiceUser "services@localhost.net"

These can be changed to something like:

ServerName "services.pchowtos.co.uk"

ServerDesc "Services for pchowtos"

ServiceUser "services@pchowtos.co.uk"

Next scroll down to: NetworkName "LocalNet"

Change this to your network name you entered in the Unreal config e.g.:

NetworkName "PchowtosNet"

Next scroll down until you see:

These are to do with encryption and MUST be changed. You must first remove the #s from the beginning of each line and replace the 7 digit numbers with other real numbers (no 0s at the start). e.g.

UserKey1 8362804

UserKey2 1387025

UserKey3 9693746

Now scroll down to: SendFrom services@localhost.net

Replace this with a real mail address e.g.

SendFrom services@pchowtos.co.uk

Now scroll down quite a way until you see:

#ServicesRoot "dengel anope"

This gives the registered nicknames of those who are services roots. Services roots can do everything on the net. You first need to uncomment this line by removing the # and then replace dengel anope with the nicks of the services roots. Note that svsroot privs will only be given once the net is started up and the people have registered their nicks. e.g.

ServicesRoot "dave jim"

And you're all done! Now you need to upload the config file again and start services by typing:

./services

Once they have started you should see them join the network if you are opered up.

Now go play!

As I said this tutorial is to get an IRC server working. You may read through the config files and change some of the options that take your fancy in order to make the network exactly how you want it.

Once you have made a change to the unreal conf you must be connected to the server and opered up. You can then just type /rehash to reload the config file. If you edit the services conf you must be a services root and type /msg operserv reload.

If you want the /os /cs /ns etc. to work you must include the aliases file in the unreal conf. Open up the unreal config file and find the lines which say:

include "help.conf";

include "badwords.channel.conf";

include "badwords.message.conf";

include "badwords.quit.conf";

include "spamfilter.conf";

Add to the end of this:

include "aliases/anope.conf";

This will allow you to use /ns /cs etc.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...