Irc is a user interface to the Internet Relay Chat, a CB like interactive discussion environment. It is structured into channels, which are public discussion forums, and also allows for private intercommunication. Each participant has a nickname, which is the one specified in the command line or else his login name.
# rpm -ihv irc-2.9.5+jp5-1.i386.rpm
error: failed dependencies:
libncurses.so.3.0 is needed by irc-2.9.5+jp5-1
# mount /mnt/cdrom
# cd /mnt/cdrom/Redhat/RPMS/
# rpm -ihv ncurses3-1.9.9e-11.i386.rpm
...
M:speedking.my-machine.com::Japan:6667:
A:IRC Server:Master [email protected]::
P::::6667:
Y:1:120:1500:32:100000
I:*@*::*@*:6667:1
K:*:Permission denied:root:0
...
IRC needs to know a few things about your UNIX site, and the ``M'' command specifies this information for IRC. The fomat of this command is:
M:speedking.my-machine.com::Japan:6667:
M:<Server NAME>:<YOUR Internet IP#>:<Geographic Location>:<Port>
The port line adds flexibility to the server's ability to accept connections. By use of this line in the ircd.conf file, it is easy to setup both Unix Domain ports for the server to accept connections on as well as extra internet ports.
P::::6668:
P:<Internet IP#>:<*>:<Internet IP Mask>:<Port>:
P:::128.2.*:6664:
P:::128.2.0.0:6664:
Each line for a server should have the same number as the sixth
field. If it is absent, the server deaults it to 0, using the defaults
from the config.h file.
To define a connection class, you need to include a Y: line in the
ircd.conf file. This enables you to define the ping frequency,
connection frequency (for servers) and maximum number of links that
class should have.
Currently, the Y: line MUST appear in the ircd.conf file BEFORE it is used in any other way.
This defines class 23 to allow 5 auto-connections, which are checked every 300 seconds. The connection is allowed to remain silent for 120 seconds before a PING is sent. NOTE: fields 3 & 4 are in seconds. The SendQ is set to 100000 bytes.
Y:23:120:300:5:100000:0:0:
Another feature of connection class is the ability to do automatic routing by using the class as a ``priority''. If you are connected to a server which has a class lower than one of the servers that is ``behind'' it, the server will disconnect the lower class one and schedule a ``new'' connection for the higher class server.
In case of a client class, the fields are interpreted a bit differently. This class (number 1) can be used by up to 50 users. The connections are allowed to remain silent for 60 seconds before a PING is set. The SendQ is set to 20000 bytes. A new connection in this class will only be allowed if there aren't more than 2 other local connections from the same IP address, or more than 5 other connections on the net from the same hostname.
Y:1:60:0:50:20000:2:5:
In case of a client class, the fields are interpreted a bit differently. This class (number 1) can be used by up to 50 users. The connections are allowed to remain silent for 60 seconds before a PING is set. The SendQ is set to 20000 bytes. A new connection in this class will only be allowed if there aren't more than 2 other local connections from the same IP address, 1 other local connection from the same user from the same IP address, or more than 5 other connections on the net from the same hostname.
Y:2:60:0:50:20000:2.1:5:
The ircd.conf files contains entries that specify which clients are allowed to connect to your irc daemon. Obviously you want to allow your own machine's clients to connect. You may want to allow clients from other sites to connect. These remote clients will use your server as a connection point. All messages sent by these clients will pass through your machine.
I:<TARGET Host Addr>:<Password>:<TARGET Hosts NAME>:<Port>:<Class>
Allow anyone from anywhere to connect your server.
I:*::*::1
Allow any clients from machines whose names end in ``.du.edu'' to connect with no password.
I:x::*.du.edu::1
Allow clients from machines matching ``*.fi'' to connect on the port 6667.
I:x::*.fi:6667:1
There is an OPERATOR at ``*.cair.du.edu'' that can get Operator priviliges if he specifies a password of ``pyunxc'' and uses a NICKNAME of ``Jeff''.
O:*.cair.du.edu:pyunxc:Jeff::1
# chkconf ircd.conf
...
# IRC
/usr/local/sbin/ircd -c -d /usr/local/lib/ircd
...
#!/usr/bin/perl
#
#@Use as a SSI
#
# Example: <!--#exec cmd="./chk.pl"-->
#
$member = 0;
unless (open(PIPE,"/bin/netstat |")) {
print "ERROR\n";
exit;
}
chop(@ans =);
close(PIPE);
$checkword = ":6667";
foreach $line (@ans) {
if ($line=~ m/$checkword/) {$member = $member+1};
}
print "$member users are chatting on this IRC server\n";
exit;
Copyright [- SroNey / JohN -]. All rights reserved