Configure integration WIN + APACHE + PHP + MYSQL + TCOMCAT (or RESIN) full manual

xiaoxiao2021-03-06  39

System Requirements:

Hardware can run the operating system

Win2K, WinXP or Win2003 operating system

Preparation:

Software list: (This is complete, the following software version is complete)

1, apache_2.0.47-win32-x86-no_ssl (Apache Web Server)

2, PHP-4.3.3-Win32 (PHP language parser)

3, MySQL-4.0.12-Win (mysql database)

4, J2SDK-1_4_2-Windows-I586 (Java Language Environment)

5, JAKARTA-TOMCAT-5.0.9 (Tomcat JSP Analysis Server)

6, Resin-3.0.3 (RESIN JSP Analysis Server)

7, MOD_JK_1.2.5_2.0.47.dll (Integrated Apache Tomcat Plus)

8, mm.mysql-2.0.4-bin.jar (JSP Access connection mysql file)

start installation:

First, APAHCE PHP MySQL installation configuration

1. Install apache_2.0.0.47-win32-x86-no_ssl, the program default installation path is: c: / apache2 / program files / apache group /, you need to make its installation path to: C: /

(You can also do it, mainly for modifying the configuration for modification).

2. After the installation is complete, the Apache service is automatically loaded, then open the browser, browse: http: // localhost, appear Apache Welcome page (this step needs to put the file in the C: / Apache2 / HTDOCS directory "index.html.en "Change to" index.html ", can display); if this step is abnormal, please check the installation source file, reinstall.

3. Install the PHP-4.3.3-win32, the general downloaded PHP file is a free-installed compressed package, unzipped to C: / PHP.

4. Configure PHP and Apache to resolve the PHP program.

PHP configuration: Remove the "php.ini-dist" in the C: / PHP / directory "php.ini" and copy it to the C: / Windows / System32 (Win2K directory: C: / Winnt / System32)

Apache configuration:

C: /APAHCE2/CONF/HTTPD.CONF

httpd.conf

D This configuration file finally adds the following statement to support the PHP program:

Scriptalias / PHP / "C: / PHP /"

AddType Application / X-httpd-php .php3

AddType Application / X-httpd-php .php

AddType Application / X-httpd-php .phtml

Action Application / X-httpd-php "/ php/Php.exe"

5. Restart the Apache server, write the following statement with the editor:

PHPINFO ();

?>

Save the file name "Test.php" to the C: / Apache2 / HTDOCS directory, then open the browser, browse: http://localhost/test.php, the basic information of PHP will explain the configuration. Strictly follow the above to explain the installation configuration, will succeed once. 6. Install MySQL-4.0.12-win, press "Next" to install successfully, then execute "winmysqladmin.exe" in the c: / mysql / bin directory, the initial information of MySQL appears, indicating successful installation.

7. PHP even slightly this, there is no problem.

He you can take a break here, ready for the following long processes ...

Second, install JDK and Tomcat

1. Install the J2SDK-1_4_2-Windows-i586, JDK must be installed before Tomcat and Resin, the default installation path can be installed.

2. Install Jakarta-Tomcat-5.0.9, the default installation path can be installed.

3. Copy mm.mysql-2.0.4-bin.jar files to C: /J2SDK1.4.2/Lib and C: / Tomcat 5.0 / Common / LIB

4. Set an environment variable (desktop -> My Computer -> Right click -> Select "Properties" -> Advanced -> Environment Variables), all settings are in the system variable bar.

New -> Variable Name: java_home

-> Variable: C: /J2SDK1.4.2

New -> Variable Name: Tomcat_home

-> Variable: C: / Tomcat 5.0

New -> Variable Name: Path

