IRC 一种基于网络的群体聊天方式。可以进行群体聊天也可以进行个人对个人的单独聊天。这种起源于上世纪的聊天技术在当时被很多网友追捧。可惜经过网络信息交流方式日新月异的变化,逐渐被各类聊天软件所淘汰。
IRC具有分布式的客户端/服务器结构。用户通过IRC软件连接并登录到到一个IRC服务器,可以访问这个服务器以及它所连接的其他服务器上的频道。 选择相应的聊天频道,既可以开始广播式的群里聊天。也可对频道中单独的用户发起聊天。
下面的教程将以Linux VPS为平台,利用UnrealIRCd(一个开源的IRC服务器程序)来搭建一个IRC聊天室。
系统:Debian7 x32 (VPS提供商采用Digitalocean)
软件:UnrealIRCd
首先用Xshell 登录你的VPS
安装篇
更新源
由于是新装的Debian系统,我们先用update命令更新一下源
apt-get update
安装软件包
安装vim文本编辑器,以及IRC加密功能所需要的软件包
apt-get install vim build-essential openssl libcurl4-openssl-dev
下载UnrealIRCd源码包
wget https://www.unrealircd.org/downloads/Unreal3.2.10.4.tar.gz
解压已下载的UnrealIRCd源码包
tar zxvf Unreal3.2.10.4.tar.gz
进入解压之后的目录
cd Unreal3.2.10.4
开始编译
./Config
*开始编译之后UnrealIRCd会首先列出“使用条款”以及“版本更新信息”
我们只需一路按“回车”使进度条变为100%,然后出现[Enter to continue]则说明阅读完毕。
然后我们再按一下“回车”,之后将会出现一些关于IRC服务器的配置问题。我们一般选择默认即可。
*但要注意下图中的这个选项。询问是否开启IRC服务器的加密支持。我们需要输入“yes”。否则你搭建的IRC服务器无法支持SSL加密。
回答所有配置问题只有就进入了编译阶段,这大概耗费1分钟的时间。
*编译完毕之后会,你将会被要求为你的服务器创建一个SSL证书。下图中的问题,我们输入“yes”,并回车。
之后将会通过要求你输入SSL相关信息来进行创建SSL。逐项输入之后并回车继续。
问题 1: Country Name. 例:CN
问题 2: State/Province. 例:Shanghai
问题 3: Locality name. 例:Shanghai
问题 4: Organization Name. 例:Renao
问题 5: Organizational Unit Name. 例:Technical Dept
问题 6: Common Name. 这里输入你为IRC服务器绑定的域名。例: irc.renao.org
完成之后,将会出现如下画面。
输入make命令,并回车。
make
大概需要等待几时秒的时间,UnrealIRCd就安装成功了。
配置篇
利用vim工具创建unrealircd.conf文件并将配置文本粘贴进去
vim unrealircd.conf
输入“i”进入编辑模式。然后复制如下的配置文件,并粘贴进入。
按“esc”,并输入“:wq” 保存并退出。
配置文件
loadmodule "src/modules/commands.so";
loadmodule "src/modules/cloak.so";
#This is the me {} block
me {
name "irc.renao.org";
info "Renao Technical Dept.";
numeric 1;
};
#This is the admin {} block
admin {
"renao";
"admin@renao.org";
};
#This is the oper {} block
oper YourName {
class clients;
from {
userhost Me@and.my.host;
};
password "ILiKEopeRING1022";
flags
{
netadmin;
can_zline;
can_gzline;
can_gkline;
global;
};
};
#This is the services link block
/*
link services.renao.org
{
username *;
hostname 127.0.0.1;
bind-ip *;
port 6667;
hub *;
password-connect "Sup3rSERViCE";
password-receive "Sup3rSERViCE";
class servers;
};
*/
#This is the ulines block
ulines {
services.renao.org;
};
#START OF BAN BLOCKS
ban nick {
mask "*C*h*a*n*S*e*r*v*";
reason "Reserved for Services";
};
ban ip {
mask 195.86.232.81;
reason "Noob";
};
ban user {
mask *tirc@*.saturn.bbn.com;
reason "Idiot";
};
ban realname {
mask "Swat Team";
reason "mIRKFORCE";
};
except ban {
/* don't ban renao :) */
mask *renao@adsl-074*;
};
deny channel {
channel "*hack*";
reason "hack is illegal";
};
#END OF BAN BLOCKS
#This is the vHost block
vhost {
vhost super.cool.irc.dude;
from {
userhost *@*;
};
login YourName;
password LovingTheKwlHost;
};
#This is the network settings block
set {
network-name "Renao";
default-server "irc.renao.org";
services-server "services.renao.org";
stats-server "stats.renao.org";
help-channel "#Help";
hiddenhost-prefix "Test";
cloak-keys {
"KIuoehnfOush230uNSDL309subnsA";
"Jk93uKLsd30skSHNfel39wLKHd3ws";
"Iehnludhnfe83KLBDHef39ekHBD44";
};
hosts {
local "locop.renao.org";
global "ircop.renao.org";
coadmin "coadmin.renao.org";
admin "admin.renao.org";
servicesadmin "csops.renao.org";
netadmin "netadmin.renao.org";
host-on-oper-up "no";
};
};
#This is the server settings block
set {
kline-address "admin@renao.org";
modes-on-connect "+ix";
modes-on-oper "+xwgs";
oper-auto-join "#opers";
options {
show-connect-info;
};
maxchannelsperuser 30;
anti-spam-quit-message-time 10s;
oper-only-stats "okfGsMRUEelLCXzdD";
throttle {
connections 3;
period 60s;
};
anti-flood {
nick-flood 3:60;
};
spamfilter {
ban-time 1d;
ban-reason "Spam/Advertising";
virus-help-channel "#help";
};
};
#Do not edit anything below this line, unless you know what you are doing
include "help.conf";
include "badwords.channel.conf";
include "badwords.message.conf";
include "badwords.quit.conf";
include "spamfilter.conf";
class clients
{
pingfreq 90;
maxclients 500;
sendq 100000;
recvq 8000;
};
class servers
{
pingfreq 90;
maxclients 10;
sendq 1000000;
connfreq 100;
};
allow {
ip *@*;
hostname *@*;
class clients;
maxperip 5;
};
listen *:6697
{
options
{
ssl;
clientsonly;
};
};
listen *:8067;
listen *:6667;
log "ircd.log" {
maxsize 2097152;
flags {
oper;
kline;
connects;
server-connects;
kills;
errors;
sadmin-commands;
chg-commands;
oper-override;
spamfilter;
};
};
alias NickServ { type services; };
alias ChanServ { type services; };
alias OperServ { type services; };
alias HelpServ { type services; };
include "aliases/anope.conf";
运行篇
输入如下命令并回车。
./unreal start
看到如下画面,你的IRC服务器就已正常运行。
现在就可以通过IRC软件连接您的服务器了。
普通端口:6667 加密端口:6697