c2217fe686d2ce80e30a6958f5dc707143338128
[citadel.git] / citadel / docs / install.txt
1
2                       Citadel/UX Installation Procedure
3                  See copyright.txt for copyright information
4  
5  
6  OVERVIEW
7  
8    Citadel/UX is an advanced, multiuser, client/server, room-based BBS
9 program.  It is designed to handle the needs of both small dialup systems and
10 large-scale Internet-connected systems.  It was originally developed on an
11 Altos system running Xenix, and has been installed and tested on various
12 Unix and Unix-like platforms.  The author's current development environment
13 (and BBS) is a Linux/GNU system.  The current distribution includes:
14   
15     - The Citadel/UX server (this is the back end that does all processing)
16     - A text-based client program designed with the traditional Citadel "look
17       and feel" (room prompts, dot commands, and the like)
18     - A networker that can share rooms and email between multiple systems.
19       Replication can be performed via TCP/IP or any external transport.
20     - Setup programs
21     - A rich set of utilities for system administration and maintenance
22     - Documentation
23  
24  Some knowledge of the Unix system is necessary to install and manage the
25 system. It is preferable that the sysop have superuser access to the operating
26 system. The following are required to install Citadel/UX:
27
28     - A Unix operating system (Linux, BSD, Solaris, DEC Unix, etc.)
29     - C compiler (such as gcc or egcs) and "make"
30     - POSIX threads
31     - TCP/IP
32     - The "gdbm" record manager
33     - Enough disk space to hold all of the programs and data
34  
35  If you are running Citadel/UX on a Linux system, it is STRONGLY recommended
36 that you use a version based on glibc v2 (also called libc6).  libc5 contains
37 a number of thread safety problems.  Furthermore, most modern Linux
38 distributions have libc6, pthreads, gdbm, and the compiler already installed
39 and integrated for you.
40   
41     
42  NOW AVAILABLE:
43  
44     - "WebCit", a gateway program to allow full access to Citadel/UX BBS's
45       via the World Wide Web.  Interactive access through any Web browser.
46   
47  COMING SOON: 
48   
49     - Newer and better GUI based clients.
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/citadel) and the
77 shell should be either "citadel" in that directory, or a script that will start
78 up citadel (you may wish to set up an external text editor; see below).
79 Example:
80  
81  bbs::100:1:BBS Login:/usr/citadel:/usr/citadel/citadel
82   
83  When you run setup later, you will be required to tell it what the BBS
84 login's numeric user ID is, so it knows what user to run as.  If you create
85 an account called bbs, guest, or citadel, the setup program will automatically
86 pick up the user ID by default.
87
88   For all other users in /etc/passwd, Citadel will automatically set up an
89 account using the "full name" field. No password is required, since it
90 assumes that if a user is logged in, he/she has already entered a password.
91 Note that this does have to be enabled at compile time (see ENABLE_AUTOLOGIN
92 in the Makefile).  If such an account needs to be accessed remotely (such as
93 from client software), these users can use *either* their Citadel login name
94 or their login name on the host computer, and their password on the host
95 computer.
96    
97   
98  COMPILING THE PROGRAMS
99    
100  
101    You can easily compile Citadel with the following commands:
102  
103    ./configure
104    make
105    make install
106  
107    The 'configure' script will generate a Makefile from the Makefile.in, and
108 it will also write the file "sysdep.h" to your Citadel directory.  Please do
109 not edit sysdep.h or Makefile.in yourself.  The configure script will figure
110 out your system dependencies and set everything correctly.
111  
112    By default, the Citadel system will install in /usr/local/citadel.  If you
113 wish to place it in a different directory, you can instead do:
114  
115    ./configure --prefix=/opt/citadel      (or whatever)
116    
117   
118    File permissions are always a bother to work with. You don't want the
119 board to crash because someone couldn't access a file, but you also don't
120 want shell users peeking into the binaries to do things like reading others'
121 mail, finding private rooms, etc.   The Citadel server needs to be started
122 as root in order to bind to a privileged port, but as soon as its
123 initialization is finished, it changes its user ID to your BBS user ID in
124 order to avoid security holes.
125   
126     
127  THE CITADEL.RC FILE
128  
129  This is a change from the way things were done before.  All client-side setup
130 is in a "citadel.rc" file.  The standard client looks for this file in:
131  1. $HOME/.citadelrc
132  2. /usr/local/lib/citadel.rc
133  3. <compiled BBSDIR>/citadel.rc
134  
135  The next couple of sections deal with client-side configuration.
136  
137  USING AN EXTERNAL EDITOR FOR MESSAGES
138  
139  Citadel/UX has a built-in message editor.  However, you can also use your
140 favorite text editor to write messages.  To do this you simply put a line in
141 your citadel.rc file like:
142
143 editor=/usr/bin/vi
144  
145  ...would make Citadel call the vi editor when using the .<E>nter <E>ditor
146 command.  You can also make it the default editor for the <E>nter command by
147 editing the citadel.rc file.  (WARNING: external editors on public systems
148 can create a security hole.  Make sure there is absolutely no way for users
149 to drop into the shell from the editor, or save files other than the temp file
150 they are editing!)
151
152  Using this mechanism, shell users can pick their favorite editor for Citadel.
153 BBS users can use external editors too; just have the bbs login call a script
154 that sets the variables and then calls citadel.  I used to recommend using
155 an external editor as the default, but the built-in editor is now a bit more
156 robust, so the use of an external editor is definitely optional.  By the
157 way, be VERY careful what editor you choose and how you set up its options.
158 Giving the general public to an editor like vi or emacs can open up lots of
159 security holes.
160
161
162  PRINTING MESSAGES
163  
164  Citadel/UX can send messages to a printer, or just about anywhere else in
165 your system.  The variable PRINTCMD in citadel.rc specifies what command you
166 use to print.  Text is sent to the standard input (stdin) of the print command.
167  
168  So if you did this:
169  
170 printcmd="nl|pr|lpr -dlocal"
171  
172  ...that would add line numbers, then paginate, then print on the printer
173 named "local".  There's tons of stuff you can do with this feature.  For
174 example, you could use a command like "cat >>$HOME/archive" to save copies
175 of important messages in a textfile.
176
177
178 URL VIEWING:
179
180 urlcmd=netscape -remote "openURL(%s)"
181
182 ...that would mean that typing 'u' in a room prompt after seeing a url in
183 one of the room's messages netscape will open up for you and run that url.
184
185  SETUP AND LOGIN
186   
187    Before logging in for the first time, you must run the setup program.  Type
188 "./setup" to begin this procedure.
189  
190    The setup program will ask you what directory to place your data files in.
191 You can use this functionality to keep your programs and data in different
192 directories, or to run more than one BBS on the same computer.  If you don't
193 use the default directory (the one specified in the Makefile), remember to
194 specify the directory name again when you start up the server later on.
195    
196    If you've used older versions of Citadel/UX before, you'll notice that the
197 setup program does much less than it did before.  It won't create any empty
198 data files; that's now done automatically by the server the first time it
199 starts.  It also asks only a few questions; that's because the rest of the
200 global configuration is now done from within Citadel.
201   
202       
203  PREPARING TO START THE SERVER
204   
205    The files /etc/services and /etc/inittab must be modified in order to run
206 the Citadel server.  The setup program will perform the correct modifications
207 for you if you allow it to.  If you'd prefer to do it manually, or if you're
208 interested in what these modifications are, then read on...
209  
210    Before you can use Citadel, you must define the "citadel" service to your 
211 system.  This is accomplished by adding a line to your /etc/services file that
212 looks something like this:
213  
214  citadel                504/tcp                 # Citadel/UX Server
215    
216  504 is the port number officially designated by the IANA for use by Citadel. 
217 There should not be any need to use a different port number, unless you are 
218 running multiple BBS's on the same computer and therefore need a different
219 port for each one.
220  
221   The next step is to arrange for the server to start.  The "citserver"
222 program is the main Citadel server.  Before we cover the recommended method of
223 starting the server, let's examine its usage options:
224  
225  citserver [-hHomeDir] [-xDebugLevel] [-tTraceFile] [-d] [-f]
226  
227  The options are as follows:
228  
229  -hHomeDir     - the directory your BBS data files live in.  This should, of
230 course, be a directory that you've run the "setup" program against to set up
231 some data files.  If a directory is not specified, the directory name which
232 was specified in the Makefile will be used.
233  
234  -xDebugLevel  - Set the verbosity of trace messages printed.  The available 
235 debugging levels are:
236     1 - Internal errors (failed thread creation, malloc problems, etc.)
237     2 - Network errors (broken sockets, failed socket creation)
238     3 - Begin and end of sessions, startup/shutdown of server
239     5 - Server commands being sent from clients
240     7 - Entry and exit of various functions 
241     8 - Entry and exit of critical sections
242     9 - Various debugging checkpoints (insanely verbose)
243   
244  -tTraceFile   - Tell the server where to send its debug/trace output.  
245 Normally it is sent to stdout.
246  
247  -d            - Run as a daemon.  This switch would be necessary if you were 
248 starting the Citadel server, for example, from an rc.local script (which is 
249 not recommended, because this won't allow the server to automatically restart
250 when it is shut down).
251  
252  -f            - Defragment all the databases upon startup.  This isn't
253 normally necessary due to the nature of the data stored in Citadel, but the
254 option is provided in case you need it.
255  
256  
257    The preferred method of starting the Citadel server is to place an entry in
258 your /etc/inittab file.  This will conveniently bring the server up when your 
259 system is up, and terminate it gracefully when your system is shutting down.  
260 The exact syntax for your system may vary, but here's the entry that I use on 
261 my Linux system:
262   
263  cit:2345:respawn:/appl/citadel/citserver -h/appl/citadel -t/dev/tty6 -x3
264  
265  What I've done here is to set debugging level 3, and have the trace stuff
266 output to one of my virtual consoles.  It's important to remember to turn off
267 any getty that is set up on that virtual console, if you do this.  After
268 making this change, the command "init q" works on most systems to tell init
269 to re-read the file.  If in doubt, just reboot your computer.
270    
271    
272  LOGGING IN FOR THE FIRST TIME
273    
274    At this point, your system is ready to run. Run the citadel program from
275 the shell and it will automatically create your account.  NOTE: the first
276 user account to be created will automatically be set to access level 6
277 (Aide).  This overcomes some obvious logistical problems - normally, Aide
278 access is given by another Aide, but since there aren't any on your system
279 yet, this isn't possible.
280     
281    
282  SPACE FOR ADDING YOUR OWN FEATURES (doors)
283  
284    *** PLEASE TAKE NOTE!! ***   This function really represents the "old"
285 way of doing things, and it doesn't fit in well with the client/server
286 paradigm.  Please consider it "deprecated" because it may be removed at any
287 time.
288  
289    The "doorway" feature is just a generic way to add features to the system.
290 I called it "Doorway" to make it resemble the doors on non-Unix boards, but as
291 we all know, us Unix types don't have to write special code to access the
292 modem. :-)  Anyway, when a user hits the <*> (doorway) command, Citadel does...
293  
294    USERNAME=<username>; export USERNAME
295    ./subsystem <user number> <screen width> <access level>
296  
297    ...so you can put whatever you want in there.  I suggest putting in a menu
298 program to allow the users to pick one of a number of programs, etc.
299  
300    Do be aware that chat and door programs will only be available when two
301 conditions are met:
302  
303     1. The client and server programs are running on the same computer
304     2. The user is running the text-based Unix client.
305  
306    Because of these restrictions, Door programs are being utilized less and
307 less every day.
308  
309
310   
311  
312  THE PEANUT GALLERY
313   
314    That's just about all the information you need to install the system.
315  For more information, visit the Citadel/UX web site at UNCENSORED! BBS
316  http://uncnsrd.mt-kisco.ny.us
317  
318    Please note: if you intend to report a problem getting the Citadel server
319 to run, please first check the following:
320  
321  1. Did you do ./configure && make && make install  ??
322  2. Did you run setup?
323  3. Did you start the server?
324  
325    To report a problem, you can log on to UNCENSORED! or any other BBS on the
326 Citadel network which carries the Citadel/UX> room.  Please remember to mention
327 all of the following information:
328  
329  1. The exact nature of your difficulty
330  2. A transcript of the error message(s) if possible
331  3. The version of Citadel you are running
332  4. The version of GDBM present on your system
333  5. Which operating system you are running, and what version
334  6. If you are running a Linux system, we need to know which distribution, and
335 the version of the kernel, libc, and pthreads you are using (it would help to
336 post the output of a "ldd ./citserver" command).
337
338