Red Flag Linux4.1 Install APAHCE + TOMCAT + PHP + MYSQL + vSFTPD Record

xiaoxiao2021-03-06  47

Red Flag Linux4.1 Install APAHCE TOMCAT PHP MYSQL vSFTPD Record

Installer: lfm09@163.com Installation Time: 2004.12.13-15 Operating System: Red Flag Desktop Linux4.1

These days tried to install the Web FTP server under the Red Flag Linux desktop version 4.1, has been successfully installed, now introduced my installation process as follows to give a reference for similar needs. The entire installation process is divided into three parts, namely: 1. Installation of Tomcat MySQL, two, Apache PHP installation, three, ftp (vsftpd) installation. Wherein, both the first and third parts are independent, but the second part is done on the basis of completing the first part installation.

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

The first part install JDK Tomcat mysql

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

This step is installed to support JSP, HTML, HTM webpage, so use JDK1.5.0 Tomcat5.5.4 mysql4.1.7, which are the current software's latest stable version (non-test version), this is now popular, classic Configuration. No Apache and support PHP are not installed, mainly considering that netizens with desktop version Linux is basically a personal website, mainly for learning, testing JSP, and use these configurations, which is more than enough, and it is more lightweight.

To install Apache and PHP, please refer to the contents of the second part.

Note that in the following installation, the headband ## represents the operation of the root user under the system terminal, does not input the ## when actually operation.

First, download the relevant necessary software, put it in a unified directory (such as / tmp / mydown):

1, download the JDK1.5.0 installation package (ie java5.0), file name: JDK-1_5_0-linux-i586-rpm.bin

Download link: http://java.sun.com/j2se/1.5.0/download.jsp

2, download Tomcat installation package (support JSP), file name: jakarta-tomcat-5.5.4.tar.gz

Download link: http://apache.freeelamp.com/jakarta/tomcat-5/v5.5.4/bin/jakarta-tomcat-5.5.4.tar.gz

3, download mySQL installation package (database software), file name: mysql-standard-4.1.7-pc-linux-i686.tar.gz

Download link: http://dev.mysql.com/get/downloads/mysql-4.1/mysql-standard-4.1.7-pc-linux-i686.tar.gz/from/pick

4, download MySQL JDBC driver, file name: mysql-connector-java-3.0.16-ga.tar.gz

Download link: http://dev.mysql.com/downloads/connector/j/3.0.html

Second, install the software

1. Install JDK (because JDK contains JRE, if JRE is installed when the original LUMAQQ is installed, please uninstall the JRE RPM package, save 85M space)

(1) Install:

#CD / TMP / MYDOWN

#. / jdk-1_5_0-linux-i586-rpm.bin

This way, JDK is installed to /usr/java/jdk1.5.0 directory

(2) Edit file / etc / profile, in the final join:

Export java_home = / usr / java / jdk1.5.0

Export ClassPath = $ ClassPath: $ java_home / lib / Tools.jar: $ java_home / lib / dt.jar :.

Export Path = $ PATH: $ java_home / bin

(3) To make new configurations take effect, run #Source / etc / profile

(4) Test, write a Java program with a text editor to verify, save in / tmp / mydown directory, file name: HelloWorld.java, enter the following:

Public class helloworld {

Public static void main (string args []) {

System.out.Println ("Hello, Wrold");

}

}

Then, execute under the terminal:

#CD / TMP / MYDWON

#javac helloworld.java

#java helloworld

At this time, if "Hello, World" appears, you will show your Java compilation and run the environment.

2, install Tomcat

(1) Right-click the Jakarta-Tomcat-5.5.4.tar.gz file icon in the graphical environment, select the extract to the / usr / local directory.

For convenience, execute under the terminal:

#CD / USR / LOCAL

#LN-S Jakarta-Tomcat-5.5.4 Tomcat

(2) Edit file / etc / profile, in the final join: export catalina_home = / usr / local / tomcat

