Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

In Depth Win32 Apache 2.0.49 PHP 5 etc How To


Austin519

Recommended Posts

Posted

Hey guys...okay so awhile back I released a big writeup on how to get everything running under Win32 since I was doing it for development. It's been a year since I released that and it sounds like it helped a lot of people, and I had my RAID array crash so I had to start over, and I went ahead and rewrote it for the newer stuff that's out. So I'm releasing a slightly updated one that takes care of the latest updates. This will walk you through step by step on how to install:

 

Apache 2.0.49 with SSL

Mod_Perl 1.99_09/ActivePerl 5.8.0.806

openSSL 0.9.7d (and SSL certificate creation instead of paying for one)

PHP 5.0.0

cURL 7.12.0

phpMyAdmin 2.5.7

MySQL 4.0.20d

MyODBC 3.51.8

 

Under a Win2k/XP environment (and probably NT as well) without any trouble, and without recompiling a thing. You should be able to do this with just about no knowledge of any of the above things ;). Since I can't attach a file here I'll just post the actual TXT...sorry if it's a bit long. Hope it helps people.

 

Austin519

Posted

TITLE: WIN32 WEBSERVER AND RELATED FUNCTIONALITY INSTALLATION MANUAL

FILENAME: Apache_with_functionality_installation.txt

AUTHOR: AUSTIN RENFROE

EMAIL: AUSTIN519 (at) AOL.COM

WEB: WWW.MODSP.COM

DATE: 07/20/2004

COMMENTS: LONG LIVE OPENSOURCE!

 

 

------------------------------------------------------------------------------------------------

DESCRIPTION:

------------------------------------------------------------------------------------------------

 

This installation manual covers full installation and integration of the following under Win32 (tested under Windows 2000/XP):

Apache 2.0.49

Mod_Perl 1.99_09/ActivePerl 5.8.0.806

mod_ssl 2.0.49

openSSL 0.9.7d

PHP 5.0.0

cURL 7.12.0

phpMyAdmin 2.5.7

MySQL 4.0.20d

MyODBC 3.51.8

MySQLCC 0.9.4

 

When reading these instructions it may feel like I am jumping around a lot. Well, I am, but there is a method to my madness. You will most likely want to test your Apache server to make sure everything is going well each time you add a new functionality (command window: (path to apache bin folder)> apache -k start), and doing it in EXACTLY this order will allow you to test your server at just about every step.

 

Note: It's a good idea to try to keep all your installations as close to root as possible and without any space characters. This is my setup, which has served me well (this of course only a suggestion, the instructions are directory independent):

 

c:\webserver

c:\webserver\apache

c:\webserver\apache\mod_ssl

c:\webserver\cgi-bin

c:\webserver\curl

c:\webserver\mysql

c:\webserver\mysqlcc

c:\webserver\open_ssl

c:\webserver\perl

c:\webserver\php

c:\webserver\www (my html root)

c:\webserver\www\phpmyadmin\

 

------------------------------------------------------------------------------------------------

STEP BY STEP INSTRUCTIONS:

------------------------------------------------------------------------------------------------

 

1) Obtain the required files for installation. This has been tested under Windows 2000 SP4.

- www.php.net : PHP 5.0.0 (php-5.0.0-Win32.zip)

- www.perl.com : ActivePerl 5.8 (ActivePerl-5.8.0.806-MSWin32-x86.msi)

- perl.apache.org : mod_perl 2.0 (mod_perl-2.0-current.tar)

- hunter.campbus.com : Apache 2.0.49 with mod_ssl and open_ssl (Apache_2.0.49-Openssl_0.9.7d-Win32.zip), open_ssl 0.9.7d

 

(Openssl-0.9.7d-Win32.zip)

- www.mysql.com : MyODBC 3.51.8 (MyODBC-standard-3.51.8-win.exe), MySQL 4.0.20d (mysql-4.0.20d-win.zip), and MySQLCC 0.9.4

 

(mysqlcc-0.9.4-win32.zip)

- curl.sourceforge.net : cURL 7.12.0 (curl-7.12.0-win32-ssl.zip)

- www.stunnel.org/download/binaries.html : libssl.dll for openssl 0.9.7d

- www.phpmyadmin.net : phpMyAdmin 2.5.7 (phpMyAdmin-2.5.7-pl1.zip)

 

2) Extract Apache and edit /apache/conf/httpd.conf (search for @@) replacing your personal server information, and setting up the security for your directories.

 

3) Extract PHP and follow its install.txt (modifying php.ini as directed and enabling register_globals for using osCommerce).

 

