Dict.CN 在線詞典, 英語學(xué)習(xí), 在線翻譯

          都市淘沙者

          荔枝FM Everyone can be host

          導(dǎo)航

          <2025年5月>
          27282930123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          公告


          我的blog中的部分資源是來自于網(wǎng)絡(luò)上,如果你認為侵犯了你的權(quán)利,請及時聯(lián)系jelver#163.com,我會盡快刪除!另外如果要留言最好通過郵件的形式跟我交流因為我不是很經(jīng)常寫文章,前面有的朋友留言好久了我才發(fā)現(xiàn),所以對不住大家,現(xiàn)在留下MSN:jelver#163.com和QQ:253840881,歡迎交流! (用@代替#)

          隨筆分類

          文章分類

          隨筆檔案

          文章檔案

          相冊

          統(tǒng)計

          留言簿(23)

          積分與排名

          優(yōu)秀學(xué)習(xí)網(wǎng)站

          友情連接

          閱讀排行榜

          評論排行榜

          RHEL AS4U3+httpd2.2+tomcat5.5+mysql5.0+php5.1詳細安裝文檔

          發(fā)表于: 2006-8-24 10:15 ?? ?[引用] ?[投訴][快速回復(fù)]

          在論壇里看了許多相關(guān)帖子,自己也實驗了多次,終于在前幾天測試成功,感謝cu里的前輩們?yōu)槲覀冃氯虽伮罚驗槲覍嶋H工作中要用到這些,以前是兄弟公司的哥們幫我們配置。現(xiàn)在我也配置成功,和大家分享一下成果吧。一直從cu里吸取精華,希望我的文檔能給一些新人有幫助。
          ? ?說明:實現(xiàn)WEB服務(wù)器能運行html、php、jsp等格式文件

          一、? ? ? ? 所用軟件及版本
          1、? ? ? ? 操作系統(tǒng):RHEL as4u3
          2、? ? ? ? Apache:httpd-2.2.2.tar.gz
          apr-util-1.2.7.tar.gz
          apr-1.2.7.tar.gz
          3、? ? ? ? Tomcat:apache-tomcat-5.5.15.tar.gz
          4、? ? ? ? Mysql:mysql-5.0.22.tar.gz
          5、? ? ? ? Jdk:jdk-1_5_0_07-linux-i586.bin
          6、? ? ? ? Apache和Tomcat連接:tomcat-connectors-1.2.18-src.tar.gz
          7、? ? ? ? Php: php-5.1.4.tar.gz
          二、? ? ? ? 安裝步驟:
          1、? ? ? ? 安裝操作系統(tǒng):這里就不介紹了,主要將相關(guān)的開發(fā)包裝上。我將所有開發(fā)包都安裝了。
          2、? ? ? ? Apache安裝:將以上所需要的所有軟件上傳到/usr/local下。
          先解壓:

          tar xvfz httpd-2.2.2.tar.gz
          cd httpd-2.2.2
          首先可以看看里面的安裝說明INSTALL和README。
          在安裝apache之前先安裝apr-util-1.2.7.tar.gz和apr-1.2.7.tar.gz
          首先安裝apr。

          tar xvfz apr-1.2.7.tar.gz
          cd apr-1.2.7
          ./configure --prefix=/usr/local/apr-httpd
          make
          make install
          cd ..
          再安裝apr-util-1.2.7.tar.gz

          tar xvfz apr-util-1.2.7.tar.gz
          cd apr-util-1.2.7
          ./configure --prefix=/usr/local/apr-util-httpd --with-apr=/usr/local/apr-httpd
          make
          make install
          3、? ? ? ? 接下來繼續(xù)安裝apache

          cd ../httpd-2.2.2
          ./configure --prefix=/usr/local/apache --enable-mods-shared=all --enable-module=most --with-apr=/usr/local/apr-httpd --with-apr-util=/usr/local/apr-util-httpd --enable-so
          make
          make install
          如果沒有報錯,apache基本安裝完畢。
          4、? ? ? ? 安裝JDK
          回到local目錄下:

          cd ..
          ./jdk-1_5_0_07-linux-i586.bin
          ln –s jdk1.5.0_07 jdk
          設(shè)置JDK環(huán)境變量

          vi /etc/profile
          再文件尾部增加以下幾句:

          JAVA_HOME=/usr/local/jdk
          JRE=$JAVA_HOME/jre
          LC_ALL=zh_CN.GBK
          PATH=$JAVA_HOME/bin:$JRE/bin:$PATH
          CLASSPATH=.:$JAVA_HOME/bin/tools.jar:$JAVA_HOME/lib/dt.jar
          export JAVA_HOME JRE LC_ALL CLASSPATH PATH
          5、? ? ? ? 安裝MYSQL

          tar xvfz mysql-5.0.22.tar.gz
          cd mysql-5.0.22
          ./configure --prefix=/usr/local/mysql/ --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --enable-assembler
          make
          make install
          groupadd mysql
          useradd -g mysql mysql
          cp support-files/my-medium.cnf /etc/my.cnf
          cd /usr/local/mysql
          bin/mysql_install_db --user=mysql
          chown -R root??.
          chown -R mysql var
          chgrp -R mysql .
          bin/mysqld_safe --user=mysql &
          mysqladmin –uroot password new-password
          6、? ? ? ? 安裝php

          tar xvfz php-5.1.4.tar.gz
          cd php-5.1.4
          ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs
          make && make install
          cp php.ini-dist /usr/local/lib/php.ini
          7、? ? ? ? 安裝tomcat

          tar xvfz apache-tomcat-5.5.15.tar.gz
          mv apache-tomcat-5.5.15 tomcat
          8、? ? ? ? 安裝Apache和Tomcat連接

          tar zxvf tomcat-connectors-1.2.18-src.tar.gz
          cd tomcat-connectors-1.2.18-src/ native/
          ./configure --with-apxs=/usr/local/apache/bin/apxs
          make && make install
          三、? ? ? ? 配置httpd.conf

          cd /usr/local/conf/
          vi httpd.conf
          1、? ? ? ? 注釋掉一下幾行

          #ServerAdmin you@example.com
          #ServerName www.example.com:80
          #DocumentRoot "/usr/local/apache/htdocs"
          2、? ? ? ? 修改里面相關(guān)內(nèi)容
          A、

          <Directory />
          ? ? Options FollowSymLinks
          #? ? AllowOverride None
          ? ???AllowOverride all
          ? ???Order deny,allow
          #? ? Deny from all
          ? ???Allow from all
          </Directory>
          B、

          #<Directory "/usr/local/apache/htdocs">
          <Directory "/usr/local/tomcat/webapps">
          ? ? #
          ? ? # Possible values for the Options directive are "None", "All",
          ? ? # or any combination of:
          ? ? #? ?Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
          ? ? #
          ? ? # Note that "MultiViews" must be named *explicitly* --- "Options All"
          ? ? # doesn't give it to you.
          ? ? #
          ? ? # The Options directive is both complicated and important.??Please see
          ? ? # http://httpd.apache.org/docs/2.2/mod/core.html#options
          ? ? # for more information.
          ? ? #
          #? ? Options Indexes FollowSymLinks
          ? ? #
          ? ? # AllowOverride controls what directives may be placed in .htaccess files.
          ? ? # It can be "All", "None", or any combination of the keywords:
          ? ? #? ?Options FileInfo AuthConfig Limit
          ? ? #
          ? ? AllowOverride None

          ? ? #
          ? ? # Controls who can get stuff from this server.
          ? ? #
          ? ? Order allow,deny
          ? ? Allow from all

          </Directory>
          因為我這里將網(wǎng)站放在/usr/local/tomcat/webapps下

          C、將

          #Include conf/extra/httpd-vhosts.conf
          這行#除掉

          3、? ? ? ? 增加以下內(nèi)容:
          A、在AddType application/x-gzip .gz .tgz下增加以下兩行

          AddType application/x-httpd-php .php .phtml
          ? ?AddType application/x-httpd-php-source .phps
          B、結(jié)尾增加

          #add mod_jk module
          LoadModule jk_module modules/mod_jk.so
          # Update this path to match your modules location
          # Where to find workers.properties
          # Update this path to match your conf directory location (put workers.properties next to #httpd.conf)
          ??JkWorkersFile /usr/local/apache/conf/workers.properties
          # Where to put jk logs
          # Update this path to match your logs directory location (put mod_jk.log next to access_log)
          ??JkLogFile? ???/usr/local/apache/logs/mod_jk.log
          # Set the jk log level [debug/error/info]
          ??JkLogLevel? ? info
          # Select the log format
          ??JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
          # JkOptions indicate to send SSL KEY SIZE,
          ??JkOptions? ???+ForwardKeySize +ForwardURICompat -ForwardDirectories
          # JkRequestLogFormat set the request format
          ??JkRequestLogFormat? ???"%w %V %T"
          # Send everything for context /examples to worker named worker1 (ajp13)
          ??JkMount??/*.jsp worker1
          C、在/usr/local/apache/conf下增加一個workers.properties文件,內(nèi)容如下:

          # Define 1 real worker using ajp13
          ??worker.list=worker1
          # Set properties for worker1 (ajp13)
          ??worker.worker1.type=ajp13
          ??worker.worker1.host=localhost
          ??worker.worker1.port=8009
          ??worker.worker1.lbfactor=50
          ??worker.worker1.cachesize=10
          ??worker.worker1.cache_timeout=600
          ??worker.worker1.socket_keepalive=1
          ??worker.worker1.reclycle_timeout=300
          D、再編輯/usr/local/apache/conf/extra/下httpd-vhosts.conf文件

          vi httpd-vhosts.conf
          將里面例子修改一下

          <VirtualHost 192.168.0.170:80>
          <Directory "/usr/local/tomcat/webapps/ROOT" >
          DirectoryIndex index.htm index.html index.jsp index.php
          </Directory>
          ? ? ServerAdmin xxx@126.com
          ? ? DocumentRoot /usr/local/tomcat/webapps/ROOT
          ? ? ServerName 192.168.0.170
          ? ? ErrorLog logs/170-error_log
          ? ? CustomLog logs/170-access_log common
          </VirtualHost>
          因為沒有做域名解析,我這里在ServerName下直接用的是IP地址。
          四、? ? ? ? 測試
          先啟動tomcat,再啟動apache。啟動apache之前可以到apache/bin下測試一下虛擬域是否配置正確。./httpd –S 如果配置有錯誤會提示你。
          沒有問題后,在IE地址欄輸入http://192.168.0.170 此時將顯示的是tomcat的默認界面,證明可以正常訪問jsp文件了。再將/usr/local/tomcat/webapps/ROOT下index.jsp換一個index.php文件,只要在index.php里輸入以下內(nèi)容即可測試:

          <? echo phpinfo() ?>
          重啟apache,再在IE地址欄輸入http://192.168.0.170 將能看到php的相關(guān)信息。
          主要參考文章有:
          http://www.chinaunix.net/jh/13/669895.html
          http://www.chinaunix.net/jh/13/770898.html
          http://httpd.apache.org/docs/2.2/

          posted on 2006-09-13 09:02 都市淘沙者 閱讀(928) 評論(0)  編輯  收藏 所屬分類: Linux/OpenVPN/Python

          主站蜘蛛池模板: 格尔木市| 虹口区| 汉寿县| 金乡县| 高州市| 闽清县| 东源县| 汝阳县| 海伦市| 资中县| 田东县| 娄烦县| 德庆县| 汉沽区| 乐安县| 双桥区| 久治县| 车险| 吉首市| 砚山县| 玛纳斯县| 翼城县| 中阳县| 邢台市| 方正县| 河津市| 海宁市| 莱西市| 阿尔山市| 长武县| 怀化市| 瑞昌市| 宁晋县| 凤庆县| 余姚市| 遵义市| 桐庐县| 商洛市| 桃园县| 美姑县| 肇源县|