AD

centos5 perfect integration of Apache + Tomcat, jsp and php support both

Download the required files -------------------------- --------------

The following files are downloaded to / mnt / directory.

1 download JDK, sun website to download jdk-6u16-linux-i586-rpm.bin, local Window machine, then FileZilla upload to the server.

2 remote ssh login linux, # cd / mnt, download apach: command as follows: wget-c **apache.etoak**/httpd/httpd-2.2.13.tar.gz

3 Download mysql-5.0.84.tar.gz way as the above

4 Download apache-tomcat-6.0.20.tar.gz way as the above

5 Download php-5.3.0.tar.gz

6 download apr-1.3.3.tar.gz and apr-util-1.3.4.tar.gz download from **apr.apache**/

To install JDK ----------------- -----------------
# Cp jdk-6u16-linux-i586-rpm.bin / usr / local, copy it to / usr / local under
# Cd / usr / local
# Chmod + x jdk-6u16-linux-i586-rpm.bin add executable permissions
# ./jdk-6u16-linux-i586-rpm.bin Appeared on the implementation of the agreement related to the installation, press "q", skip, and then security "y", began to install the jdk. Remember it later press Enter. On completed a default installation in / usr / java directory, to make a soft link
# Ln-s / usr/java/jdk1.6.0_16 / / usr / local / java
Set environment variables
# Vi / etc / profile
An "i" to enter edit mode the last to join:
JA VA _HOME = / usr/java/jdk1.6.0_16
CLA SSPA TH = / usr/java/jdk1.6.0_16/lib/dt.jar: / usr/java/jdk1.6.0_16/lib/tools.jar
PA TH = / usr/java/jdk1.6.0_16/bin: $ PA TH
export PA TH JA VA _HOME CLA SSPA TH
Shift +: wq! Save out to take effect: # sourc / etc / profile
# Java-version Show version information, instructions to install successfully

--------------- Install mysql source three-step installation) -------------------------
# Cd / mnt /
# Tar zxvf mysql-5.0.84.tar.gz
# Cd mysql-5.0.84
#. / Configur - prefix = / usr / local / mysql - with-charset = utf8 - with-extra-charset = al - enable-thread-safe-cli - enable-local-infil - with- low-memory
Note: install = / usr / local / mysql, the language used utf8

Leads to the error: configure: error: no accept C compil found in $ PA TH
An explanation did not gcc, is safety:

See whether the system is installed gcc and install the program version:
gcc-v
c + +-v
g + +-v
If you have not installed with the following command
# Yum install gcc
# Yum install gcc-c + +
# Yum install gcc-gfortran

Again:
#. / Configur - prefix = / usr / local / mysql - with-charset = utf8 - with-extra-charset = al - enable-thread-safe-cli - enable-local-infil - with- low-memory

Or error:
check for termcap function library ... configure: error: No curses / termcap librari found
Note to An ncurses
# Yum instal ncurses-devel
Prompts to install the N pieces of software, slightly, according to "y", complete

Again:
#. / Configur - prefix = / usr / local / mysql - with-charset = utf8 - with-extra-charset = al - enable-thread-safe-cli - enable-local-infil - with- low-memory

There: Thank you for choos MySQL! Shows the first step in a successful install mysql

------------
# Make & & make install

If gcc-c + + configur re-installed after configur what could be the following error:
error: redeclar of C + + built-in type bool

Slow-long wait, well the
-------------

Building users, user groups
# Groupadd mysql
# Addus-g mysql mysql

# Cp support-files/my-medium.cnf / etc / my.cnf
In this case my-medium.cnf file here: / mnt/mysql-5.0.84/support-files/my-medium.cnf

mysql installed in / usr / local / mysql / ri
# Chown-R mysql.mysql / usr / local / mysql /
# / Usr / local / mysql / bin / mysql_install_db - user = mysql
# Chown-R root.root / usr / local / mysql /
# Chown-R mysql.mysql / usr / local / mysql / var /
Start look, plus a back running in the background & that
# / Usr / local / mysql / bin / mysqld_saf - user = mysql &
# Netstat-ant to see 3306 end of product number, description started

