Apache源碼編譯安裝

來源:互聯網
上載者:User

標籤:apache源碼編譯安裝

精髓前言:

解析JAVA程式用:tomcat、resin、weblogic、jboss

解析.asp .aspx程式用:pws,iis  後端資料庫為:sql server,access


IP PV UV:

IP:internet protocol    --internet協議

pv:page view         --訪問量

uv:unique visitor      --獨立訪客


簡單介紹cookie:

cookie: 訪問一個網站的時候,網站就會給你發一個cookie,獨一無二的


什麼是並發:

a.網站伺服器每秒最大接受使用者請求數

b.網站伺服器每秒響應的請求數

c.a+b

並發理解:伺服器能夠同時處理的最大串連數


web服務市場的主流:

靜態web服務:apache,nginx,iis,lighttpd,tengine

動態web服務:tomcat(中小企業),resin(大企業),php

==================================================================

php(gcgi)配合apache,php不是守護進程,而是mod_php5.so(module)  

配合Nginx,lighttpd,php守護進程模式,FCGIm模式。

==================================================================

Apache特點:穩點,安全,配置簡單,速度快,效能穩定可靠,可做Proxy 伺服器和負載平衡來使用。


# rpm -e --nodeps +服務    --卸載服務

====================================================================

編譯安裝Apache


安裝apache依賴包:

yum install zlib zlib-devel -y  安裝apache依賴包

Apache官網:(rpm包在官網下載)

https://www.apache.org/


解壓:

#tar xf httpd-2.2.27.tar.gz  


#cd httpd-2.2.27/

#./configure \

--prefix=/application/apache2.2.27 \  安裝的目錄

--enable-deflate \    

--enable-expores \ 緩衝多久

--enable-headers \ http的頭

--enable-modules=most \啟用http模組

--enable-so \

--with-mpm=worker \ 並發大

--enable-rewrite 偽靜態


# echo $?  返回0就沒錯誤

# make & make install

啟動服務:
# /application/apache/bin/apachectl -start

查看80連接埠看httpd起來沒有

# lsof -i :80   

跟蹤進程的進度:

# strace /application/apache/bin/apachectl -M 


什麼是虛擬機器主機:

1:基於網域名稱

2:基於IP

3:基於連接埠

=======================================================

列如:

網域名稱        網站

www.a.org    /var/html/a/

www.b.com    /var/html/b/

www.c.cn    /var/html/c/


編輯設定檔配置虛擬機器主機:

# vim /application/apache/conf/extra/httpd-vhost

<VirtualHost *:80>

    ServerAdmin [email protected]

    DocumentRoot "/var/html/a"

    ServerName www.a.org

    ServerAlias a.org

    ErrorLog "logs/www-error_log"      

    CustomLog "logs/www-access_log" common

</VirtualHost>


<VirtualHost *:80>

    ServerAdmin [email protected]

    DocumentRoot "/var/html/b"

    ServerName www.b.org

    ServerAlias b.org

    ErrorLog "logs/www-error_log"      

    CustomLog "logs/www-access_log" common

</VirtualHost>


<VirtualHost *:80>

    ServerAdmin [email protected]

    DocumentRoot "/var/html/c"

    ServerName www.c.org

    ServerAlias c.org

    ErrorLog "logs/www-error_log"      

    CustomLog "logs/www-access_log" common

</VirtualHost>

上面配置了三個主機,訪問 # curl www.a.org 等三個網頁做測試


編輯主設定檔:

# vim /application/apache/conf/httpd.conf 

Include conf/extra/httpd-vhosts.conf --開啟(預設是注釋掉的)

Include conf/extra/httpd-mpm.conf


編輯主配置添加一個容器

# vim /application/apache/conf/httpd.conf  

<Directory "/var/html">

        Options FollowSymLinks

        AllowOverride None

        Order allow,deny

        Allow from all

</Directory>


檢查文法:

# /application/apache/bin/apachectl -t 

平滑重啟,相當於reload:

# /application/apache/bin/apachect graceful 


apache日誌格式:

通用日誌格式(common log format)

組合日誌格式(combined log format)


apache 日誌輪詢

1.安裝工具cronolog

2.解壓 tar zxvf cronolog....... 

3.# ./configure make & make install 

4.# ll /usr/local/sbin/cronolog




alex將為你們更新後面的PHP報錯解決方案,希望以上博文對各位Linux愛好者有用~~


              linux營運交流群:288746884


本文出自 “11794562” 部落格,請務必保留此出處http://11804562.blog.51cto.com/11794562/1899628

Apache源碼編譯安裝

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.