简体   繁体   English

在Glassfish中安装awstats

[英]Install awstats in glassfish

I use the command perl awstats_configure.pl to install awstats for my local glassfish. 我使用命令perl awstats_configure.pl为本地玻璃鱼安装awstats。 But I've got the following question to answer: 但是我有以下问题要回答:

Please, enter full directory path of your Apache web server or 'none' to skip this step if you don't have local web server or don't have permission to change its setup. 请输入您的Apache Web服务器的完整目录路径,如果您没有本地Web服务器或没有权限更改其设置,请输入“ none”跳过此步骤。 Example: c:\\Program files\\apache group\\apache Apache Web server path ('none' to skip): 示例:c:\\ Program files \\ apache组\\ apache Apache Web服务器路径(“无”可跳过):

If I type the root directory of glassfish then I will need to answer the following question. 如果键入glassfish的根目录,则需要回答以下问题。 Really confused here as there is no "httpd.conf" in glassfish. 这里真的很困惑,因为在玻璃鱼中没有“ httpd.conf”。 Any idea on how install and config awstats in glassfish server will be much appreciated. 关于如何在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):

Try the following: 请尝试以下操作:

Enable Glassfish access logging 启用Glassfish访问日志记录

Open the Glassfish Admin GUI ( http://localhost:4848 ), navigate to server-config -> HTTP Service and enable Access Logging . 打开Glassfish Admin GUI( http://localhost:4848 ),导航到server-config > HTTP Service并启用访问日志记录 Change the Format to the following string: combined (this is Apache combined log format). 格式更改为以下字符串: combined (这是Apache组合日志格式)。

Now Glassfish should start logging to a file in GLASSFISH_HOME/glassfish/domains/domain1/logs/access . 现在,Glassfish应该开始记录到GLASSFISH_HOME/glassfish/domains/domain1/logs/access

Configure awstats: 配置awstats:

Open the awstats.conf file for your domain ( awstats.yourdomain.com.conf ) or if you don't have a separate config take the default from /etc/awstats/awstats.conf . 打开您所在域的awstats.conf文件( awstats.yourdomain.com.conf ),或者如果没有单独的配置,则从/etc/awstats/awstats.conf获取默认值。

Change the LogFile to look like this: 更改LogFile如下所示:

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

Make sure that you insert the correct path to your Glassfish log files. 确保您为Glassfish日志文件插入正确的路径。

Change the LogFormat setting from 4 to 1, this is the Apache combined log format: LogFormat设置从4更改为1,这是Apache组合日志格式:

LogFormat=1

Setup the SiteDomain to match your domain, if you are on localhost you can use: 设置SiteDomain以匹配您的域,如果您在localhost上,则可以使用:

SiteDomain="local"

Generate initial stats to test awstats: 生成初始统计信息以测试awstats:

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

Instead of local you should insert your SiteDomain. 您应该插入SiteDomain而不是本地的。

Setup the Apache 设置Apache

Install the Apache HTTP Server if don't already have it. 如果尚未安装Apache HTTP Server,请安装它。 Enable CGI by typing: a2enmod cgi 通过键入以下a2enmod cgi启用CGI: a2enmod cgi

Open the .conf of your default site ( /etc/apache2/sites-enabled/default-ssl.conf ) and add the following inside the <VirtualHost> tag: 打开默认站点的.conf( /etc/apache2/sites-enabled/default-ssl.conf ),然后在<VirtualHost>标记内添加以下内容:

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

Save the file and restart Apache with service apache2 restart . 保存文件并使用service apache2 restart重启Apache。

The stats should now be available under http://localhost/cgi-bin/awstats.pl (insert your domain instead of localhost if the apache is not local) or if you have multiple sites you can use http://localhost/cgi-bin/awstats.pl?config=yourdomain.com. 现在应该可以在http://localhost/cgi-bin/awstats.pl下获得这些统计信息(如果apache不是本地的,请插入您的域而不是localhost),或者如果您有多个站点,则可以使用http://localhost/cgi-bin/awstats.pl?config=yourdomain.com.

There is also a way to enable CGI directly in Glassfish so that you don't need the Apache server, it is described in this blog post . 还有一种直接在Glassfish中启用CGI的方法,因此您不需要Apache服务器,这在本博文中进行了介绍。

See also: 也可以看看:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM