日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux可以http安装么,Linux 5下 http的安装

發布時間:2023/12/2 linux 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux可以http安装么,Linux 5下 http的安装 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Web網站服務(一)

http.conf中的全局配置

ServerRoot:用于設置httpd服務的根目錄,該目錄中包括運行Web站點必須的目錄和文件。默認根目錄為:/usr/local/apache2

Listen:用于設置Apache服務器監聽的網絡端口號,默認為80

User:用于設置運行httpd進程的用戶身份。

Group:用于設置運行httpd的進程的組身份

ServerAdmin:用于設置Apache2服務器管理員的E-mail地址,可通過此E-mail地址及時聯系Apache服務器的管理員。

ServerName:用于設置Apache服務器的完整主機名

DocumentRoot:用于設置網業文檔的在系統中的實際路徑。

DirectoryIndex:用于設置網站的默認索引頁(首頁)

ErrorLog:用于設置錯誤日志文件的路徑和文件名,默認設置為:/logs/error_log

LogLevel:用于設置記錄日志的級別,默認為Warm(警告)

CustmoLog:用于設置Apache服務器的訪問日志文件的路徑和格式類型。

PidFile:用于保存httpd服務器的程序進程號(PID)的文件,默認設置為/logs/httpd.pid

Timeout:用于設置Web服務器與瀏覽器之間網絡連接的超時秒數,默認為300秒

KeepAlive:用于設置是否使用保持連接功能,設置為ON時,將提高服務器響傳輸文件的效率

MaxKeepAliveRequests:用于設置客戶端每次連接允許請求響應的最大文件個數,默認為100個

KeepAliveTimeout:用于設置保持連接的超時秒數,默認是15秒

Include:用于包含另一個配置文件的內容,可以將實現一些特殊功能的配置單獨放到一個文件里,再使用Include配置項包含到httpd.conf主配置文件中來,便于獨立維護

編譯安裝apache

1、關閉防火墻

[root@s2

~]# service iptables stop

2、查看IP

[root@s2

~]# ifconfig eth0

eth0?Link encap:Ethernet?HWaddr

00:0C:29:C5:EC:AC

inet addr:10.0.0.1?Bcast:10.255.255.255?Mask:255.0.0.0

3、查看主機名

[root@s2

~]# hostname

s2.benet.com

4 卸載httpd

,并且將源碼包解壓

rpm -e

httpd httpd-manual webalizer subversion mod_python mod_ssl mod_perl

php php-common mysql dovecot –nodeps

tar xzf

httpd-2.2.17.tar.gz -C

/usr/src/?//將源碼包解壓到了/usr/src

5、編譯安裝apache

[root@s2

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

--enable-rewrite --enable-charset-lite && make &&

make install

6、查看安裝的結果

[root@s2 httpd]# ls /usr/local/httpd/

bin?build?cgi-bin?conf?error?htdocs?icons?include?lib?logs?man?manual?modules

那么httpd的執行目錄就在/usr/local/httpd/bin/這個目錄下,但是這樣我會覺得很冗余,所以用以前講過的ln來連接

[root@s2 httpd]# ln -s /usr/local/httpd/bin/*

/usr/local/bin/

[root@s2 /]#httpd -v

7、添加服務,添加服務識別配置

[root@s2 /]# cp

/usr/local/httpd/bin/apachectl?/etc/init.d/httpd

Vi

/et?c/init.d/httpd

#chkconfig: 35 85 15

#description: httpd start server

[root@s2 /]# chkconfig --add httpd

[root@s2 /]# chkconfig --list httpd

httpd?0:關閉1:關閉2:關閉3:啟用4:關閉5:啟用6:關閉

[root@s2 /]# chkconfig --level 35 httpd

on

[root@s2 /]#

8 如果你是基于dns做的,那么可以添加域名

Vi

/usr/local/httpd/conf/httpd.conf

ServerName www.benet.com:80

檢查httpd的語法錯誤

[root@s2 /]# /usr/local/httpd/bin/apachectl

-t

Syntax

OK

9

啟動httpd服務

/etc/init.d/httpd start

驗證是否開啟服務

[root@s2 /]# netstat -natp | grep

httpd

tcp?0?0

:::80?:::*?LISTEN?29040/httpd

10

測試時候成功

本機測試

Xp遠程測試(是建立在域名訪問)

使用awstats分析日志

1、解壓并釋放awstats軟件包,執行目錄中的awstats_confirure.pl腳步進行安裝

[root@s2

/]# unzip awstats-7.0.zip

[root@s2

/]# mv awstats-7.0 /usr/local/awstats

[root@s2

tools]# cd /usr/local/awstats/tools/

[root@s2

tools]# ./awstats_configure.pl

-----

AWStats awstats_configure 1.0 (build 1.9) (c) Laurent Destailleur

-----

This tool

will help you to configure AWStats to analyze statistics

for

one web

server. You can try to use it to let it do all that is

possible

in AWStats

setup, however following the step by step manual setup

documentation (docs/index.html) is often a better idea.

Above all if:

- You are

not an administrator user,

- You want

to analyze downloaded log files without web server,

- You want

to analyze mail or ftp log files instead of web log

files,

- You need

to analyze load balanced servers log files,

- You want

to 'understand' all possible ways to use AWStats...

Read the

AWStats documentation (docs/index.html).

----->

Running OS detected: Linux, BSD or Unix

----->

Check for web server install

Enter full

config file path of your Web server.

Example:

/etc/httpd/httpd.conf

Example:

/usr/local/apache2/conf/httpd.conf

Example:

c:\Program files\apache group\apache\conf\httpd.conf

Config

file path ('none' to skip web server setup):

>

/usr/local/httpd/conf/httpd.conf?//這個是apache的主配置文件路徑

----->

Check and complete web server config file

'/usr/local/httpd/conf/httpd.conf'

Warning:

You Apache config file contains directives to write 'common' log

files

This means

that some features can't work (os, browsers and keywords

detection).

Do you

want me to setup Apache to write 'combined' log files [y/N]

? y?//設置日志類型默認y

Add 'Alias /awstatsclasses

"/usr/local/awstats/wwwroot/classes/"'

Add 'Alias /awstatscss

"/usr/local/awstats/wwwroot/css/"'

Add 'Alias /awstatsicons

"/usr/local/awstats/wwwroot/icon/"'

Add 'ScriptAlias /awstats/

"/usr/local/awstats/wwwroot/cgi-bin/"'

Add '' directive

AWStats directives added to Apache

config file.

----->

Update model config file

'/usr/local/awstats/wwwroot/cgi-bin/awstats.model.conf'

File awstats.model.conf

updated.

----->

Need to create a new config file ?

Do you

want me to build a new AWStats config/profile

file

(required if first install) [y/N] ? y?//設置站點配置文件,

----->

Define config file name to create

What is

the name of your web site or profile analysis ?

Example:

www.mysite.com

Example:

demo

Your web

site, virtual server or profile name:

> www.benet.com?//你要統計網站的名稱

----->

Define config file path

In which

directory do you plan to store your config file(s) ?

Default:

/etc/awstats

Directory

path to store config file(s) (Enter for default):

>

以后的內容直接回車就可以完成配置了

2、修改awstats.www.benet.conf的配置文件

[root@s2

tools]# vi /etc/awstats/awstats.www.benet.com.conf

第51行,修改日志保存的位置

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

3、創建數據庫的存放目錄,并更新數據庫

[root@s2

tools]# mkdir /var/lib/awstats

[root@s2

tools]#

/usr/local/awstats/tools/awstats_updateall.pl?//執行更新腳本,重新讀取剛才設置的日志路徑

Running

'"/usr/local/awstats/wwwroot/cgi-bin/awstats.pl" -update

-config=www.benet.com -configdir="/etc/awstats"' to update config

www.benet.com

Create/Update database for config

"/etc/awstats/awstats.www.benet.com.conf" by AWStats version 7.0

(build 1.971)

From data

in log file "/usr/local/httpd/logs/access_log"...

Phase 1 :

First bypass old records, searching new record...

Searching

new records from beginning of log file...

Jumped

lines in file: 0

Parsed

lines in file: 2

Found 0 dropped records,

Found 0 comments,

Found 0 blank records,

Found 2 corrupted records,

Found 0 old records,

Found 0 new qualified records.

4、寫入周期性計劃任務,定期統計

[root@s2

tools]# crontab -l

0 0 * * 1

/usr/local/awstats/tools/awstats_updateall.pl

now

寫入周期性計劃任務

[root@s2

tools]#

5、訪問測試

[root@s2 awstats]# /etc/init.d/httpd

restart

重啟一下httpd服務

6、做網站的授權訪問

編輯httpd.conf配置文件,查找關于awstats的目錄區域設置,添加認證授權設置

Options FollowSymLinks

AllowOverride None

Order deny,allow

Deny

from all

AuthName?"AWSTATS"

AuthType Basic

AuthUserFile?/usr/local/awstats/wwwroot/.htpasswd

require?valid-user

AuthName:定義受保護的領域名稱,將在彈出的認證登陸對話框中顯示

AuthType:設置認證的類型,Basic為基本認證

AuthUserFile:設置用于保存用戶賬號、密碼的認證文件路徑

require

valid-user :授權給認證文件中的所有有效用戶。

創建存儲認證用戶及賬號口令的文件

[root@s2

~]# cd /usr/local/httpd/bin/

[root@s2

bin]# ./htpasswd?-c

/usr/local/awstats/wwwroot/.htpasswd wode

New

password:

Re-type

new password:

Adding

password for user wode

、重啟httpd服務

[root@s2 ~]# /etc/init.d/httpd?restart

結果:

創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎

總結

以上是生活随笔為你收集整理的linux可以http安装么,Linux 5下 http的安装的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。