Set up a Web server supporting JSP + PHP on Linux (1) _ MySQL

Source: Internet
Author: User
In recent years, the proportion of Linux in the server market has increased. in addition to the free and secure nature of Linux, the Linux application services have become increasingly abundant. Most common services have good solutions on Linux. For the most widely used Web services on Intenet, Linux has a better performance. No one can tell whether Linux has been running on the Internet in recent years. ServerIn addition to the free and secure nature of Linux, the proportion of market share is growing, and the application services on Linux are becoming increasingly abundant. Most common services have good solutions on Linux. For the most widely used Web services on Intenet, Linux has a better performance. No one can tell the exact number of websites on the Internet, but among the many websites, websites developed using PHP and JSP undoubtedly occupy a huge market share. The following describes how to set up support for JSP + PHP + on Linux. MySQLWeb Server.

Apache is undoubtedly the first choice for Web services.DatabaseAspect selectionMySQLThis is enough for general applications. of course, oracle, DB2, and other large applications can be installed in Linux.DatabaseBut they are expensive. JSP and PHP are the most popular and widely used web development languages. All of theseSoftwareWe can find it on the following websites:

Resin: http://www.caucho.com/
JDK: http://java.sun.com/
Apache: http://www.apache.org
  MySQL: Http://www.mysql.com
PHP: http://www.php.net
MM.MySQL: Http://mmmysql.sourceforge.net/

Download the correspondingSoftware, Downloaded by the AuthorSoftwareAs follows:

Mysql-4.0.15.tar.gz
Apache_1.3.28.tar.gz
Php-4.3.3.tar.gz
Resin-3.0.3.tar.gz
Mysql-connector-java-3.1.0-alpha.tar.gz
J2sdk-1_4_2_01-linux-i586.bin

I. InstallationMySQL

  MySQLBut the compilation process may be a little long. the specific steps are as follows:

# Tar-xzpvf mysql-4.0.15.tar.gz
# Adduser-s/bin/false mysql
#./Configure -- prefix =/usr/local/terry_yu/mysql -- enable-guest er
-- With-innodb -- with-charset = gb2312
# Make
# Make install
#/Usr/local/terry_yu/mysql/bin/mysql_install_db
# Chown-R root/usr/local/terry_yu/mysql/
# Chown-R mysql/usr/local/terry_yu/mysql/var
# Chgrp-R mysql/usr/local/terry_yu/mysql/
#/Usr/local/terry_yu/mysql/bin/mysql_install_db

Modify/etc/ld. so. conf and add the following line at the end:

/Usr/local/terry_yu/mysql/lib

Run the following command:

# Ldconfig

Run the following command to startMySQL

/Usr/local/terry_yu/mysql/bin/mysqld_safe &

Run the following command to modifyMySQLRoot password:

/Usr/local/terry_yu/mysql/bin/mysqladmin-uroot password abcdefg

Run the following command to accessMySQLCommand line method:

[Root @ terry root] #/usr/local/terry_yu/mysql/bin/mysql-uroot-p
Enter password:
Welcome toMySQLMonitor. Commands end with; or \ g.
YourMySQLConnection id is 1 to server version: 4.0.15

Type 'help; 'or' \ H' for help. Type '\ C' to clear the buffer.

Mysql> quit
Bye

The above information indicatesMySQLIt has been successfully run.

II. install JDK

# Chmod 755 j2sdk-1_4_2_01-linux-i586.bin
#./J2sdk-1_4_2_01-linux-i586.bin
# Mv j2sdk1.4.2 _ 01 // usr/local/terry_yu/
# Cd/usr/local/terry_yu/
# Ln-s j2sdk1.4.2 _ 01/jdk
# Ln-s jdk/jre

# Vi/etc/profile
JAVA_HOME =/usr/local/terry_yu/jdk
RESIN_HOME =/usr/local/terry_yu/resin
CLASSPATH =.../$ JAVA_HOME/lib: $ JAVA_HOME/jre/lib: $ RESIN_HOME/lib:/usr/local/terry_yu/jdbc
PATH = $ PATH: $ JAVA_HOME/bin: $ JAVA_HOME/jre/bin

Log out of the current logon environment and log on again. then, the environment variable you just set will take effect. then, run the following command to test it:

[Root @ terry root] # java-version
Java version "1.4.2 _ 01"
Java (TM) 2 Runtime Environment, Standard Edition (build 1.4.2 _ 01-b06)
Java HotSpot (TM) Client VM (build 1.4.2 _ 01-b06, mixed mode)

If you see similar information, the JDK environment is ready. In fact, in the above/etc/profile, we not only set the JDK environment variables, but also set the environment variables for Resin and JDBC. these are all necessary settings for installing Resin later.

III. InstallationMySQLJDBC

  MySQLThe relevant environment variables of JDBC have been set before, so the rest is to install by the following command:

# Tar-xzpvf mysql-connector-java-3.1.0-alpha.tar.gz
# Music mysql-connector-java-3.1.0-alpha/usr/local/terry_yu/
# Cd/usr/local/terry_yu/
# Ln-s mysql-connector-java-3.1.0-alpha/jdbc

4. install Apache

Http://apache.linuxforum.net/dist/httpd/apache_1.3.28.tar.gz

Note that DSO support must be added during apache Compilation. if not, add the -- enable-module = so option to re-compile apache.

# Tar-xzpvf apache_1.3.28.tar.gz
# Cd apache_1.3.28/
#./Configure -- prefix =/usr/local/terry_yu/apache -- enable-module = most
-- Enable-shared = max
# Make
# Make install

View the modules compiled into apache:

#/Usr/local/terry_yu/apache/bin/httpd-l
Compiled-in modules:
Http_core.c
Mod_so.c

The above information indicates that apache supports DSO. In this way, you can use DSO to add the php and resin modules.

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.