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
(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. *"%>
<% Class.forname ("org.gjt.mm.mysql.driver"). NewInstance ();
String URL = "JDBC: mysql: // localhost: 3306 / mysql? User = root & password = & useunicode = true & characterencoding = GB2312
Connection conn = drivermanager.getConnection (URL); statement stmt = conn.createstatement (resultSet.Type_Scroll_Sensitive, ResultSet.concur_updatable);
String SQL = "SELECT * from User";
ResultSet RS = Stmt.executeQuery (SQL);%>