## Setting Up and Running an IRC Server
## Matthew Lager <[email protected]>
Being an active member on IRC (Internet Relay Chat), I get asked many
questions. One of the most common questions that I am asked is, "How
do I start my own IRC server?". Well, since I am asked this so much,
I have decided to compile a short but detailed article on how to start
your own IRC server. This article is designed to be read from top to
bottom. If you follow the article exactly, you should have no
problems getting IRCd to work.
What is needed?
To run your own IRC server, you need something called an IRCd
(Internet Relay Chat Daemon). It is most common to run this server on
a Unix based machine however it is also available for the Windows
platform. This article will be discussing how to install the IRCd on
a FreeBSD system. Many types of IRCd are available and this article
will discuss how to install DreamForge-4.6.7. I have chosen to write
about this IRCd due to its compatibility with the FreeBSD operating
system and the fact that it is the easiest most stable IRCd available.
It is preferable by most people that an IRCd be ran on a very fast
connection such as a T-1, T-3, or an OC-3 line however, it is still
possible to install and run an IRCd on a machine with a lesser
connection. Be sure to obtain permission from your system
administrator before running an IRCd.
This article assumes that the FreeBSD system that you plan to run
the IRCd on has all basic software installed.
Where do I get DreamForge-4.6.7?
Before continuing with this article, it is a good idea to download
the IRCd to your account. Do not run IRCd as root, be sure to run it
from a user account. Most FreeBSD systems have access to FTP (File
Transfer Protocol) so I will tell you how to download with that.
First, FTP to ftp.dal.net by typing:
# ftp -a ftp.dal.net
Second, change your directory to /dalnet/server by typing:
# cd /dalnet/server
Third, download DreamForge-4.6.7 by typing:
# get df467.tar.gz
After the download is complete, df467.tar.gz should reside in your
home directory.
***********************************************************************
*** For this article, we will use /home/ircd/ as the home directory ***
***********************************************************************
Unpacking DreamForge-4.6.7
This section explains how to "unpack" all the files included in
df467.tar.gz.
First, cd to your home directory by typing:
# cd ~/
Second, unzip df467.tar.gz by typing:
# gunzip df467.tar.gz
Third, untar df467.tar by typing:
# tar -xvf df467.tar
After these steps have been completed, a directory named df467 should
reside in /home/ircd/. All files necessary for this IRCd are included
in this directory.
Necessary files to read before compiling
Even though this article explains how to install the IRCd completely,
it's still a good idea to read the documentation included with the
package. These files include:
/home/ircd/df467/CHANGES
/home/ircd/df467/INSTALL
/home/ircd/df467/LICENSE
/home/ircd/df467/NOTICE
/home/ircd/df467/READTHIS.NOW
Also be sure to take a look at the files in /home/ircd/df467/doc.
There are some good documents on the IRCd and other IRC related
issues.
Using the Config script
Before you do anything with the IRCd, it is required that you run a
script called Config. This has been included with df467. The
following will explain how to use this script.
First, type:
# cd /home/ircd/df467/
Second, type:
# ./Config
The first thing you should see is a document containing changes
throughout the various versions of DreamForge. You can quickly review
this and move on by pressing the space bar then enter. This
script will then ask you several questions. Most of the questions
have a default value in which you may just press enter to accept the
value. Most default values should be alright to use for your system.
Which compiler do you use, gcc or cc or...?
[gcc] ->
gcc is the default value, however, if you wish to use a different
value, type it then press enter.
You should use the recommended value unless you have a
compelling reason not to...
I suggest: none
[none] ->
Even though this line says it suggests none, some FreeBSD machines
require the -lcrypt flag to be used. At this question, enter -lcrypt
as the value and press enter.
[] ->
A prompt such as this indicates there is no default value. Type in
the value you would like to use and press enter to continue.
What directory are all the server configuration files in?
[/usr/local/lib/ircd] ->
This is asking for the directory the IRCd files reside in. In this
case, the files reside in /home/ircd/df467/ so type that and then
press enter.
What is the explicit path to where the ircd binary will be
installed? This should point to a file, not a directory
[/usr/local/bin/ircd] ->
This is asking for the path to the IRCd binary. In this case, the
binary is located at /home/ircd/df467/src/ircd so type that and then
press enter.
Do you use encrypted operator passwords?
[No] ->
In FreeBSD, it is not a good idea to use encrypted operator
passwords. It would be best to use the value No.
How many file descriptors (or sockets) can the irc server use?
[1024] ->
This defines the maximum users the server will let connect to it. In
FreeBSD, 256 users is supported. You must choose 256 for this value
or the IRCd will not work correctly.
After you are through with the Config script, you are ready to
compile the IRCd.
Compiling the IRCd
After you have ran the Config script, your system is ready to compile
the IRCd. To compile the IRCd, simply type 'make'. It should then
compile smoothly. If you get compile errors, refer to the problems
section of this article. After the IRCd is compiled successfully, you
are ready to edit the configuration files.
Creating the ircd.conf
This is the section that you should pay most attention to. The
ircd.conf file defines different things for your IRCd such as IRC
operators, ports, server names, descriptions, and connection info.
This section will show you the most important variables that should be
in the ircd.conf. The ircd.conf is to be placed in /home/ircd/df467/.
If you need a more detailed description of the lines in the
ircd.conf, refer to /home/ircd/df467/doc/example.conf. The following
are the suggested lines to be in the ircd.conf.
M:SanDiego.CA.US.Server.Net:*:San Diego IRC Server:6667
This line identifies the server. It defines the server name and the
description of the server along with the default IRCd port. If you have
a virtual IP, that should be inserted where the * is. If you have no
virtual IP, leave the * there.
A:Generic Internet Access:Admin John Doe:[email protected]
This line defines the administrative info for the /admin command. You can
edit this line to say whatever you want putting a : to separate the lines.
Normally, the administrators name and E-mail address is included. Also
include the name of the ISP who hosts the IRCd.
I:*@*::*@*::1
This is an access line. This requires no editing but is required to be in
the ircd.conf file. If you would like the user to have to enter a password
to connect, put that password in the middle so it looks like this: I:*@*:password:*@*::1.
If nothing is in the middle, no password is set and anyone can connect the
the server.
X:diepass:restartpass
This lines defines the password for the /die and /restart commands.
O:*user@*.uu.net:password:nickname::10
This is a line to define an IRC operator. The first part contains the users
hostmask, the second part contains the users password, and the third part
contains the users nickname.
Q::Reserved for services:Chanserv
This line reserves defines a nickname in which a user may not use. The first
section is the message displayed when a user tries to change his/her nickname
to it and the second section is the nickname. Any number of Q lines may be
added.
P:*:*:*:7000
This is a line that defines a port other then the default port in the M line.
You can have any number of ports as long as they are available on the system
you are running the IRCd on. If you have a virtual IP, the P line should look
like the following: P:VirtualIP:*:*:7000.
The following lines must be in the ircd.conf. They do not require any
editing.
Y:1:90:0:20:100000
Y:50:90:60:1:4000000
Y:51:90:60:0:4000000
Y:30:90:0:0:3500000
Y:32:180:0:0:3500000
Y:34:300:0:0:3500000
Y:40:90:90:1:3500000
Y:41:90:90:0:3500000
Y:42:180:90:1:3500000
Y:44:300:120:1:3500000
Once all of the above lines have been added to your ircd.conf and
have been edited, you are through with the creation of the ircd.conf.
Once again, the ircd.conf should reside in /home/ircd/df467/.
Creating the ircd.motd
This file is 100% customizable. Usually, rules and information about
the server is inserted into this file in a nice format so people can
read it. It is displayed when someone connects to the IRC server and
it is displayed when someone types /motd. The ircd.motd should reside
in /home/ircd/df467/.
Starting the IRCd
If you have followed all of the above steps and the IRCd has been
compiled successfully, you are ready to start the IRCd.
First, type:
# cd /home/ircd/df467/src
Second, type:
# ./ircd
If everything has been configured correctly, the IRCd should be
running. To check to see if it is, type ps -x. You should see
something like the following:
PID TT STAT TIME COMMAND
1087 p0 Ss 0:00.05 -bash (bash)
1090 p0 R 0:00.00 ./ircd
1091 p0 R+ 0:00.00 ps -x
Somewhere in your ps -x you should see ./ircd. If you do, you can
then try connecting to your IRC server. Be sure to connect to the
server using a port that was defined in your ircd.conf.
Is DreamForge Y2K compliant?
That's not something to worry about until January 1, 2000 at 12:00 AM :-)
Problems
This section will discuss various problems that may occur when trying
to use the IRCd. If your problem is not listed below, please send
your problem to the email address at the top of this article and I'll
try to help solve your problem.
When trying to start the IRCd, you get the following error:
ircd fd table too big
Hard Limit: 360 IRC max: 0
Fix MAXCONNECTIONS
This is a result of one of the questions in the Config script:
How many file descriptors (or sockets) can the irc server use?
[1024] ->
You should have used 256 instead of 1024. Fix this, then recompile
and try and start the IRCd once again.
When trying to start the IRCd, it isn't running and no errors
were given.
This can be a tricky problem without errors however it isn't the end
of the world. It is most likely due to an error in the ircd.conf. Go
and recheck everything in your IRCd and make sure all necessary lines
are in there. Another problem could be that the ports that you
selected in your ircd.conf are already being used by someone else. In
this case, you will have to use different ports.
In conclusion
I hope that this article has given you a working IRCd. If you think
there is anything I should add to this article, or have any problems
with your IRCd, email me. Thank you for taking the time to read this
and have a wonderful time with your new IRCd.
Matthew Lager
Return to Issue #3
|