How to configure the MYSQL, PHP, and JSP environments in LINUX

Source: Internet
Author: User

Resources to be downloaded

1、mysqltutorial -3.22.32-pc-linux-gnu-i386.tar.gz
2、apache_1.3.12.tar.gz
32.16phptutorial -4.03pl1.tar.gz
4、mod_auth_mysql-2.20.tar.gz
5、phpMyAdmin_2.1.0.tar.gz
6、jdk-1_2_2_006-linux-i1_1_12.16.tar.gz
7、jsdk20-solaris2-sparc.tar. Z
8、ApacheJServ-1.1.2.tar.gz
92.16gnujsptutorial -1.0.1.tar.gz

Note: All files are unlocked under the/tmp directory.

(1) install MySQL

# Cd/tmp
# Tar zvxf mysql-3.22.32-pc-linux-gnu-i386.tar.gz
# Mv mysql3.22.32/usr/local/mysql
# Cd/usr/local/mysql
#./Configure -- prefix =/usr/local/mysql



(2) pre-install Apache

# Cd/tmp
# Tar zvxf apache_1.3.12.tar.gz
# Cd apache_1.3.12
#./Configure -- prefix =/usr/local/apache
# Make; make install


(3) install php4

# Tar zvxf php-4.03pl1.tar.gz
# Cd php-4.03pl1
#./Configure \
-- With-mysql =/usr/local/mysql \
-- With-apache = ../apache_1.3.12 \
-- Enable-track-vars
# Make; make install



(4) install Mod_Auth_Mysql

# Cd/tmp
# Tar zvxf mod_auth_mysql-2.20.tar.gz
# Cd mod_auth_mysql-2.20
#./Configure \
-- With-mysql =/usr/local/mysql \
-- With-apache = ../apache_1.3.12 \
-- Enable-track-vars
# Make


(5) install jdk

# Cd/tmp
# Tar zvxf jdk-1_2_2_006-linux-i1_1_12.16.tar.gz
# Mv jdk1.2.2/usr/local/jdk1.2.2
Change PATH to: PATH = "$ PATH:/usr/X11R6/bin:/usr/local/jdk1.2.2/bin" under/etc/profile"
# Cd/tmp
# Tar zvxf jsdk20-solaris2-sparc.tar.Z
# Cp JSDK2.0/lib/jsdk. jar/usr/local/jdk1.2.2/jre/lib/ext/
You only need the jsdk. jar file to delete the JSDK2.0 Directory (rm-rf JSDK2.0)



(6) install Apache JServ

# Cd/tmp
# Tar zvxf ApacheJServ-1.1.2.tar.gz
# Cd ApacheJServ-1.1.2
#./Configure \
-- Prefix =/usr/local/jserv \
-- With-apache-src = ../apache_1.3.12 \
-- With-jdk-home =/usr/local/jdk1.2.2 \
-- With-JSDK =/usr/local/jdk1.2.2/jre/lib/ext/jsdk. jar \
-- Enable-EAPI \
-- Disable-debugging
# Make; make install



(7) formally install Apache (re-compile Apache and activate the php4, Mod_Auth_MySQL, and JServ modules)

# Cd/tmp
# Cd apache_1.3.12
#./Configure \
-- Prefix =/usr/local/apache \
-- Activate-module = src/modules/php4/libphp4.a \
-- Activate-module = src/module/auth_mysql/libauth_mysql.a \
-- Activate-module = src/modules/jserv/libjserv.
# Make; make install


(8) configure php

# Cd/tmp
# Cd php-4.30pl1
# Cp php. ini-dist/usr/local/lib/php. ini
# Cd/usr/local/apache/conf
# Vi httpd. conf
Find the AddType application/x-httpd-php. php line, delete "#", and add. php3. php4 at the end of the line.


(9) install phpMyAdmin

# Cd/tmp
# Tar-zvxf phpMyAdmin_2.1.0.tar.gz
# Mv phpMyAdmin_2.1.0/usr/local/apache/htdocs/phpMyAdmin
# Cd/usr/local/apche/htdocs/phpMyAdmin
# Chmod a + r * (set to readable)



(10) MySQL database startup tutorial

# Cd/usr/local/mysql
# Script/mysql_install_db (optional)
# Bin/safe_mysqld &
# Bin/mysql-u root
# Mysql> use mysql;
# Mysql> select * from user;
# Mysql> UPDATE user SET password = PASSWORD ('000000') WHERE user = 'root' (SET a password for the root user)
# Mysql> exit



(11) configure phpMyAdmin

# Cd/usr/local/apache/htdocs/phpMyAdmin
# Vi config. inc. php3
Configure the following parameters:
$ Incluservers [1] ['adv _ auth'] = true
$ Incluservers [1] ['stduser'] = 'root'
$ Incluservers [1] ['stdpass'] = '20140901'



(12) configure startup of Apache and MySQL
Even if you have not installed the Web Server in Linux, the Web Server will be installed when you install Linux. Therefore, you must terminate the previous HTTPD service. Therefore:

# Cd/etc/rc. d/init. d
# Mv httpd. old
# Cd/etc/rc. d
# Vi rc. local
Add the following lines at the end:
Cd/usr/local/mysql
Bin/safe_mysqld &
/Usr/local/apache/bin/apachectl start
# Reboot



(13) configure Apache JServ

# Cd/usr/local/apache/conf
# Vi httpd. conf
Add at the beginning:
Include/usr/local/jserv/etc/jserv. conf
Note: httpd. conf-> jserv. conf-> jserv. properties-> zone. properties



(14) test Apache JServ

Test whether the file can be started
#/Usr/local/apache/bin/apachectl configtest
Restart
#/Usr/local/apache/bin/apachectl restart
Check whether the jserv module is connected.
/Usr/local/apache/bin/httpd-l
Test: httpd: // servrname/servlets/Hello
Note: The error message of apache is written in/usr/local/apache/logs/error_log.
The error message of jserv is in/usr/local/jserv/logs/mod_jserv.log.



(15th) install gnujsp

# Cd/tmp
# Tar zvxf gnujsp-1.0.1.tar.gz
# Music gnujsp-1.0.1/usr/local/gnujsp

(16) configure JSP
# Cd/usr/local/jserv/etc

# Vi jserv. conf
Add the following rows:
ApJServVMTimeout 30
ApJServMount/alph/alphzone
ApJServAction. jsp/alph/gnujsp

# Vi jsev. properties
Comment out the following line:
Wrapper. classpath =/usr/local/jdk1.2.2/jre/lib/ext/jsdk. jar
Added:
Wrapper. classpath =/usr/local/jdk1.2.2/lib/tools. jar
Wrapper. classpath/usr/local/gnujsp/lib/servlet-2.0-plus.jar.
Comment out:
Zones = root
Added:
Zone = root, alphzone
Alphzone. properties =/usr/local/jserv/etc/alphzone. properties

# Cp zone. properties. dufault alphzone. properties
# Vi alphzone. properties
Comment out:
Repositories =/usr/local/jserv/servlets
Added:
Repositories =/usr/local/gnujsp/lib/gnujsp10.jar
Repositories =/usr/local/gnujsp/lib/sax2.jar
Repositories =/usr/local/gnujsp/lib/openxml-1.2-w3c.jar
Repositories =/usr/local/gnujsp/lib/aelfred. jar
Add at the end:
Servlet. gnujsp. code = org. gjt. jsp. JspServlet
Servlet. gnujsp. initArgs = scratchdir =/usr/local/apache/jsp
Servlet. gnujsp. initArgs = usepackages = true
Servlet. gnujsp. initArgs = checkdependspones = true, checkclass = true
Servlet. gnujsp. initArgs = builtin-javac \
-Classpath %: % scratchdir %:/usr/local/gnujsp/lib/gnujsp10.jar \
-D % scratchdir % \
-Deprecation % source %

# Mkdir/usr/local/apache/jsp
# Chown nobody. nobody/usr/local/apache/jsp

Note: httpd. conf-> jserv. conf-> jserv. properties-> alphzone. properties

(17) test JSP
# Cp/usr/local/gnujsp/samples/*. jsp/usr/local/apache/htdocs
Test: httpd: // XXX. XXX/hello. jsp
Test: httpd: // XXX. XXX/date. jsp
Test: httpd: // XXX. XXX/snonp. jsp

If the test fails:
# Cd/usr/local/gnujsp/apache
# Chmod 755 check-gnujsp-conf
#./Check-gnujsp-conf/usr/local/jserv/etc/jserv. conf | more

If an error message is displayed

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.