📄 readme.1st
字号:
** [ Open in an editor that does not word wrap to view this file the best ] **
FreeChat for Windows NT
-----------------------
If you plan to compile this yourself, which will be an easy task once you
follow the step by step instructions, you must first obtain a copy of Cygwin32.
This can be found at www.cygnus.com. I used the b18 version, earlier versions
may work and later versions should work. The Cygwin32 project actually allows
very simple ports from UNIX to NT. The common gcc compiler is included along
with make and other utilities to help ease the process.
There are a lot of Chat clients, out there, and many in Perl, but this one
seems to take a lot less overhead and improves system security (since Perl
isn't needed). I personally have no problem with Perl but I know a lot of
System Admins that won't even allow Perl on their boxes. So FreeChat for NT
to the rescue! Until now only those with a UNIX system was able to use the
code, but now anyone running NT 4.0 should be able to use this. One note, in
the early beta testing of the NT version it DID NOT work with IIS 2.0 or 3.0.
It only has been tested with Netscape Enterprise Server 3.0. Please take this
as a warning but feel free to get it to work with whatever Web Server software
you can, and let us know!
Enough of the intro, let's see what lies ahead of us.
What if I just want to use the binaries as is?
- If you don't want to compile anything and just want to run the code as is
that should be fine too. You must set the following up.
(Assuming Enterprise Server 3.0)
C:\chat --> virtual directory in web server as /chat
C:\cgichat --> cgi-directory (not win-cgi) in webserver as /cgichat
Copy the chat files and directories into the newly created chat directory and
do the same from cgichat. In order for the binaries to work you MUST copy
cygwin.dll into your Windows\System32 directory manually.
You MUST install it exactly as above or else it will not work. The compiled code
looks for these directories and if you do not have them the program will not work!
Future releases will include a configuration file in which the compiled code will
access for the drive and directory system.
Okay, I want to customize it to meet my server needs...
Step 1: Download cygwin32 from http://www.cygnus.com/misc/gnu-win32, be sure to
grab the ~14MB exe file in the b18 directory. Install it on your system
and be sure to read the setup instructions. You'll have to add some
information to your path as well as set up some other settings in your
environment. Works like a charm on both NT and Windows 95 platforms.
You also need to set up (on your C: drive a tmp and a bin directory).
You'll need to copy sh.exe (included in the cygwin32 installation), it
should be in a directory such as
<install drive>:\gnuwin32\b18\H-i386-cygwin32\bin
into the C: bin on your system. Look at the included readme file included
with the Cygwin32 program for better details.
Step 2: Run your favorite ZIP extraction program, just make sure whatever program
you use supports long file names and preserves directory structure. Just
unzip to your C:\ drive's root. Or you can unzip to any other drive root
you want to. This will extract two main directories at this level, chat
and cgichat. Within each you will get more subdirectories and files. The
source code is found in the <DRIVE>\chat\src directory.
Step 3: Changes: (Drive letter of your choice should be substituted in place of X:
as shown in examples. Actual drive letters in included source code is C:,
change to the drive you wish to use.
The included C source files are: cgi-util.c, whattime.c, showfuture.c, readline.c,
random.c, nicetime.c, myopen.c, leave.c, instr.c, inchat.c, dump.c, copyback.c,
clean.c, chatwrite.c and chat.c
--------
'chat.c'
--------
** Make sure you load up Defines.h and modify the system admin email address first. **
Adjust the PREPEND tag in that same Defines.h file to be your virtual directory
(ie. /chat/), the first and trailing slashes are important.
Line 149: printf("<form action=\"/chatcgi/chat.cgi\" method=\"post\">\n");
Change /chatcgi to the www path to your directory, ie. cgi-bin, etc...
Line 197: printf("/chatcgi/chat.cgi?name=%s&email=%s&password=%s&join=yes&", name, email, password);
Line 201: printf("/chatcgi/chat.cgi?watch=yes&name=%s&email=%s&password=%s\"\n", name, email, password);
Line 207: printf("<a href=\"/chatcgi/chat.cgi?name=%s&email=%s&password=%s\">", name, email, password);
Change /chatcgi to the www path to your directory, the /chatcgi here is optional
Line 221: fdi = open("lock.dat", O_CREAT | O_WRONLY | O_TRUNC);
You may be able to optionally comment this line out, however I left it in when it was tested
223-227: /*#ifdef SYSV
lockf(fdi, F_LOCK, 0);
#else
flock(fdi, LOCK_EX);
#endif*/
Keep these lines commented out, NT does not use this feature
** NOTE: It would be a good idea to use an editor that can do global find and replace operations to help
you easilly locate the drive letter C: and you can replace it with your 'D:' drive or 'E:' etc...
232: fi = myopen("X:/chat/topic.dat", "r");
252: fi = fopen("X:/chat/banned.dat", "r");
354: dump("X:/chat/included/noname.html");
382: fi = fopen("X:/chat/banned.dat", "a");
407: fi = fopen("X:/chat/topic.dat", "w");
428: dump("X:/chat/included/chat-top.html");
432-436: #ifdef AD_CMD
fflush(stdout);
system(AD_CMD);
fflush(stdout);
#endif
In Defines.h file make sure the AD_CMD is NOT defined, it probably will
work but not tested in this release.
454: dump("X:/chat/included/chat-left.html");
460: dump("X:/chat/included/chat-post-top.html");
533: printf("content=\"20;URL=/chatcgi/chat.cgi?watch=yes&");
Here you can change the auto-refresh from 20 to whatever you please, 15-20 is recommended
537: dump("X:/chat/included/chat-watch-top.html");
556: dump("X:/chat/included/chat-left.html");
565: fi = myopen("X:/chat/chat.dat", "r");
749: dump("X:/chat/included/chat-bottom.html");
753: dump("X:/chat/included/chat-watch-bottom.html");
784: fi = myopen("X:/chat/swear.dat", "r");
843: fo = myopen("X:/chat/who.tmp", "w");
851: fi = myopen("X:/chat/who.dat", "r");
941: copyback("X:/chat/who.dat", "X:/chat/who.tmp");
970: printf("<form action=\"/chatcgi/chat.cgi\" method=\"post\">\n");
992: fi = myopen("X:/chat/who.dat", "r");
1036: printf("<a href=\"/chatcgi/chat.cgi?watch=yes&name=%s&email=%s&password=%s&random=%d&time=%s\"
target=\"text\">\n", name, email, password, getpid(), time);
Seems to work fine for me, the getpid() call
1056: printf("<a href=\"/chatcgi/who.cgi?%s\" target=\"text\"><img\n", temp);
1062: printf("<a href=\"/chatcgi/leave.cgi?name=%s\" target=\"_top\"><img\n", name2);
1069: printf("href=\"/chatcgi/chat.cgi?name=%s&email=%s&password=%s", name, email, password);
1191: fi = fopen("X:/chat/convert.dat", "r");
1323: fi = fopen("X:/chat/robot.dat", "r");
1358: void informadmin(char * name, char * mesg)
This functions contents are commented out, again uncommenting should work but was not tested
in this release for NT
-------
'who.c'
-------
49: dump("X:/chat/included/who-top.html");
55: fi = fopen("X:/chat/who.dat", "r");
62: fo = myopen("X:/chat/who.tmp", "w");
109: sprintf(temp, "X:/chat/photos/%s.gif", temp2);
149: copyback("X:/chat/who.dat", "X:/chat/who.tmp");
156: dump("X:/chat/included/who-bottom.html");
-------------
'chatwrite.c'
-------------
32: fo = myopen("X:/chat/chat.logs", "a");
47: fo = myopen("X:/chat/chat.tmp", "w");
58: fi = myopen("X:/chat/chat.dat", "r");
80: copyback("X:/chat/chat.dat", "X:/chat/chat.tmp");
--------------
'showfuture.c'
--------------
37: dump("X:/chat/included/future-top.html");
56: dump("X:/chat/included/future-bottom.html");
---------
'leave.c'
---------
44: fi = myopen("X:/chat/who.dat", "r");
51: fo = myopen("X:/chat/who.tmp", "w");
83: copyback("X:/chat/who.dat", "X:/chat/who.tmp");
88: dump("X:/chat/included/leave.html");
----------
'inchat.c'
----------
29: strcpy(file, "X:/chat/who.dat");
------------
'whattime.c'
------------
NO MODIFICATIONS NEEDED. This was the primary function which had to manually re-created to allow
FreeChat to operated properly under NT.
----------
'random.c'
----------
NO MODIFICATIONS NEEDED.
22: /* #include <sys/timeb.h>*/
Keep commented out, not needed or supported under NT
While SSI should work, it was not testing in this release for NT
And the rest of the files:
'clean.c', 'copyback.c', 'dump.c.', 'instr.c', 'myopen.c', 'nicetime.c', 'readline.c', 'cgi-util.c'
NO MODIFICATIONS NEEDED.
Step 4: Modify HTML files in <drive>/chat
-------
ad.html
-------
1: <head><!meta http-equiv="refresh" content="60;url=/chat/ad.html"></head>
--------------------
on.html & index.html (on.html is actually useless in the NT versions)
--------------------
24: <form action="/chatcgi/chat.cgi" method="post">
--------
off.html (Do not adjust this file as bin/cat will not work, this file is just here as a leftover from
-------- the UNIX version). If you plan to have chat be up only certain times you can either make a cgi
yourself (Perl or C) to use with the #exec cmd tag or just have two HTML files and use those.
future-bottom.html, future-top.html
NO MODIFICATIONS NEEDED
Step 5: Modify HTML files in <drive>/chat/included
------------
who-top.html
------------
2: <meta http-equiv="refresh" content="20;URL=/chatcgi/who.cgi?">
Be sure to keep the ? after who as it is shown, NT (Enterprise Server 3.0) requires this.
"chat-left.html", "chat-post-top.html", "chat-top.html", "chat-watch-bottom.html",
"chat-watch-top.html", "leave.html", "noname.html", "who-bottom.html", "chat-bottom.html"
NO MODIFICATIONS NEEDED
Step 5: Let's compile!
Okay, now that everything is in place, change into your 'chat' directory and type the following command:
make -f makefile
This makefile assumes that chat and chatcgi are both on the same drive and that they are both on the same
directory level. ie. C:\CHAT and C:\CHATCGI or D:\CHAT and D:\CHATCGI or C:\progs\CHAT and C:\progs\CHATCGI...
The makefile also creates CGI files, you may be able to change those to .EXE, but I see no advantage to this and
haven't tested that method out.
You're all set to go! Now pull up your web browser bring up the sign in page and enjoy your FreeChat for NT!
Comments, questions, suggestions? Email Patrick Stepp at stepp@adelphia.net. Enjoy!
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -