Apache + php + jsp + mysql + phpmyadmin Overview

Source: Internet
Author: User
Apache + php + jsp + mysql + phpmyadmin full strategy-Linux Enterprise Application-Linux server application information. The following is a detailed description. Go to: Required Software List: (this configuration includes the following software versions)
Jakarta-tomcat-5.0.29.exe
Apache_2.0.52-win32-x86-no_ssl.exe
Php-5.0.2-Win32.zip
Mysql-4.0.22-win.zip
J2sdk1.4.1.exe
Mod_jk_1.2.6_2.0.50.dll
Mysql-2.0.4-bin.jar.
PhpMyAdmin-2.6.0-pl2.zip
Start installation:
1. installation and configuration of Apahce + PHP + MySQL
1. Install the apache_2.0.52-win32-x86-no_ssl, set the installation path as prompted as needed (my path is d:/usr /). After the installation is complete, if you move the APACHE directory, the parameters under apache2 must be changed. modify the configuration file httpd In the CONF directory of apache. conf. In this example, d:/usr/apache2/conf/httpd. conf
(1) ServerRoot: apche program directory (in this example, d:/usr/apache2)
(2) ServerAdmin: Server administrator E-MAIL
(3) port: the service port. The default value is 80.
(4) ServerName: The network ID of the computer, which must be consistent with the actual one; otherwise, unexpected problems may occur.
(5) DocumentRoot: Default webpage file directory (in this example, d:/usr/www)
(6) DirectoryIndex: the default page, with php support added (for example, below)
DirectoryIndex index.html index.htm index. php index. php3 index. php4
(7) ScriptAlias (script alias), CGI program directory
ScriptAlias/cgi-bin "d:/usr/apache2/cgi-bin"
2. Install the php-5.0.2-Win32 unzipping and unzip the path customized (in this example, d:/usr/php5 ).
3. Configure PHP and Apache to parse the php program.
PHP configuration:
Change "PHP. ini-dist" in the php Directory to "php. ini" and
Modify php. ini as follows:
(1) doc_root: Same as APACHE's HTDOCS. In this example, d:/usr/www
(2) extension_dir in this example: d:/usr/php5/ext
(3) include_path in this example: d:/usr/php5/includes
(4) Remove the semicolon in front of extension = php_mysql.dll and copy the LIBMYSQL. DLL file in the php Directory to c: \ winnt \ system32.
Apache configuration:
Add the following statement at the end of the APACHE configuration file to support the php program:
ADDlanguage zh-cn. cn
Defaultlanguage zh-cn
Adddefacharcharset GB2312
ScriptAlias/php/"d:/usr/php5 /"
LoadFile d:/usr/php5/php5ts. dll
LoadModule php5_module d:/usr/php5/php5apache2. dll
PHPINIDir d:/usr/php5/php. ini
AddType application/x-httpd-php. php. php3. php4. phtml
AddType application/x-httpd-php-source. phps
You can modify the contents and directories that are inconsistent with the actual ones.
4. Restart the Apache server and write the following statement in the Editor:
Phpinfo ();
?>
Save the file name as "test. php "to the user's main directory (in this example, d:/usr/www) directory, then open the browser, browse: http: // localhost/test. php. If the basic PHP information is displayed, the configuration is successful.
5. Install MySQL-4.0.12-win, always press "next" to install successfully, and then run "winmysqladmin.exe" in the C: \ mysql \ bin directory, the initial information of mysql appears, indicating that the installation is successful.
6. Install phpMyAdmin
Decompress phpmyadmin-2.6.0-pl2.zip to a directory. In this example, d:/usr/phpMyAdmin. Go to the configuration file config. inc. php In this directory.
Change $ cfg ['pmaabsoluteuri '] to http: // localhost/phpMyAdmin
Modify $ cfg ['blowfish _ secret'] = 'admin ';
Modify $ cfg ['servers'] [$ I] ['auth _ type'] = 'cooker ';
Change $ cfg ['servers'] [$ I] ['user'] to a MySQL user
Change $ cfg ['servers'] [$ I] ['Password'] To the MySQL password.
The above is the basic content of phpMyAdmin configuration. Other configurations can be performed as needed.
Edit the apache configuration file httpd. conf and add the following statement at the end:
Php_admin_flag engine on
Php_admin_flag safe_mode off
Alias/phpMyAdmin "d:/usr/phpMyAdmin"

DirectoryIndex index. php
Options Indexes MultiViews
AllowOverride None
Order allow, deny
Allow from all
Php_admin_flag engine on
Php_admin_flag safe_mode off
Php_admin_value open_basedir none
Php_admin_value open_basedir "d:/usr/phpMyAdmin"

