*****************************************************************
* PTlink IRCd is (C) CopyRight PTlink Coders Team 1999-2004     *
* http://www.ptlink.net/Coders/ - coders@PTlink.net             *
* This program is distributed under GNU Public License          *
* Please read the file COPYING for copyright information.       *
*****************************************************************
#################################################################
##########PTlink SERVER CONFIGURATION - By: Rohin Koshi##########
#################################################################
* $Id: GETTING_STARTED,v 1.3 2004/05/20 23:02:24 jpinto Exp $           *

So, you have downloaded the latest version of PTlink IRCD,
along with the latest version of the services file, and you
are wondering what to do next? This guide tells you what to do,
step by step, line by line, and helps you get your server started.
Follow it line by line, and try not to skip lines unless you know
exactly what it is that you are doing!

The actual configuration of the server is quite simple depending
on what kind of connection you have to the internet and exactly
what you will be doing with the server, through the setting of a
few variables - mainly in the following files (if you use the default
installation path):
~/ircd/etc/ircd.conf
~/ircd/etc/main.dconf
~/ircd/etc/network.dconf

(Note: ~/ points to your home directory, eg. /home/yourname/)

You will also need to edit another file if you plan on using the latest
version of the services file supplied at the PTlink coder website:
~/services/etc/services.conf

(PLEASE NOTE: the services.conf file MUST be in the /etc/ directory, not the
/data directory as stated by some versionf of this tar.gz package)

You can use any editor to edit these files, but vi is strongly recommended because it is resident on ALL unix-based platforms.

After you set up a few simple variables in these files, everything will
be ready and you will be on your way to starting up your own IRC server! :)

#######################################
###############IRCD.CONF###############
#######################################

Let us begin with the ~/ircd/etc/ircd.conf file, the main IRCD configuration
file which specifies various lines which contribute to a lot of the functions
accessible in the actual IRCD itself.

To start with, I will list the lines you need to edit respectively in relation
with the example.conf and ircd.conf files already in the package when you
first install (make install) the server.

(note: once again, all of the paths stated in this documentation are to be
used with the default CONFIGURATION file settings in the ircdxx.tar.gz file)

M-Lines (servername, server bind settings)
SYNTAX:
M:ServerName:bindaddress:Server Description
EXAMPLE:
M:something.mydomain.org:something.mydomain.org:Description of my server

A-Lines (administrative information)
SYNTAX:
A:AdminDescription: :ListOfAdmins
EXAMPLE:
A:Description of Server Admin Status: :Nickname of Server Admin
(note: you can have spaces in each field separated by : characters, but you cannot include extra : characters in the Line itself)
(note: the nickname of the server admin is usually one word, or numerous words if there are numerous admins separated by commas)

(note: you can skip past the Y-Lines, .include lines, and I lines from this point and use the pre-existing lines already given to you, but if you must change them, read the documentation included already with the file given to you)

O-Lines (Operator inclusions)
(note: These lines are very important, so please pay attention!)
SYNTAX:
O:DOMAIN:PASSWORD:NICKNAME:OPERATOR FLAGS
EXAMPLE:
O:*@*:encrypted password:adminuser:O:3:cN

(VERY IMPORTANT NOTE: for encrypting passwords, please run the mkpasswd utility packaged with the PTlink IRCD:
type ~/ircd/mkpasswd, and you will be prompted for a plaintext password, enter the password and it will return an encrypted string to you for you to use in the ircd.conf file
)

Here are some examples for what to type in the DOMAIN section of the O-Line.
 *!*@*.host
 *!*@domain
 *!*user@*.host
 *!*user@domain

All of the O-Line flags are given to you already in the ircd.conf file.

(note: you can skip the K-Line and R-Line configuration for now unless you have troublesome users already attacking you out of nowhere :))
(note: skip past the L-Lines and H-Lines for now too unless you are doing a configuration which allows other servers to connect to you)

P-Line (allowable port definition)
SYNTAX:
P:codepage:bind_ip:options:port_number
EXAMPLE:
P::[::1]::6667 (for IPv6)
P::::6667 (regular and most commonly used)

