Skip to content

Nefarious 1.3 Installation Example

Rubin edited this page Dec 17, 2013 · 1 revision

This guide will walk you through installing the latest nefarious 1.3 ircd with a simplified basic configuration.

This guide assumes you know how to use a unix command line (bash or similar) and will provide some debian/ubuntu specific tips. If you are unfamiliar with the command line please see http://linuxcommand.org/ for a tutorial.

Install Prerequisites

You will need some other packages installed to follow this example. On ubuntu/debian you can use the software manager, or the command line to install the following. On fedora/redhat/centos you can use the yum command line but the package names may be slightly different.

mercurial
openssl
libssl-dev
autoconf
automake
flex
libpcre3-dev
byacc
libtre
build-essentials  
# (On debian/ubuntu build-essentials brings in the
# c compiler, make, and all common build tools)

Once you have the above packages installed you are ready to continue.

Obtaining the Source Code

Open terminal to the computer which is to host the irc server. In this example we are going to install x3 to a directory called x3 in your home directory. The most recent version of nefarious is stored in a code versioning system called mercurial (hg for short)

Check out the nefarious repository:

:::bash
cd
hg clone http://hg.code.sf.net/p/evilnet/nefarious nefarious
cd nefarious

You now have a directory called nefarious which contains the ircd source code. Note: the install directory will be different than the source directory.

Building

Before we can compile nefarious we must configure the build environment for our system and setup some basic configuration settings. The nefarious project (ab)uses GNU autotools to build a proper Makefile for you. For this example we are going to install the server into a directory called 'ircd' in your home directory. I sometimes like to tell the ircd to put all its files (both binary program and config files) into one directory together, for simplicity, like this:

./configure --libdir=$HOME/ircd --mandir=$HOME/ircd --bindir=$HOME/ircd

Now the configure script will poke and prod your system to find all its nuances and available c libraries. If you are missing something important, the script will stop and tell you. Some features may only be available if you have certain libraries installed, so configure will tell you what its finding. Don't worry too much about the output here if you are new. As long as it completes successfully you can continue. Next we will compile the c source code into binaries (executable code):

make

You can see the progress as the compiler builds the ircd. If there are problems, look for the top-most error first. Issues at this point usually involve missing or incorrect libraries. Once it completes, we can install it:

make install

The ircd and example files are now (if all went well) copied to the "ircd" directory in your home directory. Lets go there:

cd ~/ircd

Configuration

Next grab this stripped down example ircd.conf file and put it in the install directory as ~/ircd/ircd.conf

(Editors note to self...TODO: de-afternetize that file and host it on sourceforge somewhere)

Lets take a moment now to talk about working with linux/*nix and editing config files. First of all, ircds need all their files to be in UNIX line ending format. Files you save on windows or on a mac will not be ok. This is one of our most common questions in the support channel so let me say it again: do not edit the ircd.conf on your windows computer and copy it to your *nix host. It is time to learn how to edit files over ssh. If you are of good character and strong heart, I suggest taking a moment to teach yourself how to use vi. Caution: if you run vi without first reading the directions, you're gonna have a bad time. Try this tutorial or google for many many others. If you are weak and wussy, you can use the nano editor which is easier to grasp without reading. both vi and nano are almost ALWAYS available. Caution though, nano wraps lines by default which will break things badly. Always use "nano -w " to disable wrapping, or put "set nowrap" in your ~/.nanorc file.

Now that you have worked out how to edit files, open up the ircd.conf file. You want to modify the General and Admin sections. Be careful to follow the syntax, mismatched curly brackets or quotes will cause failure. Edit only the minimum needed to get the ircd running. Once you know its working you can come back and do more. If you need help with what things do, refer to ircd.example (in the same directory, it was put there helpfully by "make install".

You will want to give yourself an oper block too, so you can oper up later.

Running the ircd

You are now ready to start your IRC server. Run:

./ircd

The ircd should start up and your prompt will return instantly. The ircd runs in the background as a daemon (*nix word for service.) Test it out by connecting with an irc client. You can check if the ircd is running with the ps command. Try running:

ps xw|grep ircd

In that list you can see the ircd process and its process id (PID). Use the pid to kill or rehash:

kill -HUP 12345   #causes ircd process 12345 to re-read ircd.conf
kill 12345        #asks process 12345 to kindly stop running
kill -9 12345     #force process 12345 to stop immediately no matter what

Complete
---------
You now have a basic operational ircd. Theres endless ways to customize it to make it your own. For ideas, see the doc/ directory in the nefarious source.

Clone this wiki locally