在基於WindowAzure雲端服務器CentOS6.5下安裝Apache2.4.9服務

來源:互聯網
上載者:User

今天以了0.22元/小時的價格購買了微軟A0類型的雲端服務器
768M記憶體、127G硬碟、5M獨顯頻寬

下面開始安裝Apache2.4.9服務。
在安裝之前,檢查了一下gcc,無語啊,是最小配置安裝,沒有任何軟體,系統佔用了1.9G。
沒gcc,我直接yum安裝了gcc
[testuser@localhost ~]sudo su root
[root@localhost ~]yum install gcc
[root@localhost ~]# yum -y install gcc-c++

gcc安裝完成了,接下來就知道了沒有任何軟體安裝,也就是 要自己去安裝Apr和apr-util了
apr官網
http://apr.apache.org/
Apr-util官方
http://apr.apache.org/

我將檔案直接wget到我的軟體目錄/opt/soft/
[testuser@localhost soft]sudo wget http://apache.fayea.com/apache-mirror//apr/apr-1.5.0.tar.gz

[testuser@localhost soft]sudo wget http://apache.fayea.com/apache-mirror//apr/apr-util-1.5.3.tar.gz

[testuser@localhost soft]sudo wget http://mirror.esocc.com/apache//httpd/httpd-2.4.9.tar.gz

[testuser@localhost soft]sudo wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz

解壓apr-1.5.0.tar.gz
tar -xzvf apr-1.5.0.tar.gz
cd apr-util-1.5.3
./configure--prefix=/usr/local/apr
make
make test
make install

解壓apr-util.1.5.3.tar.gz
tar -xzvf apr-util-1.5.3.tar.gz
cd apr-util-1.5.3
./configure--prefix=/usr/local/apr-util
make
make test
make install

解壓pcre-8.35.tar.gz
tar -xzvf pcre-8.35.tar.gz
cd pcre-8.35
./configure --prefix=/usr/local/pcre
make
make test
make install

解壓httpd-2.4.9.tar.gz
tar -xzvf httpd-2.4.9.tar.gz
cd httpd-2.4.9
./configure --prefix=/opt/ansitech/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre/
make
make test
make install

解壓tomcat-connectors-1.2.39-src.tar.gz
[root@localhost sudytech]# tar -xzvf tomcat-connectors-1.2.39-src.tar.gz
[root@localhost sudytech]# cd tomcat-connectors-1.2.39-src/native
[root@localhost native]# ./configure --prefix=/usr/local/tomcat-connector --with-apxs=/opt/ansitech/apache2/bin/apxs
[root@localhost native]# make
[root@localhost native]# make install
在/opt/ansitech/apache2/modules/ 下會產生mod_jk.so

4.配置httpd.conf
內容如下
-----------------------------------------------------------
# 載入 mod_jk 模組
LoadModule jk_module modules/mod_jk.so
Include conf/mod_jk.conf
-----------------------------------------------------------

建立mod_jk.conf
內容如下
-------------------------------------------------------
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"

JKMount /*.jsp worker1
-------------------------------------------------------
接下來我們在 Apache 的 conf 目錄下建立兩個檔案分別是 workers.properties、uriworkermap.properties(可省略)
內容如下
-----------------------------------------------------------
worker.list=worker1

worker.worker1.type=ajp13
worker.worker1.host=127.0.0.1
worker.worker1.port=8009
worker.worker1.lbfactor=50
worker.worker1.cachesize=10
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=300
-----------------------------------------------------------

啟動apache、啟動tomcat,訪問,成功!
It's Works~!

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.