-> Variable value:.; C: /J2SDK1.4.2/bin; (front ".;" Must have

Modify add environment variables ClassPath (if you don't have this variable name, new)

-> Increase the variable:.; C: /J2SDK1.4.2/lib/dt.jar; c: /j2sdk1.4.2/lib/tool.jar;

C: /j2sdk1.4.2/lib/netcomponents.jar;

C: /j2sdk1.4.2/lib/mm.mysql-2.0.4-bin.jar;

C: / Tomcat 5.0 / Common / Classes;

C: / Tomcat 5.0 / Common / LIB;

C: / Tomcat 5.0 / Common / lib / servlet-api.jar;

(In front "." "" Must have)

5. Start the Tomcat server, open the browser, browse: http: // localhost: 8080 /, the Tomcat Welcome page; if this step appears, check the installation source file, reinstall.

Third, integrated Apache Tomcat server

1. Copy the MOD_JK_1.2.5_2.0.47.dll file to the C: / Apache2 / Modules directory.

2. Apache configuration:

C: /APAHCE2/CONF/HTTPD.CONF

httpd.conf

The following statement is added to this configuration file to support JSP programs:

LoadModule JK_Module Modules / MOD_JK_1.2.5_2.0.47.dll

JKWorkersfile "C: / Tomcat 5.0 / conf / workers.properties"

JKMOUNT / Servlet / * ajp13

JKMount /*.jsp Ajp13

3. View if the port "8009" is commented in the C: / Tomcat 5.0 / conf / server.xml file, if it is consistent with my version, don't modify it. 4. In the C: / Tomcat 5.0 / conf / directory, the new file name "workers.properties" will be created as follows to the new files in Workers.Properties.

Workers.properties

# Only copy the following:

# This is currently modified according to the installation directory

Workers.tomcat_home = C: / Tomcat 5.0

Workers.java_home = c: /j2sdk1.4.1_01

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.tomcat_home) $ (ps) class Classes

Worker.inprocess.class_path = $ (workers.tomcat_home) $ (PS) LIB $ (PS) jaxp.jar

Worker.inprocess.class_path = $ (workers.tomcat_home $ (ps) lib $ (ps) Parser.jar

Worker.inprocess.class_path = $ (workers.tomcat_home) $ (PS) Common $ (PS) LIB $ (PS) Jasper.jar

Worker.inprocess.class_path = $ (workers.tomcat_home) $ (ps) Common $ (PS) LIB $ (PS) servlet.jar

Worker.inprocess.class_path = $ (workers.tomcat_home) $ (PS) Common $ (PS) LIB $ (PS) WebServer.jar

Worker.inprocess.class_path = $ (workers.java_home) $ (ps) LIB $ (PS) Tools.jar

Worker.inprocess.cmd_line = -config

Worker.inprocess.cmd_line = $ (workers.tomcat_home /conf/jni_server.xml

Worker.inprocess.cmd_line = -home

Worker.inprocess.cmd_line = $ (workers.tomcat_home)

Worker.inprocess.jvm_lib = $ (workers.java_home) $ (PS) JRE $ (PS) BIN $ (PS) Classic $ (PS) jvm.dll

Worker.inprocess.stdout = $ (workers.tomcat_home) $ (ps) inProcess.stdout

Worker.inprocess.stderr = $ (workers.tomcat_home) $ (ps) inProcess.stderrWorker.inProcess.sysprops = Tomcat.Home = $ (workers.tomcat_home)

5. Go to this apache and Tomcat to complete, restart the Apache and Tomcat servers,

Write the following with the editor:

<% @ Page ContentType = "text / html; charset = GB2312"%>

Hi-JSP Experiment </ Title></p> <p></ hEAD></p> <p><body></p> <p><%</p> <p>String msg = "this is jsp test! See this passage, congratulations, success!";</p> <p>OUT.PRINT ("Hello World!");</p> <p>%></p> <p><h3> <% = msg%> </ h3></p> <p>The current date and time is <% = new java.util.date ()%></p> <p><br></p> <p><%</p> <p>String str = "Using TRIM () and substruct () can be very useful";</p> <p>Out.println (STR);</p> <p>%></p> <p></ body></p> <p></ html></p> <p>Save the file name "Test.jsp" to the C: / Tomcat 5.0 / WebApps / root directory, then open the browser, browse: http: // localhost: 8080 / test.jsp, if normal, then change the address to: http: //localhost/test.jsp Displays the normal instructions. Strictly follow the above to explain the installation configuration, will succeed once.</p> <p>Fourth, integrated apache Tomcat mysql</p> <p>This step is relatively simple, but it is also the least easy to success, and the JSP's MySQL driver has been placed in the corresponding directory, and the environment variable is also set, so it is just whether the JSP can connect to the mysql database.</p> <p>1. Test 1, write with the editor as follows:</p> <p><% @ Page ContentType = "text / html; charset = GB2312"%></p> <p><%</p> <p>Java.sql.connection conn;</p> <p>Java.lang.string strconn;</p> <p>Class.Forname ("Org.gjt.mm.mysql.driver"). NewInstance ();</p> <p>Conn = java.sql.driverManager.getConnection ("JDBC: MySQL: // LocalHost / Test", "root", "");</p> <p>%></p> <p>Note: The database is here: TEST connection data inventory username is: the root password is empty. Modify according to your own database.</p> <p>Save the file name "Test-mysql.jsp" to the C: / Tomcat 5.0 / WebApps / root directory, then open the browser, browse: http: // localhost: 8080 / test-mysql.jsp or http: // localhost / Test-mysql.jsp, after running, if the blank page is displayed, the connection database is successful, otherwise it is not successful, and it is gradually configured. 2. Test 2, write with the editor as follows:</p> <p><% @ page contenttype = "text / html; charset = GBK"%></p> <p><% @ page language = "java" import = "java.sql. *"%></p> <p><%</p> <p>Connection conn = NULL;</p> <p>Class.Forname ("Org.gjt.mm.mysql.driver"). NewInstance ();</p> <p>Conn = java.sql.driverManager.getConnection ("JDBC: MySQL: // LocalHost / Test", "root", "");</p> <p>IF (conn == null) {</p> <p>System.out.println ("Get Conn Error");</p> <p>}</p> <p>Statement Stmt = conn.createstatement ();</p> <p>ResultSet RS_Result = NULL;</p> <p>%></p> <p><html></p> <p><HEAD></p> <p><title> Test </ Title> </ HEAD></p> <p><body></p> <p><%</p> <p>Rs_Result = stmt.executequery ("Select * from guestbook");</p> <p>String name;</p> <p>While (RS_RESULT.NEXT ())</p> <p>{</p> <p>Name = rs_Result.getstring ("name");</p> <p>%></p> <p><% = Name%></p> <p><%</p> <p>}</p> <p>Rs_Result.close ();</p> <p>Stmt.close ();</p> <p>CONN.CLOSE ();</p> <p>%></p> <p></ body></p> <p></ html></p> <p>Save the file name "Test-mysql2.jsp" to the C: / Tomcat 5.0 / WebApps / root directory, then open the browser, browse: http:// localhost: 8080 / test-mysql2.jsp or http: // localhost / Test-mysql2.jsp, after running.</p> <p>V. Install RESIN, integrate Apache Resin</p> <p>1. If you don't start the other JSP parsing server on the machine, if you start, please turn off the service.</p> <p>2. Directly extract RESIN-3.0.3.zip to C: /</p> <p>3. Use the command in character mode: c: /resin-3.0.3/bin/httpd -install</p> <p>Install Resin as a service of the system, then start RESIN in the service.</p> <p>Delete service command: c: /RESIN-3.0.3/bin/httpd -remove</p> <p>4. Open the browser, browse: http: // localhost: 8080, if there is RESIN information, the RESIN service has started.</p> <p>5. Apache configuration:</p> <p>C: /APAHCE2/CONF/HTTPD.CONF</p> <p>httpd.conf At this configuration file, the following statement is finally added:</p> <p>LoadModule Caucho_Module C: /RESIN-3.0.3/Libexec/apache-2.0/mod_caucho.dll</p> <p><Ifmodule mod_caucho.c></p> <p>ResinconfigServer Localhost 6802</p> <p><Location / caucho-status></p> <p>SetHandler Caucho-Status</p> <p></ Location></p> <p></ Ifmodule></p> <p>AddHandler Caucho-Request JSP</p> <p><Location / servlet / *></p> <p>SetHandler Caucho-Request</p> <p></ Location></p> <p>Save and restart apache.</p> <p>6. RESIN configuration:</p> <p>C: /RESIN-3.0.3/conf/RESIN.CONF</p> <p>Resin.conf</p> <p>Modify the default directory, the red part is modified:</p> <p><server></p> <p><host id = ""></p> <p><Document-Directory> C: / Apache2 / HTDOCS </ Document-Directory></p> <p>...</p> <p></ host></p> <p></ server></p> <p>Save, save the RESIN service, store the edited JSP file to the C: / Apache2 / htdocs directory, then open the browser to browse, you can freely bleach between PHP and JSP.</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-79200.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="79200" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.040</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'N5g2a6d600c_2FtDYbtLguMstmLniQmebeMgnuAWGXz9wx4C5Ji08El5hkHD0AHogjmFVReLF13Xg1I0xEnJdx7w_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>