9c5e32e83458b2b03e8433477eb68358554cfc2f
[citadel.git] / citadel / install.txt
1                       Citadel/UX Installation Procedure
2                  See copyright.doc for copyright information
3  
4  
5  OVERVIEW
6  
7    Citadel/UX is an advanced, multiuser, client/server, room-based BBS
8 program.  It is designed to handle the needs of both small dialup systems and
9 large-scale Internet-connected systems.  It was originally developed on an
10 Altos system running Xenix, and has been installed and tested on various
11 Unix and Unix-like platforms.  The author's current development environment
12 (and BBS) is a Linux/GNU system.  The current distribution includes:
13   
14     - The Citadel/UX server (this is the back end that does all processing)
15     - A text-based client program designed with the traditional Citadel "look
16       and feel" (room prompts, dot commands, and the like)
17     - A networker that utilizes any file transfer mechanism (such as UUCP for
18       standalone systems, or ftp for Internet) and can share messages with other
19       Citadel/UX systems, as well as UseNet sites.  Gateway software to talk
20       with C86NET (Citadel-86 and its deriviatives), HengeNet (StoneHenge),
21       and NYTI FordBoard is also available.
22     - Setup programs
23     - A rich set of utilities for system administration and maintenance
24     - Documentation
25  
26  Some knowledge of the Unix system is necessary to install and manage the
27 system. It is preferable that the sysop have superuser access to the operating
28 system. The following are required to install Citadel/UX:
29
30     - A Unix operating system (Linux, Solaris, DEC Unix, etc.)
31     - C compiler (such as gcc or egcs) and "make"
32     - POSIX threads
33     - TCP/IP
34     - The "gdbm" record manager
35     - Enough disk space to hold all of the programs and data
36  
37    
38  NOW AVAILABLE:
39  
40     - "WebCit", a gateway program to allow full access to Citadel/UX BBS's
41       via the World Wide Web.  Interactive access through any Web browser.
42  
43     - A point-and-click client program for MS Windows.  (The text-based client
44       is now available for Windows as well.)
45  
46  COMING SOON: 
47   
48     - A client program written in Java that will be portable to all operating
49       systems.
50    
51  
52   
53  EVERYTHING IN ITS PLACE...
54
55    Hopefully you've unpacked the distribution archive into its own directory.
56 This is the directory in which all Citadel files are located and in which all
57 BBS activity will take place. Several subdirectories have already been created
58 during the unpacking process, and others may be created by the software if
59 needed.
60  
61    Make sure you have the "gdbm" record manager installed on your system, and
62 that you have installed the libraries and headers required to compile gdbm
63 programs.  Likewise, if your operating system uses a separate library to
64 support POSIX threads, make sure that library is installed as well.
65    
66   
67  THE BBS LOGIN
68   
69    There will be one account in /etc/passwd which all BBS users will use to
70 login to the system. This account is typically called "bbs" or "citadel" or
71 something to that effect. You will tell Citadel what the user-id of that
72 account is, and when someone logs in under that account, Citadel will prompt
73 for a user name.
74
75 The BBS login should have a unique uid. The home directory should be the
76 one your BBS resides in (in this example we will use /usr/bbs) and the shell
77 should be either "citadel" in that directory, or a script that will start up
78 citadel (you may wish to set up an external text editor; see below).  Example:
79  
80  bbs::100:1:BBS Login:/usr/citadel:/usr/citadel/citadel
81   
82  When you run setup later, you will be required to tell it what the BBS
83 login's numeric user ID is, so it knows what user to run as.  If you create
84 an account called bbs, guest, or citadel, the setup program will automatically
85 pick up the user ID by default.
86
87   For all other users in /etc/passwd, Citadel will automatically set up an
88 account using the "full name" field. No password is required, since it
89 assumes that if a user is logged in, he/she has already entered a password.
90 Note that this does have to be enabled at compile time (see ENABLE_AUTOLOGIN
91 in the Makefile).  If such an account needs to be accessed remotely (such as
92 from client software), these users can use *either* their Citadel login name
93 or their login name on the host computer, and their password on the host
94 computer.
95    
96   
97  COMPILING THE PROGRAMS
98    
99  
100    You can easily compile Citadel with the following two commands:
101  
102    ./configure --prefix=`pwd`
103    make
104  
105    The 'configure' script will generate a Makefile from the Makefile.in, and
106 it will also write the file "sysdep.h" to your Citadel directory.  Please do
107 not edit sysdep.h or Makefile.in yourself.  The configure script will figure
108 out your system dependencies and set everything correctly.
109  
110    File permissions are always a bother to work with. You don't want the
111 board to crash because someone couldn't access a file, but you also don't
112 want shell users peeking into the binaries to do things like reading others'
113 mail, finding private rooms, etc.   The Citadel server needs to be started
114 as root in order to bind to a privileged port, but as soon as its
115 initialization is finished, it changes its user ID to your BBS user ID in
116 order to avoid security holes.
117   
118     
119  THE CITADEL.RC FILE
120  
121  This is a change from the way things were done before.  All client-side setup
122 is in a "citadel.rc" file.  The standard client looks for this file in:
123  1. $HOME/.citadelrc
124  2. /usr/local/lib/citadel.rc
125  3. <compiled BBSDIR>/citadel.rc
126  
127  The next couple of sections deal with client-side configuration.
128  
129  USING AN EXTERNAL EDITOR FOR MESSAGES
130  
131  Citadel/UX has a built-in message editor.  However, you can also use your
132 favorite text editor to write messages.  To do this you simply put a line in
133 your citadel.rc file like:
134
135 editor=/usr/bin/vi
136  
137  ...would make Citadel call the vi editor when using the .<E>nter <E>ditor
138 command.  You can also make it the default editor for the <E>nter command by
139 editing the citadel.rc file.  (WARNING: external editors on public systems
140 can create a security hole.  Make sure there is absolutely no way for users
141 to drop into the shell from the editor, or save files other than the temp file
142 they are editing!)
143
144  Using this mechanism, shell users can pick their favorite editor for Citadel.
145 BBS users can use external editors too; just have the bbs login call a script
146 that sets the variables and then calls citadel.  I used to recommend using
147 an external editor as the default, but the built-in editor is now a bit more
148 robust, so the use of an external editor is definitely optional.  By the
149 way, be VERY careful what editor you choose and how you set up its options.
150 Giving the general public to an editor like vi or emacs can open up lots of
151 security holes.
152
153
154  PRINTING MESSAGES
155  
156  Citadel/UX can send messages to a printer, or just about anywhere else in
157 your system.  The variable PRINTCMD in citadel.rc specifies what command you
158 use to print.  Text is sent to the standard input (stdin) of the print command.
159  
160  So if you did this:
161  
162 printcmd="nl|pr|lpr -dlocal"
163  
164  ...that would add line numbers, then paginate, then print on the printer
165 named "local".  There's tons of stuff you can do with this feature.  For
166 example, you could use a command like "cat >>$HOME/archive" to save copies
167 of important messages in a textfile.
168
169
170  SETUP AND LOGIN
171   
172    Before logging in for the first time, you must run the setup program.  Type
173 "./setup" to begin this procedure.
174  
175    The setup program will ask you what directory to place your data files in.
176 You can use this functionality to keep your programs and data in different
177 directories, or to run more than one BBS on the same computer.  If you don't
178 use the default directory (the one specified in the Makefile), remember to
179 specify the directory name again when you start up the server later on.
180    
181    If you've used older versions of Citadel/UX before, you'll notice that the
182 setup program does much less than it did before.  It won't create any empty
183 data files; that's now done automatically by the server the first time it
184 starts.  It also asks only a few questions; that's because the rest of the
185 global configuration is now done from within Citadel.
186   
187       
188  PREPARING TO START THE SERVER
189   
190    The files /etc/services and /etc/inittab must be modified in order to run
191 the Citadel server.  The setup program will perform the correct modifications
192 for you if you allow it to.  If you'd prefer to do it manually, or if you're
193 interested in what these modifications are, then read on...
194  
195    Before you can use Citadel, you must define the "citadel" service to your 
196 system.  This is accomplished by adding a line to your /etc/services file that
197 looks something like this:
198  
199  citadel                504/tcp                 # Citadel/UX Server
200    
201  504 is the port number officially designated by the IANA for use by Citadel. 
202 There should not be any need to use a different port number, unless you are 
203 running multiple BBS's on the same computer and therefore need a different
204 port for each one.
205  
206   The next step is to arrange for the server to start.  The "citserver"
207 program is the main Citadel server.  Before we cover the recommended method of
208 starting the server, let's examine its usage options:
209  
210  citserver [-hHomeDir] [-xDebugLevel] [-tTraceFile] [-d] [-f]
211  
212  The options are as follows:
213  
214  -hHomeDir     - the directory your BBS data files live in.  This should, of
215 course, be a directory that you've run the "setup" program against to set up
216 some data files.  If a directory is not specified, the directory name which
217 was specified in the Makefile will be used.
218  
219  -xDebugLevel  - Set the verbosity of trace messages printed.  The available 
220 debugging levels are:
221     1 - Internal errors (failed thread creation, malloc problems, etc.)
222     2 - Network errors (broken sockets, failed socket creation)
223     3 - Begin and end of sessions, startup/shutdown of server
224     5 - Server commands being sent from clients
225     7 - Entry and exit of various functions 
226     8 - Entry and exit of critical sections
227     9 - Various debugging checkpoints (insanely verbose)
228   
229  -tTraceFile   - Tell the server where to send its debug/trace output.  
230 Normally it is sent to stdout.
231  
232  -d            - Run as a daemon.  This switch would be necessary if you were 
233 starting the Citadel server, for example, from an rc.local script (which is 
234 not recommended, because this won't allow the server to automatically restart
235 when it is shut down).
236  
237  -f            - Defragment all the databases upon startup.  This isn't
238 normally necessary due to the nature of the data stored in Citadel, but the
239 option is provided in case you need it.
240  
241  
242    The preferred method of starting the Citadel server is to place an entry in
243 your /etc/inittab file.  This will conveniently bring the server up when your 
244 system is up, and terminate it gracefully when your system is shutting down.  
245 The exact syntax for your system may vary, but here's the entry that I use on 
246 my Linux system:
247   
248  cit:2345:respawn:/appl/citadel/citserver -h/appl/citadel -t/dev/tty6 -x3
249  
250  What I've done here is to set debugging level 3, and have the trace stuff
251 output to one of my virtual consoles.  It's important to remember to turn off
252 any getty that is set up on that virtual console, if you do this.  After
253 making this change, the command "init q" works on most systems to tell init
254 to re-read the file.  If in doubt, just reboot your computer.
255    
256    
257  LOGGING IN FOR THE FIRST TIME
258    
259    At this point, your system is ready to run. Run the citadel program from
260 the shell and it will automatically create your account.  NOTE: the first
261 user account to be created will automatically be set to access level 6
262 (Aide).  This overcomes some obvious logistical problems - normally, Aide
263 access is given by another Aide, but since there aren't any on your system
264 yet, this isn't possible.
265     
266    
267  SPACE FOR ADDING YOUR OWN FEATURES (doors)
268  
269    *** PLEASE TAKE NOTE!! ***   This function really represents the "old"
270 way of doing things, and it doesn't fit in well with the client/server
271 paradigm.  Please consider it "deprecated" because it may be removed at any
272 time.
273  
274    The "doorway" feature is just a generic way to add features to the system.
275 I called it "Doorway" to make it resemble the doors on non-Unix boards, but as
276 we all know, us Unix types don't have to write special code to access the
277 modem. :-)  Anyway, when a user hits the <*> (doorway) command, Citadel does...
278  
279    USERNAME=<username>; export USERNAME
280    ./subsystem <user number> <screen width> <access level>
281  
282    ...so you can put whatever you want in there.  I suggest putting in a menu
283 program to allow the users to pick one of a number of programs, etc.
284  
285    Do be aware that chat and door programs will only be available when two
286 conditions are met:
287  
288     1. The client and server programs are running on the same computer
289     2. The user is running the text-based Unix client.
290  
291    Because of these restrictions, Door programs are being utilized less and
292 less every day.
293  
294
295   
296  SETTING UP CITADEL TO SEND AND RECEIVE INTERNET MAIL
297  
298  Mail programs are now elaborate enough that it is trivial to set up Citadel
299 to act as your system's local mail delivery agent.  It couples easily with
300 either sendmail or qmail, or with any other mail system that is capable of
301 invoking a separate program to deliver local mail.
302  
303  Unlike earlier versions of Citadel/UX, there is no longer a need to play
304 with rmail or to patch other pieces of your system's existing mailer.  Simply
305 make a few quick configurations, compile the Citadel/UX package "as is" and
306 you're ready to go.  Here's how to do it:
307  
308  1. First, open up the config file "internetmail.config" in the "network"
309 directory, and edit the definitions in it to your local configuration.  It's
310 very self-documented; just go through the file making any necessary changes.
311
312  2. Next, you must configure your system's main mail delivery agent to
313 use the "citmail" program to deliver mail to local addresses.  This will
314 change from mailer to mailer, of course.  I'm using sendmail, and although
315 I don't know enough about sendmail to provide really good instructions on
316 sendmail configuration, here's what worked for me:
317     
318   I added the following mailer definition:
319   
320  Mcitadel,  P=/appl/citadel/citmail, F=lsDFMoqeu9S, S=10/30, R=20/40,
321             D=$z:/, T=X-Unix, U=bbs,
322             A=/appl/citadel/citmail $u
323  
324   Then I replaced all instances of "#local" with "#citadel".  This seems to
325 work on my system; your mileage may vary.
326  
327  3. Some mailers will need to be killed and restarted for the changes to
328 take effect.  Once this is done, all of your BBS users now have an Internet
329 e-mail address.  They can use two forms of addresses:
330  
331   user_name@your.system.name
332   cit1234@your.system.name
333  
334  In the first form, the name portion of the user's Internet e-mail address
335 is the name they use on your Citadel system, with all spaces replaced by
336 underscores.  In the second form, the name is the letters "cit" followed
337 by the user's user number.  This is a nice shorthand that is sometimes
338 easier to use.  Note that the help file <.H>elp MAIL is set up to tell users
339 what their address is.
340  
341  NOTE: I cannot and will not answer e-mails regarding the configuration of
342 sendmail or any other mailer.  I am not a sendmail expert; what is written
343 above is everything I know about getting Citadel and sendmail to talk to each
344 other.  Please refer these questions to your local sendmail wizard. 
345  
346  
347  
348  THE PEANUT GALLERY
349   
350    That's just about all the information you need to install the system. If
351 you have any comments, suggestions, bomb threats, etc., send them to
352 ajc@uncnsrd.mt-kisco.ny.us or call Uncensored Communications Group BBS at
353 (914) 244-3252 (modem) or uncnsrd.mt-kisco.ny.us (Internet).