The preceding directory path is modified as needed.
7. Test apache + php + mysql
Enter http: // localhost/phpMyAdmin In the ie Address Bar. If phpMyAdmin is displayed, the configuration is successful.
Ii. Install JDK and Tomcat
1. Install jakarta-tomcat-5.0.29.exe after j2sdk1.4.1. JDK must be installed before tomcat. In this example, the installation path is d:/usr/

2. Copy the mm. mysql-2.0.4-bin.jar file to the j2sdk subdirectory lib and Tomcat subdirectory common \ lib, copy mod_jk_1.2.6_2.0.50.dll
Go to the apache subdirectory moudles.
3. Configure APACHE + tomcat + jsp
(1) Add it after the apache configuration file
LoadModule jk_module modules/mod_jk_1.2.6_2.0.50.dll
JkWorkersFile "d:/usr/Tomcat 5.0/conf/workers. properties"
JkMount/servlet/* ajp13
JkMount/*. jsp ajp13
(2) create d:/usr/Tomcat 5.0/conf/workers. properties as follows:

Workers. properties
Workers. CATALINA_HOME = d: \ usr \ Tomcat 5.0
Workers. JAVA_HOME = d: \ usr \ j2sdk1.4
Ps = \
# Worker. list = ajp13
Worker. list = ajp12, ajp13
Worker. ajp12.port = 8007
Worker. ajp12.host = localhost
Worker. ajp12.type = ajp12
Worker. ajp12.lbfactor = 1
Worker. ajp13.port = 8009
Worker. ajp13.host = localhost
Worker. ajp13.type = ajp13
Worker. ajp13.lbfactor = 1
Worker. loadbalancer. type = lb
Worker. loadbalancer. balanced_workers = ajp12, ajp13
Worker. inprocess. type = jni
Worker. inprocess. class_path = $ (workers. CATALINA_HOME) $ (ps) classes
Worker. inprocess. class_path = $ (workers. CATALINA_HOME) $ (ps) lib $ (ps) jaxp. jar
Worker. inprocess. class_path = $ (workers. CATALINA_HOME) $ (ps) lib $ (ps) parser. jar
Worker. inprocess. class_path = $ (workers. CATALINA_HOME) $ (ps) common $ (ps) lib $ (ps) jasper. jar
Worker. inprocess. class_path = $ (workers. CATALINA_HOME) $ (ps) common $ (ps) lib $ (ps) servlet. jar
Worker. inprocess. class_path = $ (workers. CATALINA_HOME) $ (ps) common $ (ps) lib $ (ps) webserver. jar
Worker. inprocess. class_path = $ (workers. JAVA_HOME) $ (ps) lib $ (ps) tools. jar
Worker. inprocess. worker _line =-config
Worker. inprocess. worker _line = $ (workers. CATALINA_HOME)/conf/jni_server.xml
Worker. inprocess. worker _line =-home
Worker. inprocess. worker _line = $ (workers. CATALINA_HOME)
Worker. inprocess. jvm_lib = $ (workers. JAVA_HOME) $ (ps) jre $ (ps) bin $ (ps) classic $ (ps) jvm. dll
Worker. inprocess. stdout = $ (workers. CATALINA_HOME) $ (ps) inprocess. stdout
Worker. inprocess. stderr = $ (workers. CATALINA_HOME) $ (ps) inprocess. stderr
Worker. inprocess. sysprops = tomcat. home =$ (workers. CATALINA_HOME)
(3) set the environment variables (desktop> my computer> right-click and choose Properties> advanced> environment variables> system variables) as follows:
JAVA_HOME (variable name) d: \ usr \ j2sdk1.4 (variable value)
PATH (variable name).; % JAVA_HOME \ bin; (variable value)
CATALINA_HOME (variable name) d: \ usr \ tomcat 5.0 (variable value)
CATALINA_BASE (variable name) d: \ usr \ tomcat 5.0 (variable value)
CALSSPATH (variable name)
.; % JAVA_HOME % libdt. jar; % JAVA_HOME % libtools. jar; % CATALINA_HOME % commonlibservlet. jar (variable value)
(5) edit the server. xml file under tomcat \ conf and add the following content:


Directory = "logs" prefix = "home_access_log." suffix = ". txt"
Pattern = "common" resolveHosts = "false"/>




Directory = "logs" prefix = "home_access_log." suffix = ". txt"
Pattern = "common" resolveHosts = "false"/>

All configurations have ended.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.