Added to the boot in
# Cp support-files/mysql.serv / etc / rc.d / init.d / mysqld
For permission
# Chmod 755 / etc / rc.d / init.d / mysqld
To join the start of mysqld service
# Chkconfig - add mysqld
Runlevel
# Chkconfig - level 345 mysqld on
Set Password
# / Usr / local / mysql / bin / mysqladmin-u root password "****"
Access mysql
# / Usr / local / mysql / bin / mysql-uroot-p
Password, entered the library to see what: show databases;
Exit: quit

Configure mysql library file search path:
# Echo "/ usr / local / mysql / lib / mysql /">> / etc.ld.so.conf
# Ldconfig effect
# Ldconfig-v output of about

Add the mysql system environment variable
# Echo "export PA TH = $ PA TH: / usr / local / mysql / bin">> / etc / profile
# Sourc / etc / profile effect

Complete

------------------------ Install apr -----------------
# Cd / mnt
# Tar zxvf apr-1.3.3.tar.gz
# Cd apr-1.3.3
#. / Configur - prefix = / usr / local / apr
# Make
# Make install

# Tar zxvf apr-util-1.3.4.tar.gz
# Cd apr-util-1.3.4
#. / Configur - prefix = / usr / local / apr-util - with-apr = / usr / local / apr
# Make & & make install

--------------------------- Install apache -------------

Install php ---------------------- -----------------
# Cd / mnt /
# Tar zxvf php-5.3.0.tar.gz
# Cd php-5.3.0
#. / Configur - prefix = / usr / local / php - with-apxs2 = / usr / local / apache / bin / apx - with-mysql = / usr / local / mysql / - with-config-file -path = / usr / local / php

Error:
configure: error: xml2-config not found. Pleas check your libxml2 installation.
To install the following two stuff:
# Yum instal libxml2
# Yum install libxml2-devel

Again. / Configur .............. success

# Make & & make install

# Cp php.ini-dist / usr / local / php / php.ini
Increase apach on the php support, modify apach profile
# Vi / usr / local / apache / conf / httpd.conf
Search the following,
LoadModul php5_module modules/libphp5.so
Insert the line:
A ddType application / x-httpd-php. Php
Search again
DirectoryIndex

The original is:
<IfModul Dir_module>
DirectoryIndex index.html </ IfModule>
Read:
<IfModul Dir_module>
DirectoryIndex index.html index.php index.jsp
</ IfModule>
Save Exit
/ Usr / local / apache / htdocs / php file to build a next, ready to test.

Test before first restart apache:
# Servic httpd restart

Error:
httpd: Syntax error on line 53 of / usr / local / apache / conf / httpd.conf: Cannot load / usr/local/apache/modules/libphp5.so into server: / usr/local/apache/modules/libphp5.so : cannot restor segment prot after reloc: Permiss denied

Reason: Linux has a cause SELinux protection mode solution:
1 Close SELINUX methods:
vi / etc / selinux / config to SELINUX = enforc into SELINUX = disabl need to restart the server, this method may pose a risk.
2 not close SELINUX methods:
# Setenforc 0
# Chcon-c-v-R-u system_u-r object_r-t textrel_shlib_t / usr/local/apache/modules/libphp5.so
# Servic httpd restart
# Setenforc 1
ok, php page can access the
-------------------------------------------------- ----

apach, the default folder will be displayed under the file structure to prohibit this feature
# Vi / usr / local / apache / conf / httpd.conf
Found:
Option Index FollowSymLinks
Line and add # in front, he notes
-------------------------------------------------- -

Integration apach and tomcat ---------------------------- ------------------ -----
# Vi / usr / local / apache / conf / httpd.conf
Finally add the following lines:

------------------- ---------------------------- Configure php program ----------
/ Usr / local / apache / htdocs / phpbb next to build a folder inside with a php program.
# Chmod-R 777 phpbbs /
# Vi / usr / local / apache / conf / httpd.conf
Comment out the front just added:
# ProxyPass / ajp: / / 127.0.0.1:8009 / Note that the last have a "/" Do not be less
# ProxyPassRevers / ajp: / / 127.0.0.1:8009 /
Open (remove the # in front of the following sub-configuration file:
# Virtual hosts
Includ conf / extra / httpd-vhosts.conf
Save Exit
# Vi / usr / local / apache / conf / extra / httpd-vhosts.conf
Amended as follows:
<VirtualHost *:80>
DocumentRoot "/ usr / local / apache / htdocs / phpbbs"
ServerNam bbs.tgjia**
ErrorLog "/ usr / local / apache / logs / phpbbs-error_log"
CustomLog "/ usr / local / apache / logs / phpbbs-access_log" common
</ VirtualHost>
Restart apache.
php program to be installed in "/ usr / local / apache / htdocs / phpbbs" below. a little .....
With bbs.tgjia** domain may be visited

Configuring JSP program -------------------------- --------------------- -----------

/ Usr / local / apache / htdocs / folder under the build a jspbb, which put jsp program.
# Chmod-R 777 jspbbs /
# Vi / usr / local / apache / conf / extra / httpd-vhosts.conf
Add the following virtual host configuration
<VirtualHost *:80>
DocumentRoot "/ usr / local / apache / htdocs / jspbbs"
ServerNam **aaa**
ErrorLog "/ usr / local / apache / logs / jspbbs-error_log"
CustomLog "/ usr / local / apache / logs / jspbbs-access_log" common
ProxyPass / ajp: / / 127.0.0.1:8009 /
ProxyPassRevers / ajp: / / 127.0.0.1:8009 / Note that the last have a "/" Do not be less
</ VirtualHost>
Save and Exit, restart apache
------------------------------- Php program for directory --------------- -------------------------------------
/ Established under php, and open the appropriate permissions
# Mkdir / php
# Chmod-R 777 / php
# Vi / usr / local / apache / conf / extra / httpd-vhosts.conf
Amended as follows:
<VirtualHost *:80>
DocumentRoot "/ php" was revised to a new location
ServerNam bbs.tgjia**
ErrorLog "/ php / logs / phpbbs-error_log"
CustomLog "/ phplogs / phpbbs-access_log" common
</ VirtualHost>
Establish / php / logs, and copies of the following two log files over the original.
/ Usr / local / apache / logs / jspbbs-error_log
/ Usr / local / apache / logs / jspbbs-access_log "
# Vi httpd.conf
<Directori />
Option FollowSymLinks
AllowOverrid None
Order deny, allow
Allow from all so that you can access "/ usr / local / apache / htdocs /" other than the location of the
</ Directory>
Restart apache.
Browser's address bar enter IP, you can see the default page of tomcat.
ProxyPass / ajp: / / 127.0.0.1:8009 / Note that the last have a "/" Do not be less
ProxyPassRevers / ajp: / / 127.0.0.1:8009 / Note that the last have a "/" Do not be less

# Cd / mnt
# Tar zxvf httpd-2.2.13.tar.gz
# Cd httpd-2.2.13
#. / Configur - prefix = / usr / local / apach - enable-so - enable-rewrit - enable-proxi - enable-proxy-ajp - enable-proxy-balanc - with-apr = / usr / local / apr - with-apr-util = / usr / local / apr-util
Opened rewrit, proxi module
# Make & & make install
Start apache
# / Usr / local / apache / bin / apachectl start
Look at the port, there is no port 80
# Netstat-ant
Can also look at the process
# Ps-ef | grep httpd

Next, to join the boot from the start apach
# Cp / usr / local / apache / bin / apachectl / etc / rc.d / init.d / httpd
# Vi / etc / rc.d / init.d / httpd
Added two lines of the second line reads as follows:
# Chkconfig: 2345 10 90
# Description: Activates / Deacti Apach Web Server
Save exit.

# Chkconfig - add httpd to join since the start
# Chkconfig - level 345 httpd on setting run levels

Restart apache:
# / Usr / local / apache / bin / apachectl restart

Install tomcat --------------------- ----------------------
Can extract only, and no installation

# Cp apache-tomcat-6.0.20.tar.gz / usr / local /
# Cd / usr / local /
# Tar zxvf apache-tomcat-6.0.20.tar.gz
# Cd apache-tomcat-6.0.20
# Rm-fr apache-tomcat-6.0.20.tar.gz
# Mv apache-tomcat-6.0.20 / tomcat

# Vi / usr / local / tomcat / bin / catalina.sh
Finally a line JA VA _HOME = / usr/java/jdk1.6.0_16
Save Exit

Start:
# / Usr / local / tomcat / bin / startup.sh
Adding boot from the start
# Vi / etc / rc.d / rc.local
Last added
export JDK_HOME = / usr/java/jdk1.6.0_16
export JA VA _HOME = / usr/java/jdk1.6.0_16
/ Usr / local / tomcat / bin / startup.sh

Source: ****ih123**/post-2003-1.fhtml; jsessionid = B007DFD75866826900CB9E1BF5F8347B
标签: utf8, java directory, ssh, default installation, tar gz, installation cd, y quot, java jdk1, apache tomcat, rpm, wget, tar zxvf, set environment variables, php 5, java version, profile java, tomcat jsp, gz download, export pa, information instructions
分类: OS
时间: 2010-04-02

相关文章

  1. Solve Apache Tomcat server does not support FLV video method

    Today in a server upload a flv streaming media file, found it impossible to access the file, after some resear ...
  2. Apache Tomcat integration

    Today because of job needs, subject to the Apache and Tomcat integration between the internet looking for some ...
  3. Notes compilation of open source software 3 - Apache + tomcat integration

    Wondered, for a long time ago I tried to integrate it with apache and tomcat, there are many online article on ...
  4. apache tomcat integration of small mind

    Due to work, integration of these days a bit apache and tomcat, find a lot of information online, the Internet ...
  5. linux apache tomcat cluster integration with apache and tomcat

    linux apache tomcat with apache and tomcat cluster integration (only 80 ended with a different port number to ...
  6. The establishment of "JSP + Mysql + Apache Tomcat" Environmental Gonglue

    The establishment of "JSP + Mysql + Apache Tomcat" Environment Gong Lue: Pre-work that is completed ...
  7. Apache Tomcat 5.5 Servlet / JSP container how to prepare Cluster / Session Replication

    Source text: http://www.jaxmao.org/tomcat-docs/cluster-howto.html Apache Tomcat 5.5 Servlet / JSP container Ho ...
  8. Apache + tomcat environment integration -

    from http://hi.baidu.com/qiuyuanyang/blog/item/5e0caa369d251745251f1434.html Quote View the article Apache + t ...
  9. web服务器 linux+apache+tomcat+mysql+jsp+php 整合安装

    web服务器 linux+apache+tomcat+mysql+jsp+php 整合安装 自己的安装过程,以前发表在新浪博客,现在换地盘了转过来... 自我感觉写得还是不错滴.. 在安装过程更是学到了很多东西 做好这个 ...
  10. jsp静态和动态分开处理apache+tomcat

    Apache是当前使用最为广泛的WWW服务器软件,具有相当强大的静态HTML处理的能力. Tomcat服务器是一个免费的开放源代码的Web应用服务器,它是Apache软件基金会(Apache Software Found ...
  11. apache + tomcat + cluster multi-domain

    I believe many people will encounter, their only one server, but want a server, there are a number of applicat ...
  12. Apache + Tomcat load balancing cluster

    http://weijie.blog.51cto.com/340746/68195 APACHE 2.2.8 + TOMCAT6.0.14 configure load balancing Objectives: Apa ...
  13. Liunx building under apache + tomcat cluster 1

    Test server bbs I am using the tomcat running, the last two days playing with apache + tomcat cluster, so read ...
  14. Linux, apache, tomcat server configuration

    Jsp development environment under Linux, apache, tomcat server configuration process: (Unless specified: all r ...
  15. Conquest of Apache + Tomcat

    Apache and Tomcat is an original, but is a pro! Apache and Tomcat integration is none other than Apache as a f ...
  16. Conquest of Apache + Tomcat (transfer)

    Original Transfer from http://snowolf.javaeye.com/blog/743611 Apache and Tomcat is an original, but is a pro! ...
  17. Detailed Apache + Tomcat cluster configuration (1)

    First, the software is ready Apache 2.2: http://httpd.apache.org/download.cgi , download the msi installer, se ...
  18. Apache + Tomcat cluster configuration in detail

    First, the software is ready Apache 2.2: http://httpd.apache.org/download.cgi , download msi installer, select ...
  19. apache + tomcat load balancing (f non-mod_jk form)

    Target: Apache tomcat configuration using an application and the web site, to meet the following requirements: ...