(note: you can skip D-Lines, d-lines and U-lines for now, because these specify dump patterns and server clusters for interpolation of k-lines and other features spread across different servers)
(note: you can skip past Q lines and X lines for now as well, because these specify quarantine's for nicknames and definitions for SPAM recognition)

C/H/N - Lines (Services Configuration)
(NOTE: THESE LINES ARE THE SOME OF THE MOST IMPORTANT LINES IN THE CONFIGURATION FILE!)

Here we come to interpolation of services, if you have also downloaded the server package. Here is a simple example to follow, noting the services.something.org strictly. It is better to keep services the same here for all servers to make connection run more smoothly.

H-Lines allow the hub to connect, C-lines allow you to connect to the services server, and N-Lines allow the services server to connect to you. The number 51 in the end is a simple services connect flag used universally if you downloaded PTlink services from the http://www.ptlink.net website.

THE THREE EXAMPLES YOU NEED TO FOLLOW:
H:*::services.mydomain.org
C:127.0.0.1:servpass:services.mydomain.org::51
N:127.0.0.1:servpass:services.mydomain.org::51

Now, you are done with configuring the ircd.conf file!!! Congratulations are in order now. Go and get some food and celebrate with your friends, throw a party, go crazy! This was the hardest file to configure, and its done.

##########################################
################MAIN.DCONF################
##########################################


The next file to configure is the ~/ircd/etc/main.dconf file. This file configures the inclusion of the ~/ircd/etc/network.dconf file as well as some other general server properties resident on your newly downloaded IRCD.

For the sake of a quick configuration, I will go over the only lines you need to change to make the server work for you.

All you need to make sure of in this file to ensure the IRCD works is the line:
.include network.dconf

This allows the network.dconf file to be included when the server restarts each time, allowing for a wider range of network configuration options.

###########################################
###############NETWORK.DCONF###############
###########################################

Now you need to configure your ~/ircd/etc/network.dconf file. Most of these options are simple preferences of choice, and only a few are really needed to get your server IRCD working properly. Note that we have not gone into actual service configuration except for the C/H/N lines in the ircd.conf file yet. This will be coming up shortly.

NetworkName   "something.mydomain.org"

(note: the servername variable is extremely important and is specified in the M,C,N,H, and NetworkName lines so far of in your configuration files. Keep in mind that if somethign does not work later, make sure to check that all of your server names are the same, with the exception of the C and N lines, which should generally be services.yourdomain.org)

RandomHost "something.anotherdomain.org"

This line is to be specified if your server address does not work and/or is full. This can sometimes be useful for overflowing users from one server into another server while all the servers are linked together.

ServicesServer "services.mydomain.org"

This line is important for services, as it connects the services to the server and makes them truly functional. Make sure this name matches your C and N lines in your ircd.conf file!

IRCopsForAll            YES

This line is included in this documentation simply because it may be a security compromise, allowing users to see all available online opers. You should probably enable it however, to allow users maximum functionality and leeway.


YOU ARE NOW DONE WITH CONFIGURING YOUR IRCD to work independently without services. If you are sure you do not want your IRCD to work with services, then you may skip the remaining section. If you installed PTlink services from the .tar.gz file and want to continue, read on!


###########################################
###############SERVICES.CONF###############
###########################################

This file contains what your services need to function properly. If configured properly, they are completely compatible with the PTlink IRCD. Here is how to configure it.

RemoteServer 127.0.0.1 6667 "servpass"

This line contains what you need to essentially connect. 127.0.0.1 should match your C and N lines in your ircd.conf file. the port number listed here should match your P::::6667 (default) P-Line listed in your ircd.conf file. The password string "servpass" is the default password and should also match your C and N lines listed in your ircd.conf file.

You do not need to enable LocalAddress unless you have a multihomed host, and enabling this may cause slight problems with recognition. Do not enable this unless you know what you are doing, as it may mess up your service's ability to connect.

ServerName      "services.mydomain.org"

This servername variable occurs AGAIN! See how important it is? This variable MUST be the same as all of the previous discussions we have had about it, and should not differ fron the previous times we have had to enter it in!

###################################
#########DONE CONFIGURING!#########
###################################

Now you should be ready to give the server a test run! Here is what to do to enable it to run. These commands are to be run from the command line.

type ~/ircd/ircd
then type ~/services/bin/services

You should see acknowldgement echo messages after you type in each line here, and your server should be up and running and you should even have services join your server. A good way to test your server is to download an IRC client, most probably X-Chat if you are using Linux or mIRC if you are using a win32 machine to test your server.

After you enter your server, to test to see if the services are in there, type /whois chanserv. This will tell you if the nick ChanServ exists in your IRCD cache. If it does, it will give information about ChanServ, one of the services provided with PTlink services.

If by now you are unable to get your services working properly, and have thoroughly read through all of the documentation listed here, please read the file ~/services/data/logs/services.log and see this file for more information as to why your services cannot connect. Entries in this log file are listed periodically each time you try to connect them to your server.

After you have started your server for the first time, you may want to restart it or shut it down. To do this, you can simply type the following at the command line:
kill `cat ~/ircd/ircd.pid`
to kill the IRCD, and
kill `cat ~/services/etc/services.pid`
to kill the Services. 

These commands kill the PID (process IDs) from your Linux server and allow the server to shut down. to restart them, simply type
~/ircd/ircd
to start the IRCD, and
~/services/bin/services
to start the Services!

I hope that this documentation helps you have a truly wonderful experience with the PTLink server. If you have any questions, be sure to visit irc.ptlink.net under port 6667 (irc.ptlink.net:6667) and goto channel #PTC