(3) If the system is required to start Tomcat automatically (without this requirement, you don't have to do this), please modify /usr/local/tomcat/bin/startup.sh as:

Export java_home = / usr / java / jdk1.5.0

Export ClassPath = $ ClassPath: $ java_home / lib / Tools.jar: $ java_home / lib / dt.jar :.

Export Path = $ PATH: $ java_home / bin

Export catalina_home = / usr / local / Tomcat

/us/local/tomcat/bin/catalina.sh start

And add: /usr/local/tomcat/bin/startup.sh in /etc/rc.d/rc.local

(4) Execution #Source / etc / profile makes the configuration take effect, run /usr/local/tomcat/bin/startup.sh Start Tomcat

(5) Test, enter: http: // localhost: 8080, if the Tomcat welcomes page appears, the installation is successful.

3, install MySQL (I installed the RPM package, it is recommended to download the mysql RPM package, ", Server, Client, and Development Pack so installation is simple, no additional)

(1) Right-click the mysql-standard-4.1.7-pc-linux-i686.tar.gz file icon in the graphical environment, select the extract to the / usr / local directory. For convenience, execute under the terminal:

#CD / USR / LOCAL

#LN-S Mysql-Standard-4.1.7-PC-Linux-i686 MySQL

Then execute:

#CD MYSQL

# Scripts / mysql_install_db --user = mysql

#Chown -r root.

#Chown -R MySQL Data

#chgrp -r mysql.

# bin / mysqld_safe --user = mysql &

(2) Test,

#CD / usr / local / mysql / bin

#. / mysql

If you can see the mysql> symbol, the installation is successful.

If the system is required to automatically start mysql, add: /usr/local/mysql/support-files/mysql.server Start in /etc/rc.d/rc.local

4, install MySQL JDBC driver

(1) Right click in the graphical environment Click MySQL-Connector-Java-3.0.16-Ga.tar.gz file icon to extract to the current directory (/ tmp / mydown)

(2) Copy the decompressed mysql-connector-java-3.0.16-ga-bin.jar to / usr / local / tomcat / common / lib

(3) Increase the permission of the mysql user to access the database from this machine (running JSP needs), pay attention to the contents of the parentheses not to enter:

#CD / usr / local / mysql / bin

#. / mysql

MySQL> Grant All privileges on *. * To mysql (username) @ localhost.localdomain (host name) Identified by '' (password);

Mysql> quit

Third, Tomcat JDK MySQL Complete Test:

1, build subdirectory TEST under / usr / local / tomcat / webapps

2, copy the directory (note is the whole directory) USR / local / tomcat / webapps / root / web-inflorescence under the new TEST directory

3, create a new index.jsp file in the Test directory:

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

<% @ Page Import = "java.sql. *"%>

Red Flag Desktop Linux4.1 Test JSP Page (Tomcat MySQL) </ Title> <Body></p> <p><% Class.forname ("org.gjt.mm.mysql.driver"). NewInstance ();</p> <p>String URL = "JDBC: mysql: // localhost: 3306 / mysql? User = root & password = & useunicode = true & characterencoding = GB2312</p> <p>Connection conn = drivermanager.getConnection (URL); statement stmt = conn.createstatement (resultSet.Type_Scroll_Sensitive, ResultSet.concur_updatable);</p> <p>String SQL = "SELECT * from User";</p> <p>ResultSet RS = Stmt.executeQuery (SQL);%></p> <p><table> <tr> <td> Your first field content is: </ td></p> <p><TD> Your second field content is: </ td></p> <p></ TR></p> <p><% while (rs.next ()) {%></p> <p><TR> <TD></p> <p><% = rs.getstring (1)%> </ td> <td></p> <p><% = rs.getstring (2)%> </ td> </ TR></p> <p><%}%></p> <p></ TABLE></p> <p><% out.print ("Tomcat JDK MySQL Complete Test, Congratulations, Database Operation!");%></p> <p><% rs.close ();</p> <p>Stmt.close ();</p> <p>CONN.CLOSE ();</p> <p>%></p> <p></ body></p> <p></ html></p> <p>4, test, enter: http:// localhost: 8080 / test, if "Tomcat JDK MySQL full test, congratulations, database operations!", Explain your Tomcat JDK MySQL overall The configuration is successful.</p> <p>4. If you are using the ADSL Coaled Internet, IP may be dynamic unfair. At this time, if you want others to access your website from the Internet, you need to apply for a dynamic IP domain name service. It is free on www.3322.org, and there is no need to say more Chinese.</p> <p>Note: The installation and configuration of the JSP server is over. It is actually a lot of Tomcat's configuration work, this is just basic installation, which is only available, more details, please check the related articles and books.</p> <p>---------------------------------</p> <p>Part 2 Install Apache and PHP</p> <p>---------------------------------</p> <p>Apache is a very professional and stable web server, but it can only analyze simple static web pages and JavaScript web pages, but combine Tomcat and PHP to handle JSP and PHP dynamic web pages. Note that the following installation is performed on the basis of JDK Tomcat MySQL installed above.</p> <p>First, download related software to a fixed directory (such as / tmp / mydown)</p> <p>1, Apache2: Download link: http://apache.freeelamp.com/httpd/httpd-2.0.52.tar.gz</p> <p>2, php5: file name: PHP-5.0.2.tar.gz, download link: http://cn.php.net/get/php-5.0.2.tar.gz/from/a/mirror</p> <p>3, JK2 (used to integrate Apache and Tomcat), download link: http://apache.freeelamp.com/jakarta/tomcat-connectors/jk2/jakarta-tomcat-connectors-jk2-src-current.tar.gz II, start installation</p> <p>1, install apache:</p> <p>(1) Unzip and compile the installation</p> <p>#CD / TMP / MYDOWN</p> <p>#TAR XVFZ httpd-2.0.52.tar.gz</p> <p>#CD httpd-2.0.52</p> <p>#. / configure --prefix = / usr / local / apache --enable-so --enable-vhost_alias</p> <p>#make</p> <p>#make install</p> <p>(2) Edit /usR/local/apache/conf/httpd.conf:</p> <p>Add index.php index.jsp after DirectoryIndex</p> <p>Add a line of addtype application / x-httpd-php .php .phtml .php3 .inc</p> <p>AddefaultCharst changed to GB2312</p> <p>(3) Test, execute # / usr / local / apache / bin / apachectl start Start Apache, enter http: // localhost in the browser to appear Apache's welcome page.</p> <p>To boot automatically starting apache, add: / usr / local / apache / bin / apachectl start in /etc/rc.d/rc.local</p> <p>2, install php:</p> <p>(1) Unzip and compile the installation</p> <p>#CD / TMP / MYDOWN</p> <p>#TAR XVFZ PHP-5.0.2.tar.gz</p> <p>#CD PHP-5.0.2</p> <p>#. / configure --with-apxs2 = / usr / local / apache / bin / apxs --enable-track-vars --with-mysql = / usr / local / mysql</p> <p>#make</p> <p>#make install</p> <p>#CP php.ini-dist /usr/local/lib/php.ini</p> <p>(2) Test, execute # / usr / local / apache / bin / apachectl restart restart Apache</p> <p>Create Test.php file in / usr / local / apache / htdocs, content: <? Phpinfo ()?></p> <p>Enter http://localhost/test.php in the browser should appear server information.</p> <p>3, integrate Apache and Tomcat (this step is more annoying, please carefully):</p> <p>(1) Unzip and compile the installation JK2</p> <p>#CD / TMP / MYDOWN</p> <p>#TAR -XZVF JAKARTA-TOMCAT-Connectors-jk2-src-current.tar.gz</p> <p>#CD JAKARTA-TOMCAT-Connectors-JK2-2.0.4-SRC / JK / NATIVE2</p> <p>#. / configure --with-apxs2 = / usr / local / apache / bin / apxs --enable-eAPI</p> <p>#make</p> <p>#make install</p> <p># Note: If Make Install is unsuccessful, you need to send MOD_JK2.so.</p> <p>#CD / TMP/mydown/jakarta-tomcat-connectors-jk2-2.0.4-src/jk/build/jk2/apache2</p> <p>#CP * .SO / USR / local / apache / modules /</p> <p>(2) Edit file /usr/local/tomcat/conf/jk2.properties, in the final join: # list of needed handlers.</p> <p>Handler.list = ChannelSocket, Request</p> <p># Override the default port for the channelsocket</p> <p>Channelsocket.port = 8009</p> <p>(3) Edit File /usR/local/apache/conf/Workers2.properties (If you don't have this file, create a new one), the content is as follows:</p> <p># Only at beginnin. In Production UNcomment IT OUT</p> <p>[Logger.Apache2]</p> <p>Level = Debug</p> <p>[SHM]</p> <p>FILE = / usr / local / apache / logs / shm.file</p> <p>SIZE = 1048576</p> <p># Example Socket Channel, Override Port and Host.</p> <p>[Channel.socket: Localhost: 8009]</p> <p>Port = 8009</p> <p>Host = 127.0.0.1</p> <p># Define the worker</p> <p>[AJP13: Localhost: 8009]</p> <p>Channel = CHANNEL.SOCKET: Localhost: 8009</p> <p># Uri mapping</p> <p>[URI: / *. jsp]</p> <p>Worker = ajp13: Localhost: 8009</p> <p># 以下 以下 以下 主要 方 为 方 方 管理 管理 管理 管理 管理 管理 管理 管理 管理 管理 管理 管理 管理 管理 管理 管理 管理, 方, 方, 方, 方,,,,,</p> <p>[URI: / JSP-Examples / *]</p> <p>INFO = Map the JSP-Examples WebApp</p> <p>Worker = ajp13: Localhost: 8009</p> <p>[URI: / servlets-example / *]</p> <p>INFO = Map the servlets-example webApp</p> <p>Worker = ajp13: Localhost: 8009</p> <p>[URI: / TOMCAT-DOCS / *]</p> <p>Info = map the tomcat-DOCS webApp</p> <p>Worker = ajp13: Localhost: 8009</p> <p>[uri: / manager / *]</p> <p>Info = map the manager WebApp</p> <p>Worker = ajp13: Localhost: 8009</p> <p>(4) Edit file /us/local/apache/conf/httpd.conf, join:</p> <p>LoadModule JK2_Module Modules / MOD_JK2.SO</p> <p>Documentroot "/ usr / local / tomcat / webapps / root"</p> <p>#Apache default is / usr / local / apache / htdocs, Tomcat defaults / usr / local / tomcat / webapps</p> <p># Specify the release of Apache and Tomcat as the same directory (more better to be tested to root), in the mixing of HTML, JSP, and PHP</p> <p># If you do not mix HTML, JSP, PHP, it is best to use virtual host settings, please refer to related articles or books.</p> <p>(5) Test, when you enter http: // localhost in the browser, Tomcat's welcome page should appear.</p> <p>Red Flag Linux is completely installed with the work of the web server software!</p> <p>----------------------------------</p> <p>Part III Install FTP Server Software</p> <p>-------------------------------- This part mainly introduces the most basic procedure for installing FTP server software under Hongli 4.1 Procedure, the software uses the highest use rate of usage rates in linux VSFTPD.</p> <p>First, download software: ftp://vsftpd.beasts.org/Users/cevans/vsftpd-2.0.1.tar.gz, put it / TMP / MyDown</p> <p>Second, install VSFTPD</p> <p>(1) Unzip and compile software</p> <p>#CD / TMP / MYDOWN</p> <p>#tar -xzvf vsftpd-2.0.1.tar.gz</p> <p>#CD vSFTPD-2.0.1</p> <p>#make</p> <p>At this time, a binary file will be generated, verify it, shaped like:</p> <p>#ls -l vsftpd</p> <p>-rwxrwxr-x 1 Chris Chris 61748 Sep 27 00:26 vsftpd</p> <p>(2) Some conditions required to meet the VSFTPD installation</p> <p>VSFTPD default settings require a "Nobody" user, if this user does not exist, then add it. as follows:</p> <p># UserAdd NoBody</p> <p>Useradd: user nobody exists</p> <p>VSFTPD default settings require an empty directory: / usr / share / empty, add this directory if it does not exist. as follows:</p> <p># MKDIR / USR / Share / EMPTY /</p> <p>MKDir: Cannot Create Directory `/ usr / share / empty ': file exists</p> <p>Create a "ftp" user (if it does not exist), / var / ftp / is the root directory of the FTP, replace it with another.</p> <p># MKDIR / VAR / FTP /</p> <p># UserAdd -d / var / ftp ftp</p> <p>#Chown root.root / var / ftp</p> <p>#CHMOD OG-W / VAR / FTP</p> <p>(3) Install the configuration, execution, and help files for VSFTPD.</p> <p>#mkdir / usr / local / man / man5</p> <p>#mkdir / usr / local / man / man8</p> <p>#make install</p> <p>#CP vsftpd.conf / etc</p> <p>(4) Edit /etc/vsftpd.conf, add this line at the bottom: listen = yes</p> <p>(5) Test,</p> <p># / Usr / local / sbin / vsftpd &</p> <p>Note: To boot automatically, please add: / usr / local / sbin / vsftpd &</p> <p>If everything is normal, then you will connect to the FTP server, such as:</p> <p>$ FTP Localhost</p> <p>Connected to localhost (127.0.0.1).</p> <p>220 (vSFTPD 1.1.1)</p> <p>Name (localhost: chris): ftp</p> <p>331 Please Specify The Password.</p> <p>PASSWORD:</p> <p>230 Login Successful. Have fun.</p> <p>Remote System Type IS UNIX.</p> <p>Using binary model to transfer files.</p> <p>FTP> LS</p> <p>227 Entering Passive Mode (127, 0, 0, 1, 229, 133)</p> <p>150 Here Comes The Directory Listing.</p> <p>226 Directory Send OK.</p> <p>FTP> quit</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-79007.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="79007" 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.043</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 = 'rE_2B3eLVky2uh7mQ7Jx_2BfD_2BuS1EFtvpz_2Bz95quSRkoFto3tYXKXugttO85D6xgz_2BibL8Ildg_2Bvd4Vjxr8XHKjbQ_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>