Extract source code files from 3proxy.tgz (with WinZip or another utility). Use nmake /f Makefile.msvc command
See How to compile 3proxy with Visual C++ Use Makefile.intl instead of Makefile.msvc
Extract source files from 3proxy.tgz (for example with tar -xzf 3proxy.tgz command if you have tar installed) Use make -f Makefile.win command. If you want to use POSIX emulation Cygwin library (normally you shouldn't) - use make -f Makefile.unix instead. Windows specific things (like installing as service) will not be available if compiled with Cygwin emulation.
Use make -f Makefile.unix. On BSD derivered systems make sure to use GNU make, sometimes it's called gmake instead of make.
Compilation is tested under FreeBSD/i386, NetBSD/i386, OpenBSD/i386,
RH Linux/Alpha, Debian/i386, Gentoo/i386, Gentoo/PPC but you shouldn't
have problems under different BSD or linux compatible systems.
For different systems you may be required to patch Makefile or even source codes.
If you want to use ODBC support, make sure to install ODBC for unix, remove -DNOODBC
option from makefile and add ODBC library to linker variable.
See How to compile 3proxy with GCC under Unix/Linux, use Makefile.ccc instead of Makefile.unix.
Unpack 3proxy.zip to any directory, for example c:\Program Files\3proxy. If needed, create directory for storing log files, ODBC sources, etc. Create 3proxy.cfg in the 3proxy installation directory (See Server configuration). Add
servicestring into 3proxy.cfg. Now, start command prompt (cmd.exe). Change directory to 3proxy installation and run 3proxy.exe --install:
D:\>C: C:\>cd C:\Program Files\3proxy C:\Program Files\3proxy>3proxy.exe --installNow, you should have 3proxy service installed and running. If service is not started, remove "service" string from 3proxy.cfg, run 3proxy.exe manually and correct all errors.
To remove 3proxy run 3proxy --remove:
D:\>C: C:\>cd C:\Program Files\3proxy C:\Program Files\3proxy>net stop 3proxy C:\Program Files\3proxy>3proxy.exe --removeNow you can simply remove 3proxy installation directory.
Unpack 3proxy.zip to any directory, for example c:\Program Files\3proxy. If needed, create directory for storing log files, ODBC sources, etc. Create 3proxy.cfg in the 3proxy installation directory (See Server configuration). Remove string
servicefrom 3proxy.cfg and add
daemonif you want 3proxy to run in background. Create shortcut for 3proxy.exe and place it in autostart or add to registry with regedit.exe:
Complie 3proxy (see Compilation). Copy executables to any appropriate location (for example /usr/local/3proxy/sbin for servers and /usr/local/3proxy/bin for utilities). Create /usr/local/etc/3proxy.cfg. (see Server configuration). You can change default configuration file location by specifing configuration file in 3proxy command line. Add 3proxy to system startup scripts.
Server configuration example 3proxy.cfg.sample is in any 3proxy distribution.
3proxy can log to stdout, file, ODBC datasource and syslog (Unix/Linux/Cygwin only). For using ODBC under Unix/Linux you must compile 3proxy with Unix ODBC libraries, see Compilation. You can control logging from 3proxy.cfg for all services or you can control logging of individual service, for example /usr/local/sbin/socks -l/var/log/socks.log starts SOCKS proxy with logging to file. For universal proxy (3proxy) log file rotation and archiving is supported. Log type is defined with "log" configuration file command or with -l switch on individual service invokation. log or -l is stdout logging.
log filenameand
-lfilenamespecify filename for logging
log @identand
-l@identspecify ident for syslog logging
log &connstringspecifies ODBC connection string, connstring is in format datasource,username,password (2 last are optional of datasource does not require or already has authentication information). Also, you must specify logformat to build SQL query, to insert recod into log, see How to setup logging format
Rotation and archiving may be set up with log, rotate и archiver commands
log filename LOGTYPEsets rotation type. LOGTYPE may be:
rotate NUMBERspecifies number of files in rotation (that is how many files to keep).
archiver EXT COMMAND PARAMETERSSets external archiver. EXT is extention of archived files (for example zip, gz, Z, rar etc) COMMAND and PARAMETERS are command to execute and command line PARAMETERS. Originale file is not deleted by 3proxy, this work is left for archiver. You can pass original filename to archiver with %F macro and archive filename with %A. Examples are located in 3proxy.cfg.sample
Since 0.3 version log format may be set with "logformat" command. First symbol of log format specifies format of date and time and should be L (LOCAL) or G (GMT - Grinwitch Meridian Time). Format string may contains some macro substitutions:
logformat "L%t.%. %N.%p %E %U %C:%c %R:%r %O %I %h %T"generates something like
1042454727.0296 SOCK4.1080 000 3APA3A 127.0.0.1:4739 195.122.226.28:4739 505 18735 1 GET http://www.security.nnov.ru/ HTTP/1.1
(no line breaks)
If ODBC used, logformat should specify SQL command, to insert record into log, for example
logformat "GINSERT INTO proxystat VALUES (%t, '%c', '%U', %I)"
(no line breaks)
3proxy is distributed in 2 variants: as a set of standalone modules (proxy,
socks, pop3p, tcppm, udppm) and as universal proxy server. These services are
absolutely independant, and if you use 3proxy you needn't any of standalone
modules.
Standalone modules are only configurable via command line interface while
3proxy uses configuration file. Many functions, such as ODBC logging, log
rotation, access control, etc are only available in 3proxy, not in standalone
proxies.
Standalone module may be started from command line, for example:
$/sbin/socks -l/var/log/socks.log -i127.0.0.1Starts SOCKS server binded to localhost ip, port 1080 with logging to /var/log/socks.log. You can get help for any standalone service with -? command line option.
If 3proxy is used you should start all services in 3proxy.cfg file. 3proxy.cfg is executed by 3proxy as a batch file. Example of 3proxy.cfg and command syntaxys can be found in 3proxy.cfg.sample.
log /var/log/3proxy.log D rotate 30 internal 127.0.0.1 external 192.168.1.1 proxy socks -p3129 pop3pStarts 3 services: HTTP PROXY, SOCKS and POP3 PROXY. Each listens localhost interface with default port (3128 for HTTP, 1080 for SOCKS and 110 for POP3P) except socks started with port 3129. All logs are in file /var/log/3proxy.log (with daily date modification and rotation). 30 last files are stored.
Latest version of 3proxy may be obtained here. New version may have changes and incompatibilities with previous one in files format or commands. Please, read CHANGELOG file and another documentation before installing new version.
If installed as system service, 3proxy understands Windows service commands for START, STOP, PAUSE and RESUME. If service is PAUSEd, no new connections are accepted while older connections are processed. Currently there is no support for dynamic configuration change, so, you have to restart service completely if you have changed any configuration. You can control 3proxy service via "Services" administration ot via "net" command:
net start 3proxy net stop 3proxy net pause 3proxy net continue 3proxy
Ask it in 3proxy phorum. Don't try to ask something you just misunderstood this How To, because you do not get better answer.
$Id: howtoe.html,v 1.7 2005/04/25 13:58:19 vlad Exp $