Software versions used:
· Apache version 1.3.20
· CVSWebNT version 1.93g
· CVS server 1.11.1.1 (build 27)
· Activestate Perl 5.6.1. (“ActivePerl”as it’s now called)
Notethat the above may not be the latest available, but were the ones used in thisinstallation
The Apache server can be used very easilyin place of the various flavours ofIIS, usually installed as part of NT server and Windows 2000 server, optionally2000 Workstation. IIS has a potted historyof security weaknesses, and unless you want to continually patch it, or youneed any unique features that it provides, such as per directory authenticationusing NTFS permissions, then Apache is probably your simpler and more securebet. You can install Apache in NT/2000server or workstation, I use 2000 Workstation as a test environment beforemoving to an NT server – installation and configuration are the same.
Read the Windows – specific Apachedocumentation after you install it – there are some useful things in there!
Also read the information on devguy at
TCP/IP Port 80 isnow free for Apache.
Apache is currently configured through 1file called httpd.conf
In the text below, I use localhost
Internal Server Error
You need
Use Apache help files to help you do yourbasic configuration.
Remember
In httpd.conf, you need to set:
That’s all you need to do for a basicconfiguration. You should read up someof the Apache documentation on security, my brute force approach was to securethe whole site – see below.
The above is all you have to do to makeApache work in its default mode, out of the box. If you type http://localhost inyour web browser now, you’ll see the Apache documentation which now forms thedefault website on your machine. If yousee some Microsoft IIS stuff, then you’ve not disabled IIS.
Download and install ActivePerl fromActivestate.
I suggest you install it in the defaultc:\perl and add that to your path (must be in the path), as most of thedocumentation and many scripts come configured for this.
Remember, if you need to change the SYSTEMpath (not your own path – there are 2 listings for environment variables inWinNT/2000), it will only take effect after logout and logging back in onWindows 2000, or reboot.
You may need to edit any script that runs on this server, including CVSwebNT, so that itcan find your installation of Perl. Youdo this by editing the "hash-bang" line at the beginning of thescript as follows:
Scripts often come with the Unix default:
#!/usr/bin/perl
For the NT/Win2k installation I describe,change it to:
#!/perl/bin/perl
Find the printenv.pl
http://localhost/cgi-bin/printenv.pland you should see a listing of your environment in your browser if perl andApache are running OK together.
So you’ve now got Apache working with Perl,time to try out CVSWebNT. I installedcvsweb in a separate cgi-bin directory as I like to see related things in 1place. I keep cvsweb.conf in thatdirectory to keep related things together.
You can leave
c:\programfiles\apache group\apache\www
as my root, so I set
DocumentRoot"C:/Program Files/Apache Group/Apache/www"
And I have my index.htm(homepage) there. It’s always advisableto put a basic index.htm file in all subdirectories below this, in case someonehits on a directory by luck, for which Apache will by default serve up a fulldirectory listing. With index.htm inthere, it will serve that up instead of a directory listing - it can be a blankor redirect page. Also see “security”below – you can globally disable directory listings if you want, and this maybe easier and more secure if you never want a directory listing anywhere on theweb server.
There are no changes specifically necessaryfor Apache vs. IIS in cvsweb.conf.
In cvsweb.cgi, youwill need to point the script to your .conf
Follow the instructions listed in thecvsweb readme file, which are summarized as follows. There are moreinstructions in the readme, these are the basics:
%CVSROOT = (
'Development' => 'c:/cvs/na',
'Admin' => 'c:/cvs/admin'
);
And also change the next line which specifiesthe default repository name to use.
#$ENV{'PATH'} = '/usr/local/bin';
Remove the leading
$ENV{'PATH'} .= 'c:/cvsbin;c:/rcsbin';
but it may be better to just make sure that the rcs tools and cvs.exe are inthe SYSTEM path. Problems have been known to happen with the former solution.
$config =$ENV{'CVSWEB_CONFIG'} || 'c:/program files/Apachegroup/Apache/cgi-bin/cvsweb/cvsweb.conf';
For the icons, you can use Apache’s own, orthe ones that come with cvsweb.
Perhaps the easiest way to protect yoursite, and keep the various worms out, is to set
AllowOverrideAuthConfig
in the httpd.conf
I put a .htaccess fileright in the root of my site at
C:\Program Files\Apache Group\Apache\www
With the contents:
AuthUserFile "/Program files/Apache group/Apache/password"AuthType Basic
AuthName "Richard's Laptop!"require valid-user
and as it works recursively, this protectsthe whole site. For simple requirements, you can manage the password file manually,but if you want to get fancy, there are various 3rd party access andauthentication managers that you can get to manage the password file, such aselite cgi’s “Account Manager” at
There are methods for protecting individualtrees in CVS using NTFS file permissions etc, but this is not really practicalfor a website running Apache – that’s when you might reconsider IIS.
If you want to prevent people from surfingthe directories available to your webserver, (other than those designed intoscripts or webpages) add a – in front of indexes as shown below in httpd.conf:
Options -Indexes FollowSymLinks MultiViews
So for example, users trying to get to saythe contents of http://localhost/images/
Forbidden
You don't have permission to access /images/ on this server.Apache creates large text based logfiles,
REM cleanup Apache logsnet stop apache
c:\utils\dos\horst\logtrim C:\Progra~1\Apache~1\Apache\logs\error.log 1000 1000c:\utils\dos\horst\logtrim C:\Progra~1\Apache~1\Apache\logs\access.log 1000 1000
net start apache
This only takes a couple of seconds torun. You may want something moresophisticated to cycle log files monthly, for example.
Analog is an excellent tool to produce anHTML report based on logfile content. One could automate an analog session to create monthly HTML reports,then delete the raw log files.