apache安裝,鎮博

來源:互聯網
上載者:User

標籤:apache

1、配置IP地址

[[email protected] ~]#vim /etc/sysconfig/network-scripts/ifcfg-eth0 

[[email protected] ~]#service network restart

[[email protected] ~]#ifconfig eth0

2、查看並安裝httpd

[[email protected] ~]#rpm -q httpd

[[email protected] ~]#rpm -e httpd --nodeps

[[email protected] ~]#tar -zxvf httpd-2.2.17.tar.gz -C /usr/src/

[[email protected] ~]#cd /usr/src/httpd-2.2.17/

[[email protected] httpd-2.2.17]# ./configure --prefix=/usr/local/httpd --enable-so --enable

rewrite --enable-charset-lite --enable-cgi

[[email protected] httpd-2.2.17]# make && make install

[[email protected] ~]#ls /usr/local/httpd/

        啟動並查看服務

        [[email protected] ~]#/usr/local/httpd/bin/apachectl -t

        [[email protected] ~]#/usr/local/httpd/bin/apachectl -v

        [[email protected] ~]#/usr/local/httpd/bin/apachectl start

        [[email protected] ~]#netstat -anpt | grep 80

        [[email protected] ~]#firefox http://192.168.1.1/ &

        [[email protected] ~]#echo "/usr/local/httpd/bin/apachectl start" >> /etc/rc.d/rc.local

3、最佳化執行路徑

[[email protected] ~]#ln -s /usr/local/httpd/bin/* /usr/local/bin/

[[email protected] ~]#apachectl -t

4、添加為系統服務

[[email protected] ~]#cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd

[[email protected] ~]#chmod +x /etc/init.d/httpd

[[email protected] ~]#vim /etc/init.d/httpd

添加:

#chkconfig:35 85 36

#description:hhhhhhhhh

file:///H|/Y2-linux安全與進階應用程式/第1章:http(一).txt[2015/9/18 12:07:32]

[[email protected] ~]#chkconfig --add httpd

[[email protected] ~]#chkconfig --list

[[email protected] ~]#chkconfig --list | wc -l

[[email protected] ~]#chkconfig --list httpd

[[email protected] ~]#chkconfig httpd on

[[email protected] ~]#chkconfig --level 345 httpd on

[[email protected] ~]#service httpd stop

[[email protected] ~]#service httpd start

[[email protected] ~]#netstat -anpt | grep 80

5、用戶端驗證:

[[email protected] ~]#firefox http://192.168.1.1/ &

二、安裝日誌分析系統

1、解壓並安裝軟體

[[email protected] ~]#tar -zxvf awstats-7.3.tar.gz -C /usr/src/

[[email protected] ~]#mv awstats-7.3/ /usr/local/awstats

2、配置awstats

[[email protected] ~]#cd /usr/local/awstats/tools/

[[email protected] tools]#chmod +x awstats_configure.pl awstats_updateall.pl 

[[email protected] tools]#./awstats_configure.pl 

[[email protected] tools]#vim /etc/awstats/awstats.www.benet.com.conf

修改:

LogFile="/usr/local/httpd/logs/access_log"

[[email protected] tools]#mkdir /var/lib/awstats

3、設定周期性計劃任務並運行awstats

[[email protected] tools]#./awstats_updateall.pl now

[[email protected] tools]#crontab -e -u root

添加:

*/5 * * * *     /usr/local/awstats/tools/awstats_updateall.pl now

file:///H|/Y2-linux安全與進階應用程式/第1章:http(一).txt[2015/9/18 12:07:32]

[[email protected] tools]#service crond restart

[[email protected] tools]#chkconfig --add crond

[[email protected] tools]#chkconfig crond on

4、用戶端訪問:

http://www.benet.com/awstats/awstats.pl

注意:訪問awstats時,必須使用網域名稱。


本文出自 “linux、win營運知識” 部落格,轉載請與作者聯絡!

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.