php.ini can be placed in /apache/ directory instead in your systemroot directory (i.e. WINNT) for easy access (and I would suggest doing this, it's easier to back up too).

 

4) Change the line starting with "DirectoryIndex" to read:

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

 

(add any other indexes you may want to but that should take care of most)

 

5) Copy libmysql.dll from /php/ into the /apache/bin/ folder

 

6) Add the following to /apache/conf/httpd.conf:

 

(at the bottom of the LoadModules section, do not include this line)

########################## PHP ########################

LoadModule php5_module (path to php folder)/php5apache2.dll

 

(at the bottom of the AddType section, do not include this line)

########################## PHP ########################

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

 

7) Uncomment mod_ssl.so from your /apache/conf/httpd.conf file

 

8) Extract the open ssl zip to /open_ssl/, copy the file openssl.cnf from /php/openssl/ to your /open_ssl/ directory, and create your SSL certificates from the command window using openssl.exe in /open_ssl/ as stated below (skip this if you have bought your own),

 

Note: I DID NOT WRITE THIS PART, the source is http://tud.at/programm/apache-ssl-win32-howto.php3

(path to openssl)> openssl req -config openssl.cnf -new -out my-server.csr

-This creates a certificate signing request and a private key. When asked for "Common Name (eg, your websites domain name)", give the exact domain name of your web server (e.g. www.my-server.dom). The certificate belongs to this server name and browsers complain if the name doesn't match.

 

(path to openssl)> openssl rsa -in privkey.pem -out my-server.key

-This removes the passphrase from the private key. You MUST understand what this means; my-server.key should be only readable by the apache server and the administrator. You should delete the .rnd file because it contains the entropy information for creating the key and could be used for cryptographic attacks against your private key.

 

(path to openssl)> openssl x509 -in my-server.csr -out my-server.cert -req -signkey my-server.key -days 365

-This creates a self-signed certificate that you can use until you get a "real" one from a certificate authority.

 

(Which is optional; if you know your users, you can tell them to install the certificate into their browsers.) Note that this certificate expires after one year, you can increase -days 365 if you don't want this.

 

If you have users with MS Internet Explorer 4.x and want them to be able to install the certificate into their certificate storage (by downloading and opening it), you need to create a DER-encoded version of the certificate:

(path to openssl)> openssl x509 -in my-server.cert -out my-server.der.crt -outform DER

 

Create an Apache/conf/ssl directory and move my-server.key and my-server.cert into it.

 

9) Edit ssl.conf:

- Change the following line:

 

SSLMutex file:logs/ssl_mutex

To:

SSLMutex default

 

Unless you have a mutex semaphore ready (for multithreading, most people will not have this, and if you don't know what any of that means, change it)

- Remove IfDefines for Win32 so ssl always runs on default (versus having to type the -ssl command to apache each time)

- Add website info and email

- Set vhost to website address (ex: www.mysite.com)

- Set proper directories

 

10) Install MySQL Servers and Clients and MySQL Control Center

 

11) Run /mysql/bin/winmysqladmin.exe to create a my.ini, remember your username and password

 

12) Right click the winmysqladmin icon and install service, then start the service

 

13) Using MySQL Control Center, connect as root@localhost:3306 and add two users:

-UserName:YourUserName Host: localhost Password: YourPassword

-UserName:YourUserName Host: build Password: YourPassword

and give both all priveleges with grant option, and global access only. The UserName and Password is the one you supplied in (11).

 

14) Remove the guest (blank) and root accounts (4 total)

 

15) Install MyODBC

 

16) Install ActivePerl

 

17) Extract mod_perl into /apache/modperl/ directory and execute the following commands in a command window:

 

(path to modperl)> perl Makefile.PL MP_AP_PREFIX=\Path\to\Apache2

(path to modperl)> nmake

(path to modperl)> nmake test

(path to modperl)> nmake install

 

18) Add the following lines to httpd.conf (as the command window shows in the previous statement)

 

########################## Perl #######################

LoadFile "(path to perl folder)/bin/perl58.dll"

LoadModule perl_module modules/mod_perl.so

 

19) Most people will want to install curl (especially authorize.net gateway users, it's required for AIM integration). Extract curl to your /curl/ directory and copy in libeay32.dll (from your /php/ directory) and libssl32.dll (downloaded from the site listed above) to that directory. Configure whatever you need to to point to curl.exe (for osCommerce users, you're probably using my Authorize.net Consolidated Contribution here: http://www.oscommerce.com/community/contributions,2278)

 

20) Extract phpMyAdmin to your /www/ folder, and edit it's config.inc.php3 file as directed in the file's instructions. Test phpMyAdmin by going to localhost/(phpMyAdmin folder) in your browser.

 

END OF FILE

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...