https://wiki.uniformserver.com/index.php?title=Mini_Servers:_Apache_2.2.9_PHP_5.2.6_Portable&feed=atom&action=historyMini Servers: Apache 2.2.9 PHP 5.2.6 Portable - Revision history2024-03-29T00:46:59ZRevision history for this page on the wikiMediaWiki 1.41.0https://wiki.uniformserver.com/index.php?title=Mini_Servers:_Apache_2.2.9_PHP_5.2.6_Portable&diff=6408&oldid=prevOlajideolaolorun: Text replace - "projects/uniformserver" to "projects/miniserver"2012-10-17T16:11:38Z<p>Text replace - "projects/uniformserver" to "projects/miniserver"</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 16:11, 17 October 2012</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l369">Line 369:</td>
<td colspan="2" class="diff-lineno">Line 369:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Download ===</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Download ===</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Download this server from SourceForge [http://sourceforge.net/projects/<del style="font-weight: bold; text-decoration: none;">uniformserver</del>/files/MiniServer/MiniServer_%20Apache%202.2.9%20PHP%205.2.6%20Portable/ Project Page] save the file '''mini_server_6.exe''' to any folder of your choice.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Download this server from SourceForge [http://sourceforge.net/projects/<ins style="font-weight: bold; text-decoration: none;">miniserver</ins>/files/MiniServer/MiniServer_%20Apache%202.2.9%20PHP%205.2.6%20Portable/ Project Page] save the file '''mini_server_6.exe''' to any folder of your choice.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''''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 PHP.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''''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 PHP.</div></td></tr>
</table>Olajideolaolorunhttps://wiki.uniformserver.com/index.php?title=Mini_Servers:_Apache_2.2.9_PHP_5.2.6_Portable&diff=6363&oldid=prevOlajideolaolorun: Text replace - "sourceforge.net/projects/miniserver" to "sourceforge.net/projects/uniformserver"2012-10-11T05:52:37Z<p>Text replace - "sourceforge.net/projects/miniserver" to "sourceforge.net/projects/uniformserver"</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 05:52, 11 October 2012</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l369">Line 369:</td>
<td colspan="2" class="diff-lineno">Line 369:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Download ===</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Download ===</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Download this server from SourceForge [http://sourceforge.net/projects/<del style="font-weight: bold; text-decoration: none;">miniserver</del>/files/MiniServer/MiniServer_%20Apache%202.2.9%20PHP%205.2.6%20Portable/ Project Page] save the file '''mini_server_6.exe''' to any folder of your choice.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Download this server from SourceForge [http://sourceforge.net/projects/<ins style="font-weight: bold; text-decoration: none;">uniformserver</ins>/files/MiniServer/MiniServer_%20Apache%202.2.9%20PHP%205.2.6%20Portable/ Project Page] save the file '''mini_server_6.exe''' to any folder of your choice.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''''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 PHP.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''''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 PHP.</div></td></tr>
</table>Olajideolaolorunhttps://wiki.uniformserver.com/index.php?title=Mini_Servers:_Apache_2.2.9_PHP_5.2.6_Portable&diff=6058&oldid=prevRic: /* Download */2011-11-05T13:03:54Z<p><span dir="auto"><span class="autocomment">Download</span></span></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 13:03, 5 November 2011</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l369">Line 369:</td>
<td colspan="2" class="diff-lineno">Line 369:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Download ===</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Download ===</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Download this server from SourceForge [http://sourceforge.net/<del style="font-weight: bold; text-decoration: none;">project</del>/<del style="font-weight: bold; text-decoration: none;">showfiles</del>.<del style="font-weight: bold; text-decoration: none;">php?group_id=53691&package_id=275691 </del>Project Page] save the file '''mini_server_6.exe''' to any folder of your choice.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Download this server from SourceForge [http://sourceforge.net/<ins style="font-weight: bold; text-decoration: none;">projects</ins>/<ins style="font-weight: bold; text-decoration: none;">miniserver/files/MiniServer/MiniServer_%20Apache%202</ins>.<ins style="font-weight: bold; text-decoration: none;">2.9%20PHP%205.2.6%20Portable/ </ins>Project Page] save the file '''mini_server_6.exe''' to any folder of your choice.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''''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 PHP.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''''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 PHP.</div></td></tr>
</table>Richttps://wiki.uniformserver.com/index.php?title=Mini_Servers:_Apache_2.2.9_PHP_5.2.6_Portable&diff=3502&oldid=prevRic: /* Download */2008-10-05T18:29:20Z<p><span dir="auto"><span class="autocomment">Download</span></span></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 18:29, 5 October 2008</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l369">Line 369:</td>
<td colspan="2" class="diff-lineno">Line 369:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Download ===</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Download ===</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Download this server from SourceForge [http://sourceforge.net/<del style="font-weight: bold; text-decoration: none;">projects</del>/<del style="font-weight: bold; text-decoration: none;">miniserver </del>Project Page] save the file '''mini_server_6.exe''' to any folder of your choice.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Download this server from SourceForge [http://sourceforge.net/<ins style="font-weight: bold; text-decoration: none;">project</ins>/<ins style="font-weight: bold; text-decoration: none;">showfiles.php?group_id=53691&package_id=275691 </ins>Project Page] save the file '''mini_server_6.exe''' to any folder of your choice.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''''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 PHP.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''''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 PHP.</div></td></tr>
</table>Richttps://wiki.uniformserver.com/index.php?title=Mini_Servers:_Apache_2.2.9_PHP_5.2.6_Portable&diff=3418&oldid=prevRic at 14:27, 17 August 20082008-08-17T14:27:47Z<p></p>
<a href="https://wiki.uniformserver.com/index.php?title=Mini_Servers:_Apache_2.2.9_PHP_5.2.6_Portable&diff=3418&oldid=3364">Show changes</a>Richttps://wiki.uniformserver.com/index.php?title=Mini_Servers:_Apache_2.2.9_PHP_5.2.6_Portable&diff=3364&oldid=prevRic: New page: {{Uc nav mini servers}} right'''Mini server using Apache 2.2.9 and PHP 5.2.6 Core''' This mini server packs a real punch; trouble is it also packs a ...2008-07-20T19:28:49Z<p>New page: {{Uc nav mini servers}} <a href="/File:Uc_mini_2a.gif" title="File:Uc mini 2a.gif">Apache 2.2.9|right</a>'''Mini server using Apache 2.2.9 and PHP 5.2.6 Core''' This mini server packs a real punch; trouble is it also packs a ...</p>
<p><b>New page</b></p><div>{{Uc nav mini servers}}<br />
[[Image:Uc_mini_2a.gif|Apache 2.2.9|right]]'''Mini server using Apache 2.2.9 and PHP 5.2.6 Core'''<br />
<br />
This mini server packs a real punch; trouble is it also packs a real disk hit, increases server size from 1.03MB to 6MB. However adding the PHP 5.2.6 core greatly extends the server's power.<br />
<br />
Hey not much use without a MYSQL server! So you have never considered file databases as an alternative. The support files include an excellent example; it’s a quest book (Version 1.7.2) from the DigiOz stable. A single file database, code is well commented and easy to follow. These chaps produce height quality open source software, their site is more than worth a visit, and forum is friendly check out their tutorials. I would like to thank Pete for his kind permission to use the DigiOz logo and use the quest book as an example.<br />
<br />
Note: Check the support files section for download details.<br />
<br />
== Security ==<br />
In order for PHP applications to perform their task they need to interact with the underlying programs if a security hole exists between interactions it can be exploited. Exploitation occurs only when data is returned by a user! or if the script is malicious.<br />
<br />
A well-written program like the guest book will have these holes plugged, however an application remains venerable if server software leave other security holes open. Security issues are a two way street which I attempt to cover later.<br />
<br />
Anyway I digress before looking at security issues lets get the server up and running with PHP.<br />
<br />
'''''[[#top | Top]]'''''<br />
== Specification ==<br />
The server has the following specification:<br />
<br />
* Server shall be portable<br />
* Static HTML and Dynamic PHP pages shall be served.<br />
* The server shall log all web requests.<br />
* All unused modules shall be disabled.<br />
<br />
Our mini server is intended to be small in keeping with this philosophy only the PHP core shall be used it is relatively large at 5MB however this is small in comparison to the complete PHP package of 25MB.<br />
<br />
If the basic core does not meet your requirements download the full PHP package and add extensions as required. <br />
<br />
'''''[[#top | Top]]'''''<br />
== Configuring Apache ==<br />
Using the configuration file from [[Mini Servers: Apache 2.2.9 Portable|uc server 1a]] very few changes are required these I have highlighted in bold.<br />
<br />
{|border="0" cellpadding="4" cellspacing="1" style="background:#222222"<br />
|-style="background:#e8e8e8"<br />
!httpd.conf located in folder: <nowiki>*</nowiki>\udrive\usr\local\apache2\conf<br />
!Comments<br />
|-style="background:#f5f5f5"<br />
|<br />
<nowiki>#</nowiki> UniCenter - Very basic server<br><br />
<nowiki>#</nowiki> Author: Mike Gleaves <br><br />
<nowiki>#</nowiki> Main Apache 2.2.9 HTTP server configuration file.<br><br />
<nowiki>#</nowiki> 14-7-2008<br />
|<br />
&nbsp;<br />
|-style="background:#f5f5f5"<br />
|<br />
<nowiki>#</nowiki>&nbsp;================================================== <br><br />
<nowiki>#</nowiki> Modules <br><br />
<nowiki>#</nowiki>&nbsp;==================================================<br><br />
&nbsp;LoadModule authz_host_module modules/mod_authz_host.so<br><br />
&nbsp;LoadModule dir_module modules/mod_dir.so<br><br />
&nbsp;LoadModule log_config_module modules/mod_log_config.so<br><br />
&nbsp;LoadModule mime_module modules/mod_mime.so<br><br />
&nbsp;'''LoadModule php5_module&nbsp;"/usr/local/php/php5apache2_2.dll"''' <br />
|<br />
'''LoadModule php5_module''': Module required to handle PHP5 pages.<br />
|-style="background:#f5f5f5"<br />
|<br />
<nowiki>#</nowiki> ======================================== <br><br />
<nowiki>#</nowiki> Basic settings <br><br />
<nowiki>#</nowiki> ======================================== <br><br />
&nbsp;'''PHPIniDir "/usr/local/php/"''' <br><br />
&nbsp;Listen 80 <br><br />
&nbsp;ServerName localhost:80<br><br />
&nbsp;ServerAdmin fred@www.somedomain.com <br><br />
&nbsp;UseCanonicalName Off <br><br />
&nbsp;ServerSignature Off <br><br />
&nbsp;HostnameLookups Off <br><br />
ServerTokens Prod <br><br />
&nbsp;ServerRoot "/usr/local/apache2"<br><br />
&nbsp;DocumentRoot "/www" <br><br />
&nbsp;PidFile /usr/local/apache2/logs/httpd.pid <br><br />
<IfModule mod_dir.c> <br><br />
&nbsp;&nbsp;'''DirectoryIndex index.html index.htm index.php'''<br><br />
</IfModule><br />
|<br />
'''PHPIniDir:''' Informs PHP where to find the php.ini file.<br />
<br />
'''''Note'':''' I found without this line php.ini was correctly located. However I would recommend using it otherwise PHP swans off looking in various locations (see info). The line guarantees correct php.ini file is used (multi servers or individual installations will place other php.ini files on your PC resulting in conflicts).<br />
<br />
'''DirectoryIndex:''' When a user requests a page supplying only a folder name (example fred.com) the index page is automatically returned by default. Note you can have more than one index page in the same folder with a different file extension. Order of priority left to right, first one found in the list is returned, all other are ignored. I have added '''index.php''' to this list.<br />
|-style="background:#f5f5f5"<br />
|<br />
<nowiki>#</nowiki> ======================================== <br><br />
<nowiki>#</nowiki> HTTP and performance settings <br><br />
<nowiki>#</nowiki> ======================================== <br><br />
&nbsp;Timeout 300 <br><br />
&nbsp;KeepAlive On <br><br />
&nbsp;MaxKeepAliveRequests 100 <br><br />
&nbsp;KeepAliveTimeout 15 <br><br />
<IfModule mpm_winnt.c><br><br />
&nbsp;&nbsp;ThreadsPerChild 64<br><br />
&nbsp;&nbsp;MaxRequestsPerChild 0<br><br />
</IfModule> <br />
|<br />
&nbsp;<br />
|-style="background:#f5f5f5"<br />
|<br />
<nowiki>#</nowiki> ======================================== <br><br />
<nowiki>#</nowiki> Access control <br><br />
<nowiki>#</nowiki> ======================================== <br><br />
<Directory /> <br><br />
&nbsp;&nbsp;Options None<br><br />
&nbsp;&nbsp;AllowOverride None <br><br />
&nbsp;&nbsp;Order deny,allow <br><br />
&nbsp;&nbsp;Deny from all <br><br />
</Directory> <br />
<br />
<Directory "/www"> <br><br />
&nbsp;&nbsp;Order allow,deny <br><br />
&nbsp;&nbsp;Allow from all <br><br />
</Directory><br />
|<br />
&nbsp;<br />
|-style="background:#f5f5f5"<br />
|<br />
<nowiki>#</nowiki> ======================================== <br><br />
<nowiki>#</nowiki> MIME encoding <br><br />
<nowiki>#</nowiki> ======================================== <br><br />
&nbsp;DefaultType text/plain <br><br />
&nbsp;TypesConfig /usr/local/apache2/conf/mime.types<br><br />
&nbsp;'''AddType Application/x-httpd-php .php'''<br />
|<br />
'''''Note'':''' The '''AddType''' directive maps a content-type to a file extension.<br />
Without this line pages will be served unprocessed in plain text and reveal your PHP code.<br />
|-style="background:#f5f5f5"<br />
|<br />
<nowiki>#</nowiki> ======================================== <br><br />
<nowiki>#</nowiki> Logs: debug, info, notice, warn, error, crit<br><br />
<nowiki>#</nowiki> ======================================== <br><br />
&nbsp;LogLevel warn <br><br />
&nbsp;LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"<br><br />
&nbsp;\"%{User-Agent}i\"" combined <br><br />
&nbsp;LogFormat "%h %l %u %t \"%r\" %>s %b" common <br><br />
&nbsp;LogFormat "%{Referer}i -> %U" referer <br><br />
&nbsp;LogFormat "%{User-agent}i" agent <br><br />
&nbsp;ErrorLog "logs/error_log" <br><br />
&nbsp;CustomLog "logs/access.log" combined<br><br />
<nowiki>#</nowiki> ========================================<br />
|<br />
&nbsp;<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
=== Information ===<br />
I have shown below the search order PHP performs to locate its php.ini file no real need to understand this just make sure to include a '''PHPIniDir''' command in the Apache configuration file.<br />
<br />
# SAPI module specific location:<br />
## '''PHPIniDir''' directive in Apache 2<br />
## -c command line option in CGI and CLI<br />
## php_ini parameter in NSAPI<br />
## PHP_INI_PATH environment variable in THTTPD<br />
# The PHPRC environment variable (Before PHP 5.2.0 this was checked after the registry key mentioned below.)<br />
# HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath (Windows Registry location)<br />
# Current working directory (for CLI)<br />
# The web server’s directory (for SAPI modules)<br />
# Directory of PHP (If Windows)<br />
# Windows directory (C:\windows or C:\winnt)<br />
# –with-config-file-path compile time option<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== PHP - Core ==<br />
Although our mini server only uses the PHP core you need to download the full package to extract it. (OK I have included a core in the support files) Check the PHP site and download any newer version this allows you to install any extensions you require. On the other hand perhaps you want to run an earlier version of PHP. The following outlines how to install PHP on our mini server.<br />
<br />
Download site [php.net http://www.php.net/downloads.php php.net]<br />
<br />
We are not interested in installing PHP on our PC hence download a zip package:<br />
<br />
PHP 5.2.6 zip package [9,516Kb] - 3 May 2008 located in the “Windows Binaries” section<br />
<br />
After downloading unzip to any folder, locate files '''php5apache2_2.dll''', '''php5ts.dll''' and '''php.ini-recommended''' copy these to mini server folder '''*\uc_server_2a\udrive\usr\local\php'''<br />
<br />
Rename the file '''php.ini-recommended''' to '''php.ini'''<br />
<br />
Believe it or not that’s all there is to the installation process, all that remains is to modify the php.ini file. <br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== php.ini ==<br />
Open '''php.ini''' have a read, yep its not a bedtime classic it’s a long confusing read. So what do you change! Surprisingly very little, to get you up and running the following table shows the lines that need changing:<br />
<br />
{|border="0" cellpadding="2" cellspacing="1" style="background:#000000"<br />
|-style="background:#e8e8e8"<br />
!Line <br />
!php.ini located in folder: *\uc_server_2a\udrive\usr\local\php<br />
|-style="background:#f5f5f5"<br />
|131||short_open_tag = On<br />
|-style="background:#f5f5f5"<br />
|149||output_buffering = Off<br />
|-style="background:#f5f5f5"<br />
|212||allow_call_time_pass_reference = On<br />
|-style="background:#f5f5f5"<br />
|229||safe_mode_include_dir = ".;/usr/local/PHP/includes;/usr/local/PHP/pear"<br />
|-style="background:#f5f5f5"<br />
|297||expose_php = Off<br />
|-style="background:#f5f5f5"<br />
|355||error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT<br />
|-style="background:#f5f5f5"<br />
|407||track_errors = On<br />
|-style="background:#f5f5f5"<br />
|431||error_log = logs/logs.log<br />
|-style="background:#f5f5f5"<br />
|455||variables_order = "EGPCS"<br />
|-style="background:#f5f5f5"<br />
|492||magic_quotes_gpc = On<br />
|-style="background:#f5f5f5"<br />
|495||magic_quotes_runtime = Off<br />
|-style="background:#f5f5f5"<br />
|498||magic_quotes_sybase = Off<br />
|-style="background:#f5f5f5"<br />
|525||include_path = ".;/usr/local/PHP/includes;/usr/local/PHP/pear"<br />
|-style="background:#f5f5f5"<br />
|537||user_dir = "/www"<br />
|-style="background:#f5f5f5"<br />
|541||extension_dir = "/usr/local/PHP/extensions"<br />
|-style="background:#f5f5f5"<br />
|598||upload_tmp_dir = /tmp<br />
|-style="background:#f5f5f5"<br />
|601||upload_max_filesize = 10M<br />
|-style="background:#f5f5f5"<br />
|757||sendmail_from = me@localhost.com<br />
|-style="background:#f5f5f5"<br />
|1045||session.save_path = "/tmp/"<br />
|-style="background:#f5f5f5"<br />
|1332||soap.wsdl_cache_dir="/tmp"<br />
|}<br />
<br />
'''''Note 1'':''' Our mini server does not require the folders pear, includes or extensions however including these in the ini file will make it easier when you want to add extensions or includes at a later date.<br />
<br />
For extension you enable the appropriate line in the php.ini file remember to copy a corresponding dll into the extensions folder. <br />
<br />
'''''Note 2'':''' Line 466 '''register_globals = Off''' this is the default keep it that way. There are security issues if you tun it on. <br />
<br />
'''''[[#top | Top]]'''''<br />
== Testing ==<br />
* Start the server by double clicking on '''uc_server_start.bat'''<br />
* Type '''<nowiki>http://localhost</nowiki>''' into your browser address bar.<br />
* Check out the test site confirms the server is working.<br />
* Close the server using '''uc_server_stop.bat'''<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Security ==<br />
When testing you need as much information as possible however when you put your servers on-line its best to restrict what you make public.<br />
Restrict public Information:<br />
<br />
Make sure the following are set in the Apache configuration file:<br />
<br />
* '''ServerTokens Prod''' – Prevents exposing server information makes it a little more difficult for automated attacks, which scan for vulnerable versions of Apache or its modules.<br />
* '''ServerSignature Off''' - Suppresses the error line which exposes the server version number, virtual host ServerName, "mailto:" reference to the ServerAdmin<br />
<br />
Make sure the following are set in the PHP configuration file:<br />
<br />
* '''expose_php = Off''' – Prevents reports in every request that PHP is being used to process the request, and what version of PHP is installed. makes it a little more difficult for automated attacks,<br />
<br />
If you download the mini server on the index page you will find a link named '''PHP info''' this runs a page containing a small script:<br />
<br />
{| cellpadding="2" cellspacing="1" style="background:#000000;"<br />
|- style="background:#e8e8e8;"<br />
!info.php located in folder www<br />
|- style="background:#f5f5f5;"<br />
| <br />
<?<br><br />
phpinfo();<br><br />
?><br />
|}<br />
<br />
'''Delete''' the file '''info.php''' before you put your server on-line it exposes your PHP configuration and detailed server information.<br />
<br />
'''''Note'':''' You can disable the function by setting this line in the '''php.ini''' configuration file: '''disable_functions''' = '''"phpinfo"'''<br />
<br />
The above are not real security measures they just provide a little fence to be jumped when a script kiddie wants to play. <br />
<br />
'''''[[#top | Top]]'''''<br />
=== Disable functions ===<br />
I previously mentioned don’t install what you do not use hence disable all unused functions. This really is an impractical option however there are a number of system functions that should be disabled:<br />
<br />
{|<br />
|-<br />
|phpinfo||&nbsp;<br />
|-<br />
|dir||— Return an instance of the Directory class<br />
|-<br />
|virtual||— Perform an Apache sub-request<br />
|-<br />
|popen||— Opens process file pointer<br />
|-<br />
|pclose||— Closes process file pointer<br />
|-<br />
|putenv||— Sets the value of an environment variable<br />
|-<br />
|dl||— Loads a PHP extension at runtime<br />
|-<br />
|exec||— Execute an external program<br />
|-<br />
|shell_exec||— Execute command via shell and return the complete output as a string<br />
|-<br />
|system||— Execute an external program and display the output<br />
|-<br />
|passthru||— Execute an external program and display raw output<br />
|-<br />
|proc_open||— Execute a command and open file pointers for input/output<br />
|-<br />
|proc_terminate||— Kills a process opened by proc_open<br />
|-<br />
|proc_get_status||— Get information about a process opened by proc_open()<br />
|-<br />
|proc_close||— Close a process opened by proc_open() and return the exit code of that process.<br />
|-<br />
|pfsockopen||— Open persistent Internet or Unix domain socket connection<br />
|-<br />
|pcntl_exec||— Executes specified program in current process space<br />
|-<br />
|posix_kill||— Send a signal to a process<br />
|-<br />
|posix_mkfifo||— Create a fifo special file (a named pipe)<br />
|-<br />
|posix_setpgid||— Set process group id for job control<br />
|-<br />
|posix_setsid||— Make the current process a session leader<br />
|-<br />
|posix_setuid||— Set the UID of the current process<br />
|-<br />
|escapeshellcmd||— Escape shell metacharacters<br />
|-<br />
|escapeshellarg||— Escape a string to be used as a shell argument<br />
|-<br />
|readfile||— Reads a file and writes it to the output buffer.<br />
|-<br />
|ini_alter||— Alias of ini_set()<br />
|-<br />
|parse_ini_file||— Parse a configuration file<br />
|-<br />
|show_source||— Alias of highlight_file()<br />
|-<br />
|curl_exec||— Perform a cURL session<br />
|}<br />
<br />
'''Your disable function line will look like this''':<br />
{|cellpadding="2" cellspacing="1" style="background:#000000;"<br />
|-style="background:#f5f5f5;"<br />
|<br />
disable_functions = "phpinfo, dir, virtual, popen, pclose, putenv, dl, exec, shell_exec, system, passthru, proc_open, proc_terminate, proc_get_status, proc_close, pfsockopen, pcntl_exec, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg, readfile, ini_alter, parse_ini_file, show_source, curl_exec"<br />
|}<br />
<br />
Backticks are dangerous when looking at a line of code they can be confused with a single quote . What follows a backtick is system commands never let anyone have access to this.<br />
<br />
{|cellpadding="2" cellspacing="2" style="background:#000000;"<br />
|-style="background:#f5f5f5;"<br />
|<br />
'''''Note'':''' '''Backticks''' are an alias for '''shell_exec()''' when shell_exec() is disabled backticks are also disabled.<br />
|}<br />
<br />
You need to edit php.ini to include phpinfo I have added the other functions, note when disabling functions be careful that you don't break any features you need hence always test.<br />
<br />
That completes plugging the server holes, however what I have covered does not guarantee the server is one hundred percent secure. Think of the above as a pointer, it provides search terms you should be using when doing further research into hardening your server. I mentioned its a two way street any application must also be hardened this I cover on the next page.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Support files ==<br />
Each mini server is complete and zipped into a single self-extracting archive file.<br />
<br />
=== Download ===<br />
Download this server from the mini server's [[Mini Servers: Support and download#UC Server 2a|Support and download page.]] Save the file uc_server_2a.exe to any folder of your choice.<br />
<br />
'''''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.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Extract files ===<br />
Double click on uc_server_2a.exe, starts the extraction process.<br />
<br />
No need to change the folder destination, click extract, this creates a new folder '''uc_server_2a''' containing the following:<br />
{|<br />
|-<br />
|<br />
{|cellpadding="2"<br />
|-<br />
|valign="top"|'''Top level folder'''||uc_server_2a contains two files:<br>1) '''uc_server_start.bat''' - Double click to start the<br>2) '''uc_server_stop.bat''' - Double click to stop server<br />
|-<br />
|'''program folder''':||Uniform Server's programs that make the server portable<br />
|-<br />
|'''tmp folder''':||Stores temporary files such as sessions<br />
|-<br />
|'''apache2 folder''':||Contains all files associate with the Apache server<br />
|-<br />
|'''php folder''':||Contains files that make up the PHP core<br />
|-<br />
|'''www folder:'''||This is where you put your web site or sites<br />
|-<br />
|valign="top"|'''Test sites''':||guestbook, mpg1 and mpg2 are test sites these are included to<br><br />
provide an idea of the servers capability's. Delete these folders and<br><br />
copy your sites into this folder (Referred to as the document root folder)<br />
|}<br />
|<br />
[[Image:Uc_server2a_dir.gif]]<br />
|}<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
=== Test ===<br />
Testing is straight forward.<br />
<br />
# Start the server by double clicking on uc_server_start.bat (Creates a virtual drive "w" to run the server on)<br />
# Start a web browser.<br />
# Type http://localhost/ into the browser address bar.<br />
# An index page is displayed, check out the test sites MPG1, MPG2 and guestbook.<br />
# Stop the server by double clicking on uc_stop.bat<br />
<br />
'''''Note'':''' If you need to change the virtual drive letter open file uc_server_start.bat locate this line:<br />
<br />
'''if "%Disk%"=="" set Disk=w''' and change the drive letter from "'''w'''" to one that is not being used.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
=== Your web site ===<br />
Open the folder www located in folder '''*uc_server_2a\udrive\www''' (Note * is the path to the folder you extracted the server files) delete everything in '''www''' and copy your site into it.<br />
<br />
'''''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.<br />
<br />
e.g. <nowiki>http://localhost/somepage.html</nowiki><br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
== Summary ==<br />
This mini server is ideal for learning PHP its compact size allows you have several copies installed on a USB pen drive each with different test applications. I have covered how to secure the server and PHP in the real world you also must pay attention to securing your PHP scripts. Included with the support files is a guest book script that demonstrates some of the techniques used.<br />
<br />
When you change the scripts configuration file hopefully you will notice there is a fundamental problem, on the [[Mini Servers: Server 2a Guest book|next page]] I show how to resolve this, in addition cover some defensive programming.<br />
<br />
'''''[[#top | Top]]'''''<br />
<br />
----<br />
<br />
{|<br />
| [[Image:uc_small_logo.gif]] || [[User:Ric|Ric]]<br />
|}<br />
<br />
<br />
[[Category: UniCenter]]<br />
[[Category: Mini Servers]]<br />
[[Category: Oily Rag]]<br />
[[Category: Self Install]]</div>Ric