This document provides instructions for installing and configuring Apache web server with PHP, JSP, and MySQL on Windows XP. It includes downloading the necessary components, installing Apache, PHP, Java SDK, Tomcat, mod_jk, and MySQL. Detailed steps are provided for configuration of Apache and Tomcat to enable PHP and JSP functionality. The instructions also include testing the installations by accessing sample pages through Apache and Tomcat.
This document provides instructions for installing and configuring Apache web server with PHP, JSP, and MySQL on Windows XP. It includes downloading the necessary components, installing Apache, PHP, Java SDK, Tomcat, mod_jk, and MySQL. Detailed steps are provided for configuration of Apache and Tomcat to enable PHP and JSP functionality. The instructions also include testing the installations by accessing sample pages through Apache and Tomcat.
This document provides instructions for installing and configuring Apache web server with PHP, JSP, and MySQL on Windows XP. It includes downloading the necessary components, installing Apache, PHP, Java SDK, Tomcat, mod_jk, and MySQL. Detailed steps are provided for configuration of Apache and Tomcat to enable PHP and JSP functionality. The instructions also include testing the installations by accessing sample pages through Apache and Tomcat.
This document provides instructions for installing and configuring Apache web server with PHP, JSP, and MySQL on Windows XP. It includes downloading the necessary components, installing Apache, PHP, Java SDK, Tomcat, mod_jk, and MySQL. Detailed steps are provided for configuration of Apache and Tomcat to enable PHP and JSP functionality. The instructions also include testing the installations by accessing sample pages through Apache and Tomcat.
This is a quick guide to install and configure the Apache web-server with PHP and JSP support on a Windows XP Pro machine. Let me know if this helps you out! Feedback is appreciated. This is my first published guide. I made it for my own reference. Why not share?
Table of Contents Install & Configure Apache with PHP, JSP and MySQL on Windows XP Pro................................ 1 Download the Components.......................................................................................................... 2 Install Components ...................................................................................................................... 3 Apache ..................................................................................................................................... 3 PHP.......................................................................................................................................... 9 JSP......................................................................................................................................... 11 MySQL.................................................................................................................................... 21 Resources.................................................................................................................................. 28
Change Log: 2002/08/01 Changed workers.properties file the ajp14 stuff was removed
Modified php.ini. Changed the following: include_path = ".;c:\php\includes" session.save_path = C:\Temp session.cookie_path = \ 2002/07/31 Modified workers.properties file some paths were for older versions of Tomcat 2002/07/26 Modified step 5 of JSP install - hardcoded the Tomcat configuration into the Apache httpd.conf file. Also added MySQL installation instructions. Download the Components Before you can begin, you must first download all the required components. The components used in this tutorial are listed below. You may want to download the latest versions. The versions used in the tutorial are listed.
Apache Web Server http://httpd.apache.org/ http://httpd.apache.org/dist/httpd/binaries/win32/ apache_2.0.39-win32-x86-no_ssl.msi
PHP PHP Win32 Binaries http://www.php.net/ http://www.php.net/downloads.php php-4.2.1-Win32.zip PHP > Apache connector http://FReemIRC.com/miki/php4apache2.dll or http://Rafigh.com/miki/php4apache2.dll or http://IRan4You.com/miki/php4apache2.dll php4apache2.dll
JSP Tomcat (http://jakarta.apache.org/site/binindex.html) jakarta-tomcat-4.0.4.exe mod_jk http://www.acg-gmbh.de/mod_jk/ mod_jk.dll Java Download the latest Java SDK (We used Java 2 Standard Edition - J2SE) http://java.sun.com/ http://java.sun.com/j2se/1.4/download.html (get the SDK, not JRE) j2sdk-1_4_0_01-windows-i586.exe MySQL MySQL Database http://www.mysql.com/downloads/mysql.html Download the latest stable release for Windows mysql-3.23.51-win.zip MyODBC http://www.mysql.com/downloads/ Download the latest stable release of MyODBC for WinXP myodbc-2.50.39-nt.zip PHPMyAdmin http://www.phpmyadmin.net/ Download the latest stable release of PHPMyAdmin (.php files) phpMyAdmin-2.2.6-php.zip
Install Components Now that you have the necessary files, you can begin the installation process. We will install Apache, PHP, then the Java SDK and Tomcat.
Note to Windows2000 users: This guide should work with Windows2000 as well. Remember to replace C:\WINDOWS with C:\WINNT anywhere in this document.
Apache
1. Run apache_2.0.39-win32-x86-no_ssl.msi
2. Choose Run as a service for All Users Recommended when prompted.
3. Finish the installation program.
4. Test: Open http://localhost in a web browser.
PHP
1. Extract php-4.2.1-Win32.zip into C:\php 2. Replace c:\php\sapi\php4apache2.dll with the one you downloaded. 3. Copy and rename c:\php\php.ini-dist to C:\WINDOWS\php.ini 4. Open php.ini and change the following:
7. Test: Restart Apache & open http://localhost in a web browser. Hopefully you see the same thing as before:
8. Test: Create a new document called phpinfo.php and paste the following into it:
phpinfo.php <?php phpinfo(); ?>
Save the document under C:\Program Files\Apache Group\Apache2\htdocs. Now open http://localhost/phpinfo.php in a web browser. You should see something like the following:
JSP
1. Run j2sdk-1_4_0_01-windows-i586.exe
2. Run jakarta-tomcat-4.0.4.exe
3. Choose NT Service (NT/2k/XP only) on the Installation Options screen.
4. Copy mod_jk.dll to C:\WINDOWS\system32 5. Add the following at the end of your Apache httpd.conf file:
6. Create a new text document called workers.properties. Save this document in the following directory: C:\Program Files\Apache Tomcat 4.0\conf. Cut and paste this into the document:
10. Note: Always start Tomcat first and then start Apache. If you have to bounce Tomcat, remember to take down Apache first and restart it after Tomcat restarts.
Test: Start the Tomcat service. Open http://localhost:8080/ in a web browser. You should see something like the following:
Test out the JSP Examples as well as the Servlet Examples to make sure they work. If they do not work, something is wrong with your Tomcat installation. (Its much easier to stop the Tomcat service, uninstall it, and start over again. Troubleshooting this is not fun as theres little documentation available.)
Test: Start up the Apache2 service and open http://localhost/ in a web browser. Still working?
Test: Now try http://localhost/phpinfo.php to make sure thats still in working order.
Test: Open http://localhost/examples/ in a browser, you should see something like the following:
Follow the jsp/ link. You should recognize the page from before.
MySQL 1. Extract mysql-3.23.51-win.zip to a temporary directory and run Setup.exe.
Note: Keep the default location. It will save you from frustration later on.
You may delete the temporary setup files at this time.
2. Open a command prompt and run the following command to install mysql as a Windows Service:
C:\mysql\bin> mysqld-max-nt install
Note: It is advisable to close the Services utility while performing the --install or --remove operations, this prevents some odd errors.
3. Test: At the command prompt, type in NET START MySQL . This should start up the service you just setup.
Note: If you decided to install mysql somewhere besides the default c:\mysql, you may run into problems running it as a service. Check the mysql.err log file. It should tell you whats going on. It most likely has something to do with the my.cfg or my.ini files.
4. Test: Type in the command mysqlshow . It should display the current databases.
5. Extract myodbc-2.50.39-nt.zip to a temporary directory and run SETUP.EXE. (Dont worry if the Installer looks like its for Windows 3.1. Its normal.)
At this point, just click Close.
Note: You may delete the temporary installation directory at this time.
6. Extract phpMyAdmin-2.2.6-php.zip to your htdocs directory and rename it to something like phpmyadmin (e.g. C:\Program Files\Apache Group\Apache2\htdocs\phpmyadmin).
Note: You may want to use a .htaccess file or use the following to prevent random people from accessing PHPMyAdmin.
7. Open the config.inc.php in your favorite text editor and modify the following variables: