# IRC server

## cs.cracker

Im trying to set up an IRC server. I emerged ngircd, and Im having trouble setting it up.

First off, is ngircd a good choice? What does everyone recommend?

Secondly, how can I set it up? The config file is fairly self explanitory, but in the [server] section I dont know what to put in. If I leave it all commented, it complains about no peer servers.

----------

## bone

I personally have never used that ircd before (and I have used a ton of different ones). I use Unrealircd for the most part. I would suggest you go here for help on that ircd. http://arthur.ath.cx/~alex/ngircd/

jt

----------

## cs.cracker

The only part I have a problem with is here:

```
[Server]

   # Other servers are configured in [Server] sections. If you

   # configure a port for the connection, then this ngircd tries to

   # connect to to the other server on the given port; if not it waits

   # for the other server to connect.

   # There may be more than one server block.

   #

   # Server Groups:

   # The ngIRCd allows "server groups": You can assign an "ID" to every

   # server with which you want this ngIRCd to link. If a server of a

   # group won't answer, the ngIRCd tries to connect to the next server

   # in the given group. But the ngircd never tries to connect to two

   # servers with the same group ID.

   

   # IRC name of the server

   ;Name = irc2.the.net

   

   # Internet host name of the peer

   ;Host = connect-to-host.the.net

   # Port of the server to which the ngIRCd should connect. If you

   # assign no port the ngIRCd waits for incoming connections.

   ;Port = 6666

   # Own password for the connection. This password has to be configured

   # as "PeerPassword" on the other server.

   ;MyPassword = MySecret

   # Foreign password for this connection. This password has to be

   # configured as "MyPassword" on the other server.

   ;PeerPassword = PeerSecret

   

   # Group of this server (optional)

   ;Group = 123
```

I dont know what servers to put in, or where to get info for a server.

----------

## bone

If you are not going to like multiple servers I would say that it should not matter.

jt

----------

## cs.cracker

Here is the message log I get when running the server:

```

Can't bind socket: Address already in use!

Can't listen on port 6667!

Server isn't listening on a single port!

ngircd exited due to fatal errors!

```

I will post my config file when I can get on a different PC--I only have links2 on this one, and it doesnt support pasting from clipboard.

----------

## cs.cracker

If I leave the server section commented out, it complains about it, so I put in some info that Im not sure of.

Here is the config:

```

# $Id: sample-ngircd.conf,v 1.25.2.1 2004/05/07 11:24:17 alex Exp $

#

# This is a sample configuration file for the ngIRCd, which must be adepted

# to the local preferences and needs.

#

# Comments are started with "#" or ";".

#

# Use "ngircd --configtest" (see manual page ngircd(8)) to validate that the

# server interpreted the configuration file as expected!

#

[Global]

   # The [Global] section of this file is used to define the main

   # configuration of the server, like the server name and the ports

   # on which the server should be listening.

   

   # Server name in the IRC network, must contain at least one dot

   # (".") and be unique in the IRC network. Required!

   Name = qmans.irc.network 

   

   # Info text of the server. This will be shown by WHOIS and

   # LINKS requests for example.

   Info = qmans IRC server

   # Global password for all users needed to connect to the server

   ;Password = abc

   

   # Information about the server and the administrator, used by the

   # ADMIN command. Not required by server but by RFC!

   AdminInfo1 = Description

   AdminInfo2 = Location

   AdminEMail = admin@irc.server

 

   # Ports on which the server should listen. There may be more than

   # one port, separated with ";". (Default: 6667)

   Ports = 6667;6668;7000;66694

   # IP address on which the server should listen. (Default: empty,

   # so the server listens on all IP addresses of the system)

   ;Listen = 1.2.3.4

   

   # Text file with the "message of the day" (MOTD). This message will

   # be shown to all users connecting to the server:

   MotdFile = /etc/ngircd/ngircd.motd

   # A simple Phrase (<256 chars) if you don't want to use a motd file.

   # If it is set no MotdFile will be read at all.

   ;MotdPhrase = "Hello world!"

   # User ID under which the server should run; you can use the name

   # of the user or the numerical ID. ATTENTION: For this to work the

   # server must have been started with root privileges! In addition,

   # the configuration and MOTD files must be readable by this user,

   # otherwise RESTART and REHASH won't work!

   ServerUID = ngircd

   # Group ID under which the ngircd should run; you can use the name

   # of the group or the numerical ID. ATTENTION: For this to work the

   # server must have been started with root privileges!

   ServerGID = nogroup

   # A directory to chroot in when everything is initialized. It

   # doesn't need to be populated if ngIRCd is compiled as a static

   # binary. By default ngIRCd won't use the chroot() feature.

   # ATTENTION: For this to work the server must have been started

   # with root privileges!

   ;ChrootDir = /var/empty

   # After <PingTimeout> seconds of inactivity the server will send a

   # PING to the peer to test whether it is alive or not.

   PingTimeout = 120

   # If a client fails to answer a PING with a PONG within <PongTimeout>

   # seconds, it will be disconnected by the server.

   PongTimeout = 20

   # The server tries every <ConnectRetry> seconds to establish a link

   # to not yet (or no longer) connected servers.

   ;ConnectRetry = 60

   # Should IRC Operators be allowed to use the MODE command even if

   # they are not(!) channel-operators?

   OperCanUseMode = no

   # Maximum number of simultaneous connection the server is allowed

   # to accept (<=0: unlimited):

   MaxConnections = -1

   

   # Maximum number of simultaneous connections from a single IP address

   # the server will accept (<=0: unlimited):

   MaxConnectionsIP = 3

   # Maximum number of channels a user can be member of (<=0: no limit):

   MaxJoins = 15

[Operator]

   # [Operator] sections are used to define IRC Operators. There may be

   # more than one [Operator] block, one for each local operator.

   

   # ID of the operator (may be different of the nick name)

   Name = qman

   # Password of the IRC operator

   Password = csqw34ty

[Server]

   # Other servers are configured in [Server] sections. If you

   # configure a port for the connection, then this ngircd tries to

   # connect to to the other server on the given port; if not it waits

   # for the other server to connect.

   # There may be more than one server block.

   #

   # Server Groups:

   # The ngIRCd allows "server groups": You can assign an "ID" to every

   # server with which you want this ngIRCd to link. If a server of a

   # group won't answer, the ngIRCd tries to connect to the next server

   # in the given group. But the ngircd never tries to connect to two

   # servers with the same group ID.

   

   # IRC name of the server

   Name = Freenode 

   

   # Internet host name of the peer

   Host = irc.freenode.net

   # Port of the server to which the ngIRCd should connect. If you

   # assign no port the ngIRCd waits for incoming connections.

   Port = 6667

   # Own password for the connection. This password has to be configured

   # as "PeerPassword" on the other server.

   ;MyPassword = MySecret

   # Foreign password for this connection. This password has to be

   # configured as "MyPassword" on the other server.

   ;PeerPassword = PeerSecret

   

   # Group of this server (optional)

   ;Group = Freenode

[Channel]

   # Pre-defined channels can be configured in [Channel] sections.

   # Such channels are created by the server when starting up and even

   # persist when there are no more members left.

   # Persistent channels are marked with the mode 'P', which can be set

   # and unset by IRC operators like other modes on the fly.

   # There may be more than one [Channel] block.

   

   # Name of the channel

   Name = #BotChan

   # Topic for this channel

   Topic = Bot Testing Channel

   

   # Initial channel modes

   Modes = tn

[Channel]

   Name = #crypt

   Topic = qman's crypt

   Modes = tn

# -eof-

```

----------

## bone

If that is what it is saying, then your going ot need to figure out what is bound to that port already. Is this your server or someone elses? If its someone elses you will have to bind it to a different port, or a different IP as two things canot be bound to the same port on the same IP.

A "netstat -anp | grep -i 6667" should tell you whats bound on that port.

 *cs.cracker wrote:*   

> Here is the message log I get when running the server:
> 
> ```
> 
> Can't bind socket: Address already in use!
> ...

 

jt[/code]

----------

## cs.cracker

Its my own box. Heres the output of that command:

```

AMD-K6 root # netstat -anp | grep -i 6667

tcp        0      0 0.0.0.0:6667            0.0.0.0:*               LISTEN

```

How would I find out what application is using it?

----------

## eltech

 *cs.cracker wrote:*   

> Its my own box. Heres the output of that command:
> 
> ```
> 
> AMD-K6 root # netstat -anp | grep -i 6667
> ...

 netstat -ptln

try that out..

----------

## cs.cracker

```

AMD-K6 root # netstat -ptln

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address           Foreign Address         State

tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN

tcp        0      0 0.0.0.0:6667            0.0.0.0:*               LISTEN

tcp        0      0 0.0.0.0:6668            0.0.0.0:*               LISTEN

tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN

tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN

```

----------

## Bobrepuss

ps aux | grep irc

 :Razz: 

----------

