|
|||||||||||||
Tips
and Tricks Page Using MicroApache with
Legacy Visual BASIC MicroApache Update History This project is shared with the community at in good faith and at no cost and using whatever free time I have available. Sorry but I do not have time to give one-to-one support for Apache Webserver. If you use MicroApache then please link to this page or mention MicroApache! Please see the licensing conditions for each component NEW RELEASES! MicroApache 2.0.64 MicroApache 2.0.64 (no PHP) MicroApache 2.0.64+PHP 5.2.17 MicroApache 2.0.64+PHP 5.2.17 MicroApache 2.0.64+PHP 5.2.17 2.0.64 - All SO Modules (as DLLs) MicroApache 2.0.64+PHP 5.2.17+SQLite PHP Test Program MicroApache 2.0.63 MicroApache 2.0.63 (no PHP) MicroApache 2.0.63+PHP 4.4.9 MicroApache 2.0.63+PHP 4.4.9+GD2 MicroApache 2.0.63+PHP 4.4.9+SQLite MicroApache 2.0.63+PHP 5.2.9 MicroApache 2.0.63+PHP 5.2.9+GD2 MicroApache 2.0.63+PHP 5.2.9+SQLite MicroApache 2.0.63 2.0.63 - All SO Modules (as DLLs) MicroApache 1.3.41 Updated Updated Launch13x.exe v1.05 Updated Launch13x.exe v1.04 MicroApache 1.3.41 (no PHP) MicroApache 1.3.41+PHP 4.4.9 MicroApache 1.3.41+PHP 4.4.9+SQLite+GD2 Older Releases These older releases may be sub-optimal or have known security weaknesses. Use with care in production/public environments MicroApache 2.0.61 MicroApache 2.0.61 (no PHP) MicroApache 2.0.61+PHP 5.2.5 MicroApache 2.0.61+PHP 4.4.7 MicroApache 2.0.61+PHP 5.2.5+SQLite MicroApache 2.0.61+PHP 4.4.7+GD2 MicroApache 2.0.61+PHP 4.4.7+SQLite MicroApachePE 2.0.61+PHP 5.2.5 2.0.61 - All SO Modules MicroPHP 4.4.7 Only MicroApache 1.3.x MicroApache 1.3.41 (no PHP) MicroApache 1.3.41+PHP 4.4.9 MicroApache 1.3.41+PHP 4.4.9+SQLite MicroApache 1.3.41+PHP 4.4.9+SQLite+GD2 MicroApache 1.3.37 (no PHP) MicroApache 1.3.37+PHP 4.4.7 MicroApache 1.3.37+PHP 4.4.7+SQLite ZIP format 1,11Mb UnZipped MicroApache 1.3 Standard Modules Micro-Apache 2.2.2 MicroApache 2.2.2 Micro-Apache 2.0.59 Micro-Apache 2.0.59+PHP 4.4.4 Micro-Apache 2.0.59+PHP 4.3.10 2.0.59 - All SO Modules Micro-Apache 2.0.55 Micro-Apache 2.0.55+PHP 4.3.10 2.0.55 - All SO Modules MicroApache GeoIP MicroApache Mod_LimitIPConn Micro-PHP 4.4.4 Only Micro-PHP 4.4.2 Only Micro-PHP 4.3.10 Only BartPE Versions Micro-ApachePE + PHP 4.3.10 MicroApache 2.0.52 MicroApache 2.0.52+PHP 4.3.10 Apache 2.0+PHP+CGIApps Example floppy-control BAT files Ultra-Micro-Apache 1.3.34 The smallest distro -
1.3.34 Apache 1.3.34 +
PHP 4.3.10 MicroSQL 4.1.9 MicroSQL 4.1.9.3
(ZIP) Ultra-Micro-Apache 1.3.27 The smallest distro -
1.3.27 Apache 1.3.27 +
PHP 4.3.3 Complete Floppy-Webservers Demo Floppy Website Disk Image Live 1.44mb FloppyWeb Micro-Challenge Apache 2.0.55/PHP Website Live 1.44mb FloppyWeb Micro-Challenge Apache 2.2.x Sever
|
A Portable,
USB-Drive-Friendly, Micro-Sized Apache Server for Windows This is a legacy site, last upated around 2011. It is currently being reviewed and edited - March 2021 This is a microscopic and very-heavily trimmed-down version of the standard, Apache server; made available under the Apache GPL licence. It was developed initially just for fun to meet a FloppyWeb Challenge which was to run Apache from a standard 1.44Mb floppy disk. My thanks to James Greenwood (no website, unfortunately) for coming up with the original idea. It has been progressively revised to provide a portable micro-server for home use which will run from a USB drive with no install and minimal configuration. I've also added some freeware binary code of my own to some distros. I have further reduced the size by another 50% by compression and removing additional files - it now weighs in at around about 450kb for the most-minimal, fully-working version of Apache; with a legacy version of 1.3.x weighing-in at only 170Kb. Larger versions with bundled apps are still less than a megabyte. The object code is not modified and you can safely configure it or add modules in just the same way as "big" Apache. Many non-essential files are stripped-out and compression used to reduce the size of both EXE and DLL (SO) modules. Micro-PHP adds only another ~523kb to make a grand total of about 900kb. Micro-SQL modules are available using both MySQL and SQLite. If all you need to do is share a USB stick or other removable device, quickly and conveniently, using HTTP then why bother with other less-flexible ultra-micro webservers when you can have genuine Apache, fully extendible and with practically limitless configuration in about the same digital footprint?. Start small and just add the bits you need until you're ready to install the full-blown server. USB-Friendly The best thing about this distro is that it is configured to be "portable" and thus requires no setup or install to get the basic server up-and-running. Just unzip-and-run using the supplied command files. This is a minimalist distro intended to help you cram a complete website with webserver, ftp server and content on a 1.44mb floppy, USB key-drive or to be burned onto optical media such as a DVD-ROM. You can access my original first effort still running live from a 1.44mb floppy or floppy disk image by clicking here. [Link removed] Unfortunately I can only squeeze down to 1.19mb when PHP + CGI Apps, an FTP server and web-content and guestbook are also included. MicroApache is offered in the hope it may be useful to anyone who wants to squeeze a quality personal web server into a very tiny footprint. MicroApache is ideal for disaster recovery since you can quickly configure and run Apache from removable-media on any Win32 box simply by inserting a floppy disk, CD-ROM, micro-hard-drive or USB-stick. Test your access using http://localhost:8800 (use this link once running - you should see your local disk drive-root contents indexed). You will see the need to pay attention to the security advice. MicroApache is Designed for Home and Local Network Use, It is Not Intended for Public-Facing Server Use! It is important to note that because MicroApache was intended only for casual use sharing of USB devices or floppy disks using HTTP within "friendly" or home networks; the default configuration supplied may be too "relaxed" to offer security needed in other scenarios. It is NOT intended or configured for use as a public-facing webserver without the usual attention to web-security. If you intend to put MicroApache to use on any public-facing webserver this is perfectly feasible, but you MUST take extreme care to set up your server configuration properly adequately, just as you would any other normal version of Apache. Any person putting a "public-facing" webserver online has to take on and deal with serious responsibilities for their own system security. This should not be underestimated. However, the issues are exactly the same as those which need to be handled for "standard" Apache so if you can accept the challenge then please don't be put-off; it's really not that hard. 100% Free Software! This Micro-Apache suite is offered completely free under the Apache GPL licence along with a few Public Domain or Freeware apps in the hope it may be of some use or benefit to the larger net community. The source-code is not modified in any way. Sorry, but absolutely NO one-to-one support or "hand holding" is offered. Life is just too short and I simply don't have time to do much more than what is offered here. Always check the official Apache documentation since it is 100% relevant to MicroApache and what is offered by the guys at Apache.org is incredibly useful. There is no substitute for reading the Apache online manual. Recent News and Updates
Potential Uses for MicroApache
Future Plans At some future point in time, when ReactOS is stable enough I hope to be able to release a CDROM-O/S-bootable mini-webserver with the latest version of MicroApache. This may be many months away (say 2010/2011) as ROS is a work-in-progress project in early alpha stage and not yet sufficiently stable for TCP/IP server use. Check out ReactOS project here. Supplied Disk Image Directory Tree - (Current USB MicroApache Versions) Apache experts will notice that having the Document Root above the Server Root is not ideal and requires special protection for the Server Root if public-facing since it could become possible to "drill down" into the Server configuration. However, if set up properly it is acceptable for home use. If set up carefully it can work for public-facing us as well. Requires a restrictive root <Directory> policy or careful use of .htaccess files if this is not used in order to make safe.
Supplied FloppyWeb Disk Image Directory Tree - (Early 1.44Mb FloppyWeb MicroApache Versions Only) This was the first layout designed specifically for floppy-disk use with the Document Root ideally located in a different folder tree to the Server Root
Tutorial - Chainbooting PXE, gPXE and Tinycore Linux I successfully managed to get gPXE to chainload Tinycore Linux via PXE, GRUB gPXE and MicroApache. This can be bundled on optical media such as DVD or CDROM - Read more.... An implementation of MicroApache 2.x with PHP 5.x and a basic install script which is designed to enable a USB stick or other removable device to act as a handy and simple local streaming MP3 player for your Home Network. The concept is based on the freeware PremiumBeat SWF-based MP3 player. Unfortunately although free, the EULA prevents this being bundled with other software such as MicroApache so you will have to download and add a couple of files yourself to make this work. You will need to unzip the MicroApache distro to the root of your USB drive; then download the free player package from this link and unzip two files - swfobject.js and playerMultipleList.swf into the unzipped MicroApache installation directory (\<microapache-distroname>\player\). Once integrated into the supplied distro, you will then need to run \<microapache-distroname>\setup.bat and follow the on-screen instructions. Please take extreme care if installing on a USB stick which already contains data. It is recommended that this distro is only installed on an empty USB or other removable device. The setup.bat file contains useful comments should you think of modifying or extending the idea. Once installed you can play MP3 files locally via http://localhost/jukebox/ or elsewhere on your LAN using http://<ip-address>/Jukebox/ . If your local router also acts as a DNS server then you can access directly using the machine name e.g. http://snoopy/jukebox/ The player is enabled by means of a basic php-based index.php script which generates the required XML files for the PremiumBeat player. It also offers a level of automatic obfuscation of the actual MP3 filenames by randomly adding "_()" characters will are automatically-removed by the script. The distro contains free sample wallpapers and at least 1 legal sample MP3 copyrighted to the MicroApache author which is included as a demonstration. Download - v1.00 - 4.41mb ZIP file - 3rd August 2009 (You will need to add 2 freeware files from PremiumBeat to this distro once unzipped) MicroApachePE 2.0.61 + PHP 5.2.5
MicroApache 2.2.x (THERE IS NO PHP SUPPORT FOR APACHE 2.2.2 YET - June 2006) Released June 8th 2006. Basic testing done but if you find any bugs in the config or things which could be improved please let me know. The install config is "drive free" which means drive letters are not specified and you can install simply by unzipping the ZIP file to any folder and running by clicking on GO.BAT in the root folder. The default webroot is wwwroot at the same level as the Apache directory. It may still be a bit premature to consider moving to 2.2.x on Win32. As any IT professional knows moving early is all well and good for those who earn a living at the cutting edge of development. If you want an "easy life" and expect things to "work" then move later!. I'm quite conservative and 2.0.x does what I want so I'm under no pressure to move to 2.2.x There are also some open bug reports and API compatibility issues relating to PHP 4.4.2 and Apache 2.2.x - rumours hint that the PHP 4.4.x release isn't full-compatible with the new Apache API (APR). In a non-production environment you could try this fix page. I am usually quite busy doing other things but If you become aware of a stable version of PHP which works with 2.2.x please let me know. Many other modules may not yet be ported to Apache 2.2.x or may not be stable under 2.2.x Please note that Apache changed the name of the EXE in 2.2.x from apache.exe to httpd.exe. MicroApache has had it's exe name changed to mhttpd.exe to avoid any possible conflicts or support issues with existing installations of Apache 2.2.x. In addition the default port is changed from 80 to 8800 to avoid conflicts with port bindings.
IMPORTANT Ensure you harden MicroApache security before using on a public-facing server Apache 1.3.x can also make for an ridiculously tiny distro. A minimalist install, with no php, can be set up in about 170kb for an older version of Apache 1.3. Even with PHP this is still very tiny. The 1.3.x version is not 100% recommended and is included here as a curiosity. The distros supplied will require some tweaking in respect of thread allocation and the ThreadsPerChild setting - but they prove just how small a footprint you can squeeze Apache into if you try hard!.
Micro-Apache PE (2.0.55) + PHP 4.3.10 for BartPE Replaced January 2008 with MicroApachePE 2.0.61 I have ported Micro-Apache to BartPE for my own use as a server disaster recovery platform. This version is freely offered under the same GNU GPL licence should it be of any use to anyone. It is recommended that you build and test your BartPE builds using QEMU. Details of this method of testing are documented on my BartPE page. You can download Micro-Apache PE here. Please note that any PE version of Apache is NOT for those new to for Apache and is specifically targeted at Apache experts. Please don't inundate me with Apache config requests - I won't answer them. Instead visit a reputable Apache server forum such as www.apachefreaks.com The default directory structure of the BartPE version This version will not be updated as frequently as there is minimal interest in it at present - thus it may be several versions behind the latest releases of Apache and PHP MicroSQL 4.1.9 for MicroApache
Other files may be required PLEASE REQUEST THEM if you identify them!! Minimising the Disk Footprint The compressed disk footprint, when operating for light use, can be reduced to about 2.5mb using NTFS compression and deleting the two local admin apps (mysql.exe and mysqladmin.exe). This needs more testing. Queries relating to disk footprint are posted at www.mysqlfreaks.com and at PortableApps.com. If you need InnoDB then you can reduce the size of 2 x 10mb log files to 2 x 4mb
by using: innodb_log_file_size=4M The lowest uncompressed footprint running has been
Example PHP SQL Query Download the following SqlTest.PHP code. Place in your webserver tree and rename from *.TXT to *.PHP. It will select the MySQL database then do a simple web-based query on the help table within your web browser. Deleteable Components If you use an external web-based manager such as PHPMyAdmin and never use the
CMD-line admin or access functions then you can reduce the footprint by deleting mysql.exe
and mysqladmin.exe (and mysqlwatch.exe + mysqlcheck.exe if supplied) Removed Components You can restore these by running setup into a temporary directory then copying. The removed components are as follows... 13/01/2005 08:46 122,880 my_print_defaults.exe 13/01/2005 08:46 1,093,632 myisam_ftdump.exe 13/01/2005 08:46 1,200,128 myisamchk.exe 13/01/2005 08:46 1,118,208 myisamlog.exe 13/01/2005 08:46 1,118,208 myisampack.exe 13/01/2005 08:46 1,064,960 mysqlbinlog.exe 13/01/2005 08:46 1,044,480 mysqlcheck.exe 13/01/2005 08:46 3,493,888 mysqld.exe 13/01/2005 08:46 1,064,960 mysqldump.exe 13/01/2005 08:46 1,044,480 mysqlimport.exe 07/01/2005 00:30 1,523,200 MySQLInstanceConfig.exe 13/01/2005 08:46 1,040,384 mysqlshow.exe 13/01/2005 08:46 40,960 mysqlshutdown.exe 13/01/2005 08:46 45,056 mysqlwatch.exe 13/01/2005 08:46 110,592 perror.exe Small Database Alternatives
IMPORTANT Ensure you "harden" MicroApache security before using on a public-facing server SQLite Database (PHP 4.4.x and PHP 5) SQLite is a free, Public Domain database engine which rivals MySQL. Although not yet fully tested (Jan 2008) SQLite may be a better bet for use with MicroApache than MySQL. This is due to the incredibly small size of SQLite. it's availability as a single Windows DLL and the fact that it is supported by PHP. Support is built-in with PHP5 and PHP4 is supported via PECL.. To install, download and unzip or download the sqlite3.dll file and add to the root folder of your MicroApache distro. Please let me know if you encounter problems with this early release. Examples of when to use SQLite A combined MicroApache 2.0.61 + PHP 5 + SQLite install weighs in at 2.78Mb when installed which is far less than MySQL SQLite is Freeware and in the Public Domain. You can download the SQLite DLL from this link or the DLL package as a ZIP file from here (207kb) or from this site as a ZIP file here. There is a PowerPoint presentation on SQLite and PHP available from here PHP 5.x Configuration To activate in PHP 5.x you need to enable two extension, SQLite and PDO which is a dependency of SQLite by copying them to your distro and enabling in PHP.INI. If you are not using an external install of PHP then also copy the following 2 dlls to your MicroApache distro.
Since extensions are not normally configured in MicroApache you will also
probably need to configure the extension directory parameter - extension_dir
- in PHP.INI Ensure you set the TMP variable to prevent SQLite creating temp files in the Windows directory using and ensure C:\TEMP (or other TEMP folder is created) Setenv TMP=c:\temp PHP 4.x and SQLite Although PHP 4.x is no longer supported a PECL DLL is still available to enable SQLite in PHP 4.4.x. The stability and security of this DLL cannot be guaranteed and the authors of PHP strongly encourage all users to upgrade to PHP 5. It is, however, made available as a distro for those who want to experiment. The configuration requires only...
Compression DLLs may be compressed with UPX (already compressed in the MicroApache distro)
Example SQL Code Here is some brief example code from the above presentation. To use this on most distros you will need to copy to your configured webroot (DocumentRoot) - this is usually your drive root. Note that the demo database will be created in the same location should you want to delete it. Each successive reload of the page will add more records to the database.
Downloads
Troubleshooting SQLite SQLite 3 Support SQLite is built-in to PHP 5 however the programming interface API is slightly odd and incomplete. The procedural API doesn't support the full procedural SQLite API e.g. SQlite3_Open() and there's support for SQLite 2 databases only. If you want to use the advanced SQLite 3 features and open SQLite 3 databases you will have to use the object-based class library.More information the topic can be found in this thread at macosforge.org IMPORTANT Ensure you "harden" MicroApache security before using on a public-facing server Using MicroApache with Visual BASIC CGI You can use the tiny 80Kb Windows DLL provided by VBToolbox to add CGI console I/O to legacy Visual BASIC 5/6 and 100% VB clones. There is also a separate SQLite 3.5.x VB DLL available which adds SQLite SQL database functionality to VB applications. This means you can write VB based CGI applications which draw on the full power of things like Windows/MS-Access database interconnectivity. Using MicroApache with The Ch C/C++ Interpreter Ch is a powerful and free (for personal use) C/C++ interpreter which provides a superset of the C language and which lends itself very well to CGI script usage with Apache.The primary advantage of Ch is that it permits the use of standard "C" along with powerful add-on features such as shell interactivity. Unfortunately this is not Open Source so it cannot be redistributed or cut-down into a "micro" distro such as MicroApache. To use Ch with MicroApache you need to do the following.
IMPORTANT Ensure you "harden" MicroApache security before using on a public-facing server The code is not modified from the original sources. MicroApache is simply cut-down and repackaged and configured in a convenient way to make it USB-friendly and portable. You can get the relevant source code from the Apache website "Hey, there is no MicroApache forum! Why is this?". Well, apart from the fact that I don't have time or resources to run one, it's because there's really no special need as every aspect of configuration for "standard" Apache also applies to MicroApache so all you need to do is go to www.apache.org and read the standard online manual. It's 100% relevant. However, I recently signed up at StackOverflow so you can try posting a question on there. Please read the FAQs and any enclosed README.TXT *first*. Although tweaked, renamed, pruned and compressed, the binaries operate in precisely the same way and your MicroApache installation can be expanded and extended in every way right up to the full/standard Apache Win32 install. Most of the common questions will be covered in the FAQ below. If you have a question which you think is specific to MicroApache (not to general Apache configuration) then please post your query here and the answer will be added to the FAQ section or II will post a reply in the site's guestbook in about 24hrs. As a piece of general advice, around 75% of Apache support issues come from inappropriate use of .htaccess files where directives should, instead, be put in the main server config file. There are few cases where .htaccess files should ever be used with MicroApache and these are usually mandated by bespoke apps. See this official Apache advice regarding .htaccess files if you wish to go down that route. IMPORTANT Ensure you "harden" MicroApache security before using on a public-facing server Try the Tips and Tricks Page or see the official Apache 2.0 Documentation - See also the PHPFreaks Apache Support forum Recommended Portable Storage Products I use the Excalibur 4Gb micro-hard drive and after about 12 months of heavy and reckless use I can heartily recommend it and can certainly confirm that it is far more reliable than any USB flash drive I've owned. I've burnt out two USB pen-drives in less than that time. The Excalibur micro-drive is "cheap as chips" with a flip-out USB connector and is about half the size of a packet of 10 fags (for Americans here, that's British for Cigarettes!). After testing USB flash memory for a few years I'd have to admit that they're just not reliable enough for anything other than casual and infrequent backup or use in digital cameras. The worst was the Disgo U3 1GB stick which finally took 3 months in the deep-freezer compartment to recover and remove the U3 software. Cheap flash storage technology just isn't ready for heavy write-demand yet but apparently it's making progress. I wouldn't recommend anyone commit valuable data to a cheap one on a regular basis. Use as a MicroApache server host might be OK if writes can be kept to a minimum by disabling log files or other script-writing. Check out www.grc.com/securitynow/ where Steve Gibson relates a tale of Mark Thompson testing EEPROM flash memory similar to USB flash memory as a Windows swapfile host and burning it out in a matter of 60 minutes or so of continuous writes. ("It actually hurts non-volatile memory to change its data" S.G. 13/Dec/2007) See also this article on MLC/SLC memory I can also recommend eBuyer.com for UK residents - I've obtained most of my IT kit from there for several years now and they're pretty competitive and with a no-nag returns policy which I've used several times now.
ARSoft RAMDisk Driver After being discontinued in 2005 the ARSoft RAMDisk driver is available for download again (from November 2008). You can use it to run your website data (not server) from there to gain higher speeds - download from this page If you have a site which uses MicroApache and want to trade links post me your details via the contact page. Sorry, but I may not reply to all emails but FAQ requests will either be posted back in the guestbook or FAQ section..
Links and Other WAMP Micro-Webservers
MicroApache is a selectively repackaged version of standard Win32 Apache with no modified code and the Apache components are therefore covered by the same Apache GPL license (see below). "The Free Software Foundation considers the Apache License, Version 2.0 to be a free software license, compatible with version 3 of the GPL." In order to comply with GPL licensing, source code is available by email request although you may find it quicker and far more convenient to download it from source-code repository of www.apache.org or the individual site for each sub-module rather than me relaying it to you. The repackaged bundle may include non-essential and non-GPL software supplied as public-domain freeware licensed and written by the author here. This may include CGI test code which you are free to delete if you do not require it. To the best of my knowledge, none of this additional freeware is covered under the GPL or any other form of license, however some freeware may be copyrighted to the author to prevent individuals charging, claiming credit for or or reselling the product commercially. The executable (EXE) Object code (but not the source code) for such additional freeware is placed in the Public Domain. The project is offered at no-cost on a "best effort" basis. The package is designed not to be dependent on any public-domain freeware included and you must delete the non-GPL public-domain freeware if you wish to redistribute the package or re-use it in any other project which needs to strictly comply with the GPL license terms.For more detailed information see the conditions of the particular GPL licence concerned. Licensing for each product can be found here:
Copyright-Free MicroApache Logos I have designed and created a few logos based on and similar to the original Apache feather design using PSP5. Download instructions - Mozilla Seamonkey - Right-click, Save image as... IE 7 - Save picture as... Page last updated on 25 February 2021 - This page is optimised for 1024x768 or higher screens |