Mini Servers: Apache 2.2.9 Perl 5.10 Service: Difference between revisions

From The Uniform Server Wiki
Jump to navigation Jump to search
(New page: {{Uc nav mini servers}} Apache 2.2.9|right'''Mini server 3 running as a service''' This page covers running our mini server (describe on the [[Mini Servers: Apach...)
 
mNo edit summary
Line 1: Line 1:
{{Uc nav mini servers}}
{{Uc nav mini servers}}
[[Image:Uc_mini_3a.gif|Apache 2.2.9|right]]'''Mini server 3 running as a service'''
[[Image:Uc_mini_3a.gif|Apache 2.2.9 Perl 5.10|right]]'''Mini Server 10 running as a service'''


This page covers running our mini server (describe on the [[Mini Servers: Apache 2.2.9 Perl 5.10 Portable|previous page]]) as a service, its big brother Uniform Server 3.5-Appolo automates this process. We are not going to take this easy option! Well you would never learn anything by doing that, the manual alternative although slightly more difficult provides an insight into Apache and Uniform Servers flexibility.
This page covers running our mini server (describe on the [[Mini Servers: Apache 2.2.9 Perl 5.10 Portable|previous page]]) as a service, its big brother Uniform Server 3.5-Appolo automates this process. We are not going to take this easy option! Well you would never learn anything by doing that, the manual alternative although slightly more difficult provides an insight into Apache and Uniform Servers flexibility.
Line 34: Line 34:


=== Absolute ===
=== Absolute ===
Windows likes pegs hammered into the ground so to speak, hence when running as a service specifying absolute paths is essential to keep both parties happy for example '''c:\uc_server_2b''', the drive must be specified and then any folders etc.
Windows likes pegs hammered into the ground so to speak, hence when running as a service specifying absolute paths is essential to keep both parties happy for example '''c:\mini_server_10''', the drive must be specified and then any folders etc.


No need to ramble on, just remember absolute paths are the order of the day so lets roll up ours sleeves and look at some code hacking.
No need to ramble on, just remember absolute paths are the order of the day so lets roll up ours sleeves and look at some code hacking.
Line 41: Line 41:


== Configuring Apache ==
== Configuring Apache ==
As mentioned above absolute paths are required in the configuration file. I have chosen to run the server on '''C''' drive from folder '''uc_server_3b''' you can use a different drive and or folder the choice is yours, just substitute accordingly. I have highlighted these absolute paths in bold interestingly these are the only changes required to our original configuration file.
As mentioned above absolute paths are required in the configuration file. I have chosen to run the server on '''C''' drive from folder '''mini_server_10''' you can use a different drive and or folder the choice is yours, just substitute accordingly. I have highlighted these absolute paths in bold interestingly these are the only changes required to our original configuration file.
 
Note: I have moved the server to port 8090 prevents clashing with other servers.
{|border="0" cellpadding="4" cellspacing="1" style="background:#222222"
{|border="0" cellpadding="4" cellspacing="1" style="background:#222222"
|-style="background:#e8e8e8"
|-style="background:#e8e8e8"
!httpd.conf located in folder: C:\uc_server_3b\usr\local\apache2\conf
!httpd.conf located in folder: C:\mini_server_10\usr\local\apache2\conf
|-style="background:#f5f5f5"
|-style="background:#f5f5f5"
|
|
<nowiki>#</nowiki> UniCenter - Very basic server<br>
<nowiki>#</nowiki> File name: http.conf<br>
<nowiki>#</nowiki> Author: Mike Gleaves <br>
<nowiki>#</nowiki> Created By: The Uniform Server Development Team<br>
<nowiki>#</nowiki> Edited Last By: Mike Gleaves (ric) <br>
<nowiki>#</nowiki> Main Apache 2.2.9 HTTP server configuration file.<br>
<nowiki>#</nowiki> Main Apache 2.2.9 HTTP server configuration file.<br>
<nowiki>#</nowiki> 16-7-2008
<nowiki>#</nowiki> Supports Perl<br>
<nowiki>#</nowiki> V 1.0 14-7-2008
|-style="background:#f5f5f5"
|-style="background:#f5f5f5"
|
|
Line 69: Line 72:
<nowiki>#</nowiki> Basic settings <br>
<nowiki>#</nowiki> Basic settings <br>
<nowiki>#</nowiki> ======================================== <br>
<nowiki>#</nowiki> ======================================== <br>
&nbsp;Listen 80 <br>
&nbsp;'''Listen 8090''' <br>
&nbsp;ServerName localhost:80<br>
&nbsp;'''ServerName localhost:8090'''<br>
&nbsp;ServerAdmin fred@www.somedomain.com <br>
&nbsp;ServerAdmin fred@www.somedomain.com <br>
&nbsp;UseCanonicalName Off <br>
&nbsp;UseCanonicalName Off <br>
Line 109: Line 112:
</Directory>
</Directory>


'''<Directory "c:/uc_server_3b/www">''' <br>
'''<Directory "c:/mini_server_10/www">''' <br>
&nbsp;&nbsp;Options Indexes FollowSymLinks Includes ExecCGI<br>
&nbsp;&nbsp;Options Indexes FollowSymLinks Includes ExecCGI<br>
&nbsp;&nbsp;Order allow,deny <br>
&nbsp;&nbsp;Order allow,deny <br>
Line 119: Line 122:
<nowiki>#</nowiki> Access control cgi <br>
<nowiki>#</nowiki> Access control cgi <br>
<nowiki>#</nowiki> ======================================== <br>
<nowiki>#</nowiki> ======================================== <br>
&nbsp;'''ScriptAlias /cgi-bin/ "c:/uc_server_3b/cgi-bin/"'''
&nbsp;'''ScriptAlias /cgi-bin/ "c:/mini_server_10/cgi-bin/"'''


&nbsp;'''<Directory "c:/uc_server_3b/cgi-bin">''' <br>
&nbsp;'''<Directory "c:/mini_server_10/cgi-bin">''' <br>
&nbsp;&nbsp;AllowOverride None<br>
&nbsp;&nbsp;AllowOverride None<br>
&nbsp;&nbsp;Options None<br>
&nbsp;&nbsp;Options None<br>
Line 133: Line 136:
<nowiki>#</nowiki> ======================================== <br>
<nowiki>#</nowiki> ======================================== <br>
&nbsp;DefaultType text/plain <br>
&nbsp;DefaultType text/plain <br>
&nbsp;'''TypesConfig c:/uc_server_3b/usr/local/apache2/conf/mime.types'''
&nbsp;'''TypesConfig c:/mini_server_10/usr/local/apache2/conf/mime.types'''
|-style="background:#f5f5f5"
|-style="background:#f5f5f5"
|
|
Line 152: Line 155:
'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''


== uc_install.bat ==
== install.bat ==
Batch files to install and uninstall Apache as a service are not very complex; the trick is to supply all the right parameters as shown.
Batch files to install and uninstall Apache as a service are not very complex; the trick is to supply all the right parameters as shown.


Line 159: Line 162:
{|border="0" cellpadding="4" cellspacing="1" style="background:#222222"
{|border="0" cellpadding="4" cellspacing="1" style="background:#222222"
|-style="background:#e8e8e8"
|-style="background:#e8e8e8"
!uc_install.bat located in folder: C:\uc_server_3b
!install.bat located in folder: C:\mini_server_10
|-style="background:#f5f5f5"
|-style="background:#f5f5f5"
|
|
<pre style="border:none;padding:0;margin:0">
<pre style="border:none;padding:0;margin:0">
@echo off
echo.
echo.
c:\uc_server_3b\usr\local\apache2\bin\Apache.exe -k install -n "Apache2"
c:\mini_server_10\usr\local\apache2\bin\Apache.exe -k install -n "mini_server_10"
echo.
echo.
net start Apache2
net start mini_server_10
echo.
echo.
echo Type http://localhost into your browser to access server.
echo Type http://localhost:8090 into your browser to access server.
echo.
echo.
pause
pause
Line 177: Line 179:
'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''


== uc_uninstall.bat ==
== uninstall.bat ==
The uninstall batch file first stops the “Apache2” service and then proceeds to uninstall it.
The uninstall batch file first stops the “mini_server_10” service and then proceeds to uninstall it.


{|border="0" cellpadding="4" cellspacing="1" style="background:#222222"
{|border="0" cellpadding="4" cellspacing="1" style="background:#222222"
|-style="background:#e8e8e8"
|-style="background:#e8e8e8"
!uc_uninstall.bat located in folder: C:\uc_server_3b
!uninstall.bat located in folder: C:\mini_server_10
|-style="background:#f5f5f5"
|-style="background:#f5f5f5"
|
|
<pre style="border:none;padding:0;margin:0">
<pre style="border:none;padding:0;margin:0">
@echo off
echo.
echo.
net stop Apache2
net stop mini_server_10
echo.
echo.
c:\uc_server_3b\usr\local\apache2\bin\Apache.exe -k uninstall -n "Apache2"
c:\mini_server_10\usr\local\apache2\bin\Apache.exe -k uninstall -n "mini_server_10"
echo.
echo.
echo Done
echo Done
Line 196: Line 197:
</pre>
</pre>
|}
|}
'''''Note 1'':''' The service name '''mini_server_10''' this along with a unique port number allows all mini servers to be run alongside each other.
'''''Note 2'':''' To avoid clashing with Uniform Server do not name the service '''Apache2'''.


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''


== Command Line ==
== Command Line ==
After installing the Apache service with the above batch file you can start and stop the "Apache2" service at anytime using a command line this saves uninstalling the service every time you want to stop the server:
After installing the Apache service with the above batch file you can start and stop the "mini_server_10" service at anytime using a command line this saves uninstalling the service every time you want to stop the server:


* '''net stop Apache2'''
* '''net stop mini_server_10'''
* '''net start Apache2'''
* '''net start mini_server_10'''


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
Line 211: Line 216:


=== Download ===
=== Download ===
Download this server from the mini server's [[Mini Servers: Support and download#UC Server 3b|Support and download page.]] Save the file uc_server_3b.exe to drive '''C'''.
Download this server from SourceForge [http://sourceforge.net/projects/miniserver Project Page] save the file '''mini_server_10.exe''' to drive '''C'''.


'''''Note'':''' Check the file's integrity using its MD5 a suitable checker '''winMd5Sum Portable''' can be found at [http://portableapps.com/apps Portable Apps] under Utilities.
'''''Note'':''' Check out the mini server's [[Mini Servers: Support and download|support and download page]] detailing how to obtain full binaries for Apache and Perl.


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''


=== Extract files ===
=== Extract files ===
Double click on uc_server_3b.exe, starts the extraction process. No need to change the folder destination, click extract, this creates a new folder '''uc_server_3b''' containing the following files and folders:
Double click on mini_server_10.exe, starts the extraction process. No need to change the folder destination, click extract, this creates a new folder '''mini_server_10''' containing the following files and folders:


{|
{|
Line 225: Line 230:
{|cellpadding="2"
{|cellpadding="2"
|-
|-
|valign="top"|'''Top level folder'''||uc_server_3b contains two files:<br>1) '''uc_install.bat''' - Double click to install and start server as a service.<br>2) '''uc_uninstall.bat''' - Double click to stop and uninstall server service.
|valign="top"|'''Top level folder'''||mini_server_10 contains two files:<br>1) '''install.bat''' - Double click to install and start server as a service.<br>2) '''uninstall.bat''' - Double click to stop and uninstall server service.
|-
|-
|'''cgi-bin folder:'''||Folder where you place all your Perl scripts.<br>Contains single page web site demo MPG2.
|'''cgi-bin folder:'''||Folder where you place all your Perl scripts.<br>Contains single page web site demo test2.
|-
|-
|'''tmp folder:'''||Stores temporary files such as sessions
|'''tmp folder:'''||Stores temporary files such as sessions
Line 239: Line 244:
|'''www folder:'''||This is where you put your web site or sites
|'''www folder:'''||This is where you put your web site or sites
|-
|-
|valign="top"|'''Test sites:'''||mpg1 and mpg2 are test sites these are included to<br>
|valign="top"|'''Test sites:'''||test1 and test2 are test sites these are included to<br>
provide an idea of the servers capability's. Delete these folders and<br>
provide an idea of the servers capability's. Delete these folders and<br>
copy your sites into this folder (Referred to as the document root folder)
copy your sites into this folder (Referred to as the document root folder)
|}
|}
|
|
[[Image:Uc_server_3b_dir.gif]]
[[Image:Uc_mini_server_10_dir.gif]]
|}
|}


Line 254: Line 259:
Testing is straight forward.
Testing is straight forward.


# Install the server by double clicking on '''uc_install.bat''' (Checks config file, installs service and runs it)
# Install the server by double clicking on '''install.bat''' (Checks config file, installs service and runs it)
# Type '''<nowiki>http://localhost/</nowiki>''' into the browser address bar.
# Type '''<nowiki>http://localhost:8090/</nowiki>''' into the browser address bar.
# An index page is displayed, check out the test site MPG1.
# An index page is displayed, check out the test site test1.


'''''Note 1'':''' The server automatically starts when your PC is restarted (that’s the reason for installing as a service.)
'''''Note 1'':''' The server automatically starts when your PC is restarted (that’s the reason for installing as a service.)
Line 267: Line 272:


=== Your web site ===
=== Your web site ===
Open the folder www located in folder '''*uc_server_3b\www''' delete everything in this folder and copy your site in to it.
Open the folder www located in folder '''*mini_server_10\www''' delete everything in this folder and copy your site in to it.


'''''Note'':''' Make sure one of your pages in folder www is named '''index.html''' or '''index.htm''', otherwise you will need to type a page name in every time to access your site.
'''''Note'':''' Make sure one of your pages in folder www is named '''index.html''' or '''index.htm''', otherwise you will need to type a page name in every time to access your site.


e.g. <nowiki>http://localhost/somepage.html</nowiki>
e.g. <nowiki>http://localhost:8090/somepage.html</nowiki>


== Problems - shebang ==
== Problems - shebang ==
Line 280: Line 285:
* Reference Unix: '''<nowiki>#!/usr/bin/perl</nowiki>'''
* Reference Unix: '''<nowiki>#!/usr/bin/perl</nowiki>'''
* Mini Portable Server: '''<nowiki>#!/usr/bin/perl</nowiki>'''
* Mini Portable Server: '''<nowiki>#!/usr/bin/perl</nowiki>'''
* Mini Server run as service: '''<nowiki>#!c:/uc_server_3b/usr/bin/perl</nowiki>'''
* Mini Server run as service: '''<nowiki>#!c:/mini_server_10/usr/bin/perl</nowiki>'''


'''''Note'':''' If you use the Unix "shebang" on a mini server installed as a service you will receive this error message in  
'''''Note'':''' If you use the Unix "shebang" on a mini server installed as a service you will receive this error message in  


Apache's error log: '''(OS 3) The system cannot find the path specified'''
Apache's error log: '''(OS 3) The system cannot find the path specified'''
'''''[[#top | Top]]'''''
== Change drive letter and or folder ==
The server requires a fixed location currently: c:\mini_server_10
You can move the server to any drive and folder for example e:\my_server\mini_server_10
To do this you need to edit threer files:
* '''install.bat'''
*''' uninstall.bat'''
* '''httpd.conf''' (located in folder C:\mini_server_10\usr\local\apache2\conf)
Find all occurrences of '''c:\mini_server_10''' and replace with '''e:\my_server\mini_server_10'''
In addition you need to change all Perl scripts that use a Shebang:
'''<nowiki>#</nowiki>!c:/mini_server_10/usr/bin/perl'''<br>To:<br>
'''<nowiki>#</nowiki>!e:/my_server/mini_server_10/usr/bin/perl'''
'''''[[#top | Top]]'''''
== Change server default port ==
*Open file: '''httpd.conf''' (Located in folder: C:\mini_server_10\usr\local\apache2\conf)
*Locate the lines:<br>Listen 8090<br>ServerName localhost:8090<br>
*Change to:<br>Listen 8080<br>ServerName localhost:8080
This moves the server to the standard secondary web server port
'''''Note'':''' Type '''<nowiki>http://localhost:8080</nowiki>''' into a browser to view the site.
If port already in use try any value above 2000
'''''[[#top | Top]]'''''
== Multi Servers ==
You can run more than one copy of this server as a service.
To do this you need to:
# Create a new folder and copy the contents of folder mini_server_10 to it.
# Edit the files as for (Change drive letter and or folder)
# Change the port see above.
# Edit install.bat and uninstall.bat, change the service name from '''Apache10''' to something unique e.g. Apache10x
'''''Note'':''' You can run the mini servers alongside Uniform Server 3.5-Apollo however you must start Uniform Server first.


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''


== Summary ==
== Summary ==
That concludes this series of mini servers, although they use only core elements from Apache, PHP and Perl they are none the less very powerful. Using Uniform Servers architecture you can pop them on a USB memory stick. I have not included a MySQL server, could not see the point when you can download the full version of Uniform Server 3.5-Apollo.
That concludes server 3, I have shown how to run it either in a portable or service configuration. It is a very powerful mini server you can use for either testing or putting your web site on-line (production server). Perl is a very powerful CGI scripting language allowing you to produce dynamic web sites.
 
Both PHP and Perl have integrated database support using this capability enhances functionality of any dynamic web site. To complete the mini server series I have included a [[Mini Servers: MySQL 5.0.51b Portable|mini MySQL server]].      


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
Line 296: Line 348:


{|
{|
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]
| [[Image:Uc_small_logo.gif]] || [[User:Ric|Ric]]
|}
|}


Line 302: Line 354:
[[Category: UniCenter]]
[[Category: UniCenter]]
[[Category: Mini Servers]]
[[Category: Mini Servers]]
[[Category: Perl]]
[[Category: Oily Rag]]
[[Category: Oily Rag]]
[[Category: Self Install]]
[[Category: Self Install]]

Revision as of 14:32, 17 August 2008

Mini Servers:  Introduction | Support | Server 1 - Portable | Server 2 - Service | Server 3 - Portable Authentication | Server 4 - Portable Authen. SSL | Server 5 - SSL Standalone | Browsers dislike self-signed certificates | Server 6 - PHP 5.2.6 Portable | Server 7 - PHP 5.2.6 Service | Server 8 - MySQL Support | Guest Book | Server 9 - Perl 5.2.6 Portable | Server 10 - Perl 5.2.6 Service | Server 11 - MySQL 5.0.67 Portable | Server 12 - MySQL 5.0.67 Service | Server 13 - MySQL 4.1.22 Portable | Server 14 - MySQL 4.1.22 Service | phpMyAdmin - Mini support | MySQL - General problems

Mini Servers:
Compact but fully functional.
Apache 2.2.9 Perl 5.10
Apache 2.2.9 Perl 5.10

Mini Server 10 running as a service

This page covers running our mini server (describe on the previous page) as a service, its big brother Uniform Server 3.5-Appolo automates this process. We are not going to take this easy option! Well you would never learn anything by doing that, the manual alternative although slightly more difficult provides an insight into Apache and Uniform Servers flexibility.

Note: Check support section for download details

Top

Specification

The server has the following specification:

  • Server shall run as a service
  • Static HTML and Dynamic Perl pages shall be served.
  • SSI shall be enabled
  • The server shall log all web requests.
  • All unused modules shall be disabled.

The only difference in this specification server is no longer portable but run as a service. This means every time you restart your PC the Apache server will automatically start. The advantage of this, when running a server permanently connected to the Internet should a power interruption occur the server will automatically restart when power is restored. If other elements of the system have been set accordingly them your Internet presence will also be restored.

Top

Security Issues

Security issues remain as explained on the previous two pages. I would like to stress this is about as best as it gets. If you take this and pop it on a Unix box you can harden the server a little more however they are also faced with the same issues.

Top

Changes

Interestingly if you run the portable version of this sever on a dedicated disk the configuration file would remain unchanged. Use the two new batch files and you are ready to go.

However like many others I run this on C drive with loads of other software yep alarm bells security issue, I am neither complacent nor unaware of these issues, Apache is probably the most secure bit on kit I have on my PC. Anyway I digress; changes are all associated with paths more precisely relative and absolute.

Top

Relative

In theory Apache is quite happy to use relative paths for example “/” refers to the top level of the current disk. Uniform Server and our portable mini server use this to great advantage by defining a dedicated virtual disk “w”. However when changing across disk space Windows gets uptight about relative paths unless you can explicitly define a disk.

Absolute

Windows likes pegs hammered into the ground so to speak, hence when running as a service specifying absolute paths is essential to keep both parties happy for example c:\mini_server_10, the drive must be specified and then any folders etc.

No need to ramble on, just remember absolute paths are the order of the day so lets roll up ours sleeves and look at some code hacking.

Top

Configuring Apache

As mentioned above absolute paths are required in the configuration file. I have chosen to run the server on C drive from folder mini_server_10 you can use a different drive and or folder the choice is yours, just substitute accordingly. I have highlighted these absolute paths in bold interestingly these are the only changes required to our original configuration file.

Note: I have moved the server to port 8090 prevents clashing with other servers.

httpd.conf located in folder: C:\mini_server_10\usr\local\apache2\conf

# File name: http.conf
# Created By: The Uniform Server Development Team
# Edited Last By: Mike Gleaves (ric)
# Main Apache 2.2.9 HTTP server configuration file.
# Supports Perl
# V 1.0 14-7-2008

# ================================================
# Modules
# ================================================
 LoadModule alias_module modules/mod_alias.so
 LoadModule authz_host_module modules/mod_authz_host.so
 LoadModule include_module modules/mod_include.so
 LoadModule cgi_module modules/mod_cgi.so
 LoadModule dir_module modules/mod_dir.so
 LoadModule log_config_module modules/mod_log_config.so
 LoadModule mime_module modules/mod_mime.so

# ========================================
# Basic settings
# ========================================
 Listen 8090
 ServerName localhost:8090
 ServerAdmin fred@www.somedomain.com
 UseCanonicalName Off
 ServerSignature Off
 HostnameLookups Off
 ServerTokens Prod
 ServerRoot "/usr/local/apache2"
 DocumentRoot "/www"
 PidFile /usr/local/apache2/logs/httpd.pid
<IfModule mod_dir.c>
  DirectoryIndex index.html index.htm index.pl index.cgi
</IfModule>
AddHandler server-parsed .shtml .shtm .sht

# ========================================
# HTTP and performance settings
# ========================================
 Timeout 300
 KeepAlive On
 MaxKeepAliveRequests 100
 KeepAliveTimeout 15
<IfModule mpm_winnt.c>
  ThreadsPerChild 64
  MaxRequestsPerChild 0
</IfModule>

# ========================================
# Access control
# ========================================
<Directory />
  Options FollowSymLinks
  Options None
  AllowOverride None
  Order deny,allow
  Deny from all
</Directory>

<Directory "c:/mini_server_10/www">
  Options Indexes FollowSymLinks Includes ExecCGI
  Order allow,deny
  Allow from all
</Directory>

# ========================================
# Access control cgi
# ========================================
 ScriptAlias /cgi-bin/ "c:/mini_server_10/cgi-bin/"

 <Directory "c:/mini_server_10/cgi-bin">
  AllowOverride None
  Options None
  Order allow,deny
  Allow from all
 </Directory>

# ========================================
# MIME encoding
# ========================================
 DefaultType text/plain
 TypesConfig c:/mini_server_10/usr/local/apache2/conf/mime.types

# ========================================
# Logs: debug, info, notice, warn, error, crit
# ========================================
 LogLevel warn
 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
 \"%{User-Agent}i\"" combined
 LogFormat "%h %l %u %t \"%r\" %>s %b" common
 LogFormat "%{Referer}i -> %U" referer
 LogFormat "%{User-agent}i" agent
 ErrorLog "logs/error_log"
 CustomLog "logs/access.log" combined
# ========================================

Top

install.bat

Batch files to install and uninstall Apache as a service are not very complex; the trick is to supply all the right parameters as shown.

Install service employs a nice bit of defensive programming when run the first line checks Apache’s configuration file for errors. Errors are listed including line numbers once corrected rerun the batch file. The second line installs Apache as a service once installed the third line starts the service.

install.bat located in folder: C:\mini_server_10
echo.
c:\mini_server_10\usr\local\apache2\bin\Apache.exe -k install -n "mini_server_10"
echo.
net start mini_server_10
echo.
echo Type http://localhost:8090 into your browser to access server.
echo.
pause

Top

uninstall.bat

The uninstall batch file first stops the “mini_server_10” service and then proceeds to uninstall it.

uninstall.bat located in folder: C:\mini_server_10
echo.
net stop mini_server_10
echo.
c:\mini_server_10\usr\local\apache2\bin\Apache.exe -k uninstall -n "mini_server_10"
echo.
echo Done
pause

Note 1: The service name mini_server_10 this along with a unique port number allows all mini servers to be run alongside each other.

Note 2: To avoid clashing with Uniform Server do not name the service Apache2.

Top

Command Line

After installing the Apache service with the above batch file you can start and stop the "mini_server_10" service at anytime using a command line this saves uninstalling the service every time you want to stop the server:

  • net stop mini_server_10
  • net start mini_server_10

Top

Support files

Each mini server is complete and zipped into a single self-extracting archive file.

Download

Download this server from SourceForge Project Page save the file mini_server_10.exe to drive C.

Note: Check out the mini server's support and download page detailing how to obtain full binaries for Apache and Perl.

Top

Extract files

Double click on mini_server_10.exe, starts the extraction process. No need to change the folder destination, click extract, this creates a new folder mini_server_10 containing the following files and folders:

Top level folder mini_server_10 contains two files:
1) install.bat - Double click to install and start server as a service.
2) uninstall.bat - Double click to stop and uninstall server service.
cgi-bin folder: Folder where you place all your Perl scripts.
Contains single page web site demo test2.
tmp folder: Stores temporary files such as sessions
bin folder: Perl program
lib folder: Perl libraies and modules
apache2 folder: Contains all files associate with the Apache server
www folder: This is where you put your web site or sites
Test sites: test1 and test2 are test sites these are included to

provide an idea of the servers capability's. Delete these folders and
copy your sites into this folder (Referred to as the document root folder)


Top

Test

Testing is straight forward.

  1. Install the server by double clicking on install.bat (Checks config file, installs service and runs it)
  2. Type http://localhost:8090/ into the browser address bar.
  3. An index page is displayed, check out the test site test1.

Note 1: The server automatically starts when your PC is restarted (that’s the reason for installing as a service.)

Note 2: Adding extra pages or changing your web site there is no need to either restart or uninstall the server.

Note 3: Stop the service before making changes to Apache's configuration file; restarting service guarantees the new changes will be picked up.

Top

Your web site

Open the folder www located in folder *mini_server_10\www delete everything in this folder and copy your site in to it.

Note: Make sure one of your pages in folder www is named index.html or index.htm, otherwise you will need to type a page name in every time to access your site.

e.g. http://localhost:8090/somepage.html

Problems - shebang

I found this to be a real pain you need to change the “shebang” depending on how you run the mini server, portable or as a service. If you're running CGI's on Windows use the portable server, this will allow you to move the scripts to a Unix system without change!

The following lists the “shebang” required to get your cgi scripts working:

  • Reference Unix: #!/usr/bin/perl
  • Mini Portable Server: #!/usr/bin/perl
  • Mini Server run as service: #!c:/mini_server_10/usr/bin/perl

Note: If you use the Unix "shebang" on a mini server installed as a service you will receive this error message in

Apache's error log: (OS 3) The system cannot find the path specified

Top

Change drive letter and or folder

The server requires a fixed location currently: c:\mini_server_10

You can move the server to any drive and folder for example e:\my_server\mini_server_10

To do this you need to edit threer files:

  • install.bat
  • uninstall.bat
  • httpd.conf (located in folder C:\mini_server_10\usr\local\apache2\conf)

Find all occurrences of c:\mini_server_10 and replace with e:\my_server\mini_server_10

In addition you need to change all Perl scripts that use a Shebang:

#!c:/mini_server_10/usr/bin/perl
To:
#!e:/my_server/mini_server_10/usr/bin/perl

Top

Change server default port

  • Open file: httpd.conf (Located in folder: C:\mini_server_10\usr\local\apache2\conf)
  • Locate the lines:
    Listen 8090
    ServerName localhost:8090
  • Change to:
    Listen 8080
    ServerName localhost:8080

This moves the server to the standard secondary web server port

Note: Type http://localhost:8080 into a browser to view the site.

If port already in use try any value above 2000

Top

Multi Servers

You can run more than one copy of this server as a service.

To do this you need to:

  1. Create a new folder and copy the contents of folder mini_server_10 to it.
  2. Edit the files as for (Change drive letter and or folder)
  3. Change the port see above.
  4. Edit install.bat and uninstall.bat, change the service name from Apache10 to something unique e.g. Apache10x

Note: You can run the mini servers alongside Uniform Server 3.5-Apollo however you must start Uniform Server first.

Top

Summary

That concludes server 3, I have shown how to run it either in a portable or service configuration. It is a very powerful mini server you can use for either testing or putting your web site on-line (production server). Perl is a very powerful CGI scripting language allowing you to produce dynamic web sites.

Both PHP and Perl have integrated database support using this capability enhances functionality of any dynamic web site. To complete the mini server series I have included a mini MySQL server.

Top


Ric