Developers.TestingEnvironment.Server.HTTP: Difference between revisions

From Shareaza Wiki
Jump to navigation Jump to search
(Importing page from Tikiwiki)
 
m (1 revision)

Revision as of 20:09, 20 June 2009

If you want to install an HTTP server, I recommend using Apache2 from Apache.org. More comprehensive instructions should be posted to this page later about how to download and install the server (or links to pages that do); but Apache.org has very comprehensive help documentation.

If you want to take a hand at installing PHP, MySQL, and Perl in conjunction with an Apache server, check out this article at programmerworld.net for detailed (and slightly outdated) instructions on how you might go about doing that. (Can someone post a better article in place of this reference? :) )

Installing PHP5

If you want to install PHP5, I recommend downloading the .ZIP package from PHP.net that includes all of the extra modules. You will probably want these modules later, so you might as well install them now. The binary installer does not include these extras yet. Go figure. The .ZIP package contains instructions about how to add lines to your Apache configuration to make it work. I have used the following additional .conf file as an include to configure use of PHP (assuming PHP is installed to C:/php):

[code phpinit.conf]##################################

  1. PHP Type Declarations (Common) #

AddType application/x-httpd-php .php .php5 .php4 .php3

DirectoryIndex index.html index.html.var index.htm index.htm.var index.php default.html default.html.var default.htm default.htm.var default.php

  1. Configure PHP for CGI #
  2. (Vulnerable to Attack)#
  1. ScriptAlias /php/ "c:/php/"
  1. For PHP 4
  2. Action application/x-httpd-php "/php/php.exe"
  1. For PHP 5
  2. Action application/x-httpd-php "/php/php-cgi.exe"
  1. Configure PHP as Apache Module #
  1. Configure the path to php.ini

PHPIniDir "C:/php"

  1. ... or this line ...
  2. SetEnv PHPRC "C:/php"
  1. For PHP 4
  2. LoadModule php4_module "c:/php/php4apache2.dll"
  1. For PHP 5

LoadModule php5_module "c:/php/php5apache2.dll"</source>

This .conf file adds an alias to a dedicated php directory if you want to place scripts in an isolated environment (perhaps with execution privelages or away from your website or system drive).

[code phpalias.conf]Alias /cgi-bin/php "C:/isolated/php"

<Location /cgi-bin/php>

  1. Options

</Location></source>