簡體   English   中英

在Glassfish中安裝awstats

[英]Install awstats in glassfish

我使用命令perl awstats_configure.pl為本地玻璃魚安裝awstats。 但是我有以下問題要回答:

請輸入您的Apache Web服務器的完整目錄路徑,如果您沒有本地Web服務器或沒有權限更改其設置,請輸入“ none”跳過此步驟。 示例:c:\\ Program files \\ apache組\\ apache Apache Web服務器路徑(“無”可跳過):

如果鍵入glassfish的根目錄,則需要回答以下問題。 這里真的很困惑,因為在玻璃魚中沒有“ httpd.conf”。 關於如何在glassfish服務器中安裝和配置awstats的任何想法將不勝感激。

Now, 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):

請嘗試以下操作:

啟用Glassfish訪問日志記錄

打開Glassfish Admin GUI( http://localhost:4848 ),導航到server-config > HTTP Service並啟用訪問日志記錄 格式更改為以下字符串: combined (這是Apache組合日志格式)。

現在,Glassfish應該開始記錄到GLASSFISH_HOME/glassfish/domains/domain1/logs/access

配置awstats:

打開您所在域的awstats.conf文件( awstats.yourdomain.com.conf ),或者如果沒有單獨的配置,則從/etc/awstats/awstats.conf獲取默認值。

更改LogFile如下所示:

LogFile="/GLASSFISH_HOME/glassfish/domains/domain1/logs/access/server_access_log.%YYYY-0-%MM-0-%DD-0.txt"

確保您為Glassfish日志文件插入正確的路徑。

LogFormat設置從4更改為1,這是Apache組合日志格式:

LogFormat=1

設置SiteDomain以匹配您的域,如果您在localhost上,則可以使用:

SiteDomain="local"

生成初始統計信息以測試awstats:

/usr/lib/cgi-bin/awstats.pl -config=local -update

您應該插入SiteDomain而不是本地的。

設置Apache

如果尚未安裝Apache HTTP Server,請安裝它。 通過鍵入以下a2enmod cgi啟用CGI: a2enmod cgi

打開默認站點的.conf( /etc/apache2/sites-enabled/default-ssl.conf ),然后在<VirtualHost>標記內添加以下內容:

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

保存文件並使用service apache2 restart重啟Apache。

現在應該可以在http://localhost/cgi-bin/awstats.pl下獲得這些統計信息(如果apache不是本地的,請插入您的域而不是localhost),或者如果您有多個站點,則可以使用http://localhost/cgi-bin/awstats.pl?config=yourdomain.com.

還有一種直接在Glassfish中啟用CGI的方法,因此您不需要Apache服務器,這在本博文中進行了介紹。

也可以看看:

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM