Changeset 619

Show
Ignore:
Timestamp:
06/01/07 01:35:14 (1 year ago)
Author:
rats
Message:

- DATABASE:

  • changed Englisch language

- GUI:

  • Fixed: missing $cfg in tr-function
  • started build-in of AWStats (#7)
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/CHANGELOG

    r618 r619  
    1616        - GUI: 
    1717                * Fixed: missing $cfg in tr-function 
     18                * started build-in of AWStats (#7) 
    1819 
    19202007-05-31 Henrik Schytte 
  • trunk/configs/awstats/awstats.ispcp_tpl.conf

    r525 r619  
    1 # AWSTATS CONFIGURE FILE 6.4 
     1# AWSTATS CONFIGURE FILE 6.6 
    22#----------------------------------------------------------------------------- 
    33# Copy this file into awstats.www.mydomain.conf and edit this new config file 
     
    1111# the config value in an AWStats running session and can be used like others. 
    1212#----------------------------------------------------------------------------- 
    13 # $Revision: 1.318 $ - $Author: eldy $ - $Date: 2005/06/22 23:20:29 $ 
     13# $Revision: 1.327 $ - $Author: eldy $ - $Date: 2006/04/21 22:28:49 $ 
    1414 
    1515 
     
    4646# You can also use a pipe if log file come from a pipe : 
    4747# Example: "gzip -d </var/log/apache/access.log.gz |" 
    48 # If there is several log files from load balancing servers : 
     48# If there are several log files from load balancing servers : 
    4949# Example: "/pathtotools/logresolvemerge.pl *.log |" 
    5050# 
     
    145145# virtual web server. In this case, this parameter is only used to generate 
    146146# full URL's links when ShowLinksOnUrl option is set to 1. 
    147 # If analysing mail log, enter here the domain name of mail server. 
     147# If analyzing mail log, enter here the domain name of mail server. 
    148148# Example: "myintranetserver" 
    149149# Example: "www.domain.com" 
     
    223223 
    224224 
    225 # When this parameter is set to 1, AWStats add a button on report page to 
     225# When this parameter is set to 1, AWStats adds a button on report page to 
    226226# allow to "update" statistics from a web browser. Warning, when "update" is 
    227 # made from a browser, AWStats is ran as a CGI by the web server user defined 
     227# made from a browser, AWStats is run as a CGI by the web server user defined 
    228228# in your web server (user "nobody" by default with Apache, "IUSR_XXX" with 
    229229# IIS), so the "DirData" directory and all already existing history files 
     
    231231# necessary to "Read/Write" (and "Modify" for Windows NTFS file systems). 
    232232# Warning: Update process can be long so you might experience "time out" 
    233 # browser errors if you don't launch AWStats enough frequently
    234 # When set to 0, update is only made when AWStats is ran from the command 
     233# browser errors if you don't launch AWStats frequently enough
     234# When set to 0, update is only made when AWStats is run from the command 
    235235# line interface (or a task scheduler). 
    236236# Possible values: 0 or 1 
     
    240240 
    241241 
    242 # AWStats save and sort its database on a month basis, this allows to build 
    243 # build a report quickly. However, if you choose the -month=all from command 
    244 # line or value '-Year-' from CGI combo form to have a report for all year, 
    245 # AWStats needs to reload all data for full year, and resort them completely, 
     242# AWStats saves and sorts its database on a month basis (except if using 
     243# databasebreak option from command line).  
     244# However, if you choose the -month=all from command line or 
     245# value '-Year-' from CGI combo form to have a report for all year, AWStats 
     246# needs to reload all data for full year (each month), and sort them, 
    246247# requiring a large amount of time, memory and CPU. This might be a problem 
    247248# for web hosting providers that offer AWStats for large sites, on shared 
     
    264265#----------------------------------------------------------------------------- 
    265266 
    266 # When the update process run, AWStats can set a lock file in TEMP or TMP 
     267# When the update process runs, AWStats can set a lock file in TEMP or TMP 
    267268# directory. This lock is to avoid to have 2 update processes running at the 
    268269# same time to prevent unknown conflicts problems and avoid DoS attacks when 
     
    329330 
    330331 
    331 # This parameter give the list of all authorized authenticated users to view 
     332# This parameter gives the list of all authorized authenticated users to view 
    332333# statistics for this domain/config file. This parameter is used only if 
    333334# AllowAccessFromWebToAuthenticatedUsersOnly is set to 1. 
     
    340341 
    341342 
    342 # When this parameter is define to something, the IP address of the user that 
    343 # read its statistics from a browser (when AWStats is used as a CGI) is 
     343# When this parameter is defined to something, the IP address of the user that 
     344# reads its statistics from a browser (when AWStats is used as a CGI) is 
    344345# checked and must match one of the IP address values or ranges. 
    345346# Change : Effective immediatly 
     
    350351 
    351352 
    352 # If the "DirData" directory (see above) does not exists, AWStats return an 
     353# If the "DirData" directory (see above) does not exist, AWStats return an 
    353354# error. However, you can ask AWStats to create it. 
    354355# This option can be used by some Web Hosting Providers that has defined a  
     
    373374 
    374375# If you prefer having the report output pages be built as XML compliant pages 
    375 # instead of simple HTML pages, you can set this to 'xhtml' (May not works 
     376# instead of simple HTML pages, you can set this to 'xhtml' (May not work 
    376377# properly with old browsers). 
    377378# Change : Effective immediatly 
     
    386387# for both command line user and default web server user (nobody for Unix, 
    387388# IUSR_xxx for IIS/Windows,...). 
    388 # To avoid permission's problems between update process (run by an admin user) 
     389# To avoid permission problems between update process (run by an admin user) 
    389390# and CGI process (ran by a low level user), AWStats can save its database  
    390391# files with read and write permissions for everyone. 
    391 # By default, AWStats keep default user permissions on updated files. If you  
     392# By default, AWStats keeps default user permissions on updated files. If you  
    392393# set AllowToUpdateStatsFromBrowser to 1, you can change this parameter to 1. 
    393394# Change : Effective for new updates only 
     
    403404# With 0, no purge is made, so you must use a scheduled task or a web server 
    404405# that make this purge frequently. 
    405 # With 1, the purge of the log file is made each time AWStats update is ran. 
     406# With 1, the purge of the log file is made each time AWStats update is run. 
    406407# This parameter doesn't work with IIS (This web server doesn't let its log 
    407408# file to be purged). 
     
    428429 
    429430 
    430 # Each time you run the update process, AWStats overwrite the 'historic file' 
     431# Each time you run the update process, AWStats overwrites the 'historic file' 
    431432# for the month (awstatsMMYYYY[.*].txt) with the updated one. 
    432433# When write errors occurs (IO, disk full,...), this historic file can be 
     
    451452 
    452453# Do not include access from clients that match following criteria. 
    453 # If your log file contains IP adresses in host field, you must enter here 
    454 # matching IP adresses criteria. 
     454# If your log file contains IP addresses in host field, you must enter here 
     455# matching IP addresses criteria. 
    455456# If DNS lookup is already done in your log file, you must enter here hostname 
    456457# criteria, else enter ip address criteria. 
     
    497498 
    498499 
     500# Use SkipReferrersBlackList if you want to exclude records coming from a SPAM 
     501# referrer. Parameter must receive a local file name containing rules applied 
     502# on referrer field. If parameter is empty, no filter is applied. 
     503# An example of such a file is available in lib/blacklist.txt 
     504# You can download updated version at http://www.jayallen.org/comment_spam/ 
     505# Change : Effective for new updates only 
     506# Example: "/mylibpath/blacklist.txt" 
     507# Default: "" 
     508# 
     509# WARNING!! Using this feature make AWStats running very slower (5 times slower 
     510# with black list file provided with AWStats ! 
     511# 
     512SkipReferrersBlackList="" 
     513 
     514 
    499515# Include in stats, only accesses from hosts that match one of following 
    500516# entries. For example, if you want AWStats to filter access to keep only 
    501 # stats for visits from particular hosts, you can add those hosts names in 
     517# stats for visits from particular hosts, you can add those host names in 
    502518# this parameter. 
    503519# If DNS lookup is already done in your log file, you must enter here hostname 
     
    544560# Add here a list of kind of url (file extension) that must be counted as 
    545561# "Hit only" and not as a "Hit" and "Page/Download". You can set here all 
    546 # images extensions as they are hit downloaded that must be counted but they 
     562# image extensions as they are hit downloaded that must be counted but they 
    547563# are not viewed pages. URLs with such extensions are not included in the TOP 
    548564# Pages/URL report. 
     
    582598 
    583599 
    584 # Some web servers on some Operating systems (IIS-Windows) considers that a 
     600# Some web servers on some Operating systems (IIS-Windows) consider that a 
    585601# login with same value but different case are the same login. To tell AWStats 
    586 # to also considers them as one, set this parameter to 1. 
     602# to also consider them as one, set this parameter to 1. 
    587603# Change : Effective for new updates only 
    588604# Possible values: 0 or 1 
     
    612628# In URL links, "?" char is used to add parameter's list in URLs. Syntax is: 
    613629# /mypage.html?param1=value1&param2=value2 
    614 # However, some servers/sites use also others chars to isolate dynamic part of 
     630# However, some servers/sites use also other chars to isolate dynamic part of 
    615631# their URLs. You can complete this list with all such characters. 
    616632# Change : Effective for new updates only 
     
    697713 
    698714 
    699 # When an error occurs, AWStats output a message related to errors. If you 
     715# When an error occurs, AWStats outputs a message related to errors. If you 
    700716# want (in most cases for security reasons) to have no error messages, you 
    701717# can set this parameter to your personalized generic message. 
    702718# Change : Effective immediatly 
    703 # Example: "An error occured. Contact your Administrator" 
     719# Example: "An error occurred. Contact your Administrator" 
    704720# Default: "" 
    705721# 
     
    717733 
    718734 
    719 # To help you to detect if your log format is good, AWStats report an error 
     735# To help you to detect if your log format is good, AWStats reports an error 
    720736# if all the first NbOfLinesForCorruptedLog lines have a format that does not 
    721737# match the LogFormat parameter. 
     
    741757 
    742758# DecodeUA must be set to 1 if you use Roxen web server. This server converts 
    743 # all spaces in user agent field into %20. This make the AWStats robots, os 
     759# all spaces in user agent field into %20. This make the AWStats robots, OS 
    744760# and browsers detection fail in some cases. Just change it to 1 if and only 
    745761# if your web server is Roxen. 
     
    751767 
    752768 
    753 # MiscTrackerUrl can be used to make AWStats able to detect some miscellanous 
     769# MiscTrackerUrl can be used to make AWStats able to detect some miscellaneous 
    754770# things, that can not be tracked on other way, like: 
    755771# - Javascript disabled 
     
    763779# - Mediaplayer plugin 
    764780# - Acrobat PDF plugin 
    765 # To enable all this features, you must copy the awstats_misc_tracker.js file 
     781# To enable all these features, you must copy the awstats_misc_tracker.js file 
    766782# into a /js/ directory stored in your web document root and add the following 
    767783# HTML code at the end of your index page (but before </BODY>) : 
     
    787803#----------------------------------------------------------------------------- 
    788804 
    789 # Following values allows you to define accuracy of AWStats entities (robots, 
    790 # browsers, os, referers, file types) detection. 
     805# The following values allow you to define accuracy of AWStats entities 
     806# (robots, browsers, os, referers, file types) detection. 
    791807# It might be a good idea for large web sites or ISP that provides AWStats to 
    792808# high number of customers, to set this parameter to 1 (or 0), instead of 2. 
    793809# Possible values: 
    794 #  0 = No detection, 
    795 #  1 = Medium/Standard detection 
    796 #  2 = Full detection 
    797 # Change : Effective for new updates only 
     810#    0      = No detection, 
     811#    1      = Medium/Standard detection 
     812#    2      = Full detection 
     813# Change : Effective for new updates only 
     814# Note   : LevelForBrowsersDetection can also accept value "allphones". This 
     815#          enable detailed detection of phone/pda browsers. 
    798816# Default: 2 (0 for LevelForWormsDetection) 
    799817# 
    800818LevelForBrowsersDetection=2         # 0 disables Browsers detection. 
    801819                                    # 2 reduces AWStats speed by 2% 
     820                                    # allphones reduces AWStats speed by 5% 
    802821LevelForOSDetection=2               # 0 disables OS detection. 
    803822                                    # 2 reduces AWStats speed by 3% 
     
    830849 
    831850 
    832 # This parameter ask your browser to open detailed reports into a different 
     851# This parameter asks your browser to open detailed reports into a different 
    833852# window than the main page. 
    834853# Possible values: 
     
    842861 
    843862# You can add, in the HTML report page, a cache lifetime (in seconds) that 
    844 # will be returned to browser in HTTP header answer by server. 
    845 # This parameter is not used when report are built with -staticlinks option. 
     863# will be returned to the browser in HTTP header answer by server. 
     864# This parameter is not used when reports are built with -staticlinks option. 
    846865# Example: 3600 
    847866# Default: 0 
     
    851870 
    852871# To avoid too large web pages, you can ask AWStats to limit number of rows of 
    853 # all reported charts to this number when no other limit apply. 
     872# all reported charts to this number when no other limits apply. 
    854873# Default: 1000 
    855874# 
     
    858877 
    859878# Set your primary language (ISO-639-1 language codes). 
    860 # Possible value
     879# Possible values
    861880#  Albanian=al, Bosnian=ba, Bulgarian=bg, Catalan=ca, 
    862881#  Chinese (Taiwan)=tw, Chinese (Simpliefied)=cn, Croatian=hr, Czech=cz, 
    863882#  Danish=dk, Dutch=nl, English=en, Estonian=et, Euskara=eu, Finnish=fi, 
    864883#  French=fr, Galician=gl, German=de, Greek=gr, Hebrew=he, Hungarian=hu, 
    865 #  Icelandic=is, Indonesian=id, Italian=it, Japanese=jp, Korean=kr
     884#  Icelandic=is, Indonesian=id, Italian=it, Japanese=jp, Korean=ko
    866885#  Latvian=lv, Norwegian (Nynorsk)=nn, Norwegian (Bokmal)=nb, Polish=pl, 
    867886#  Portuguese=pt, Portuguese (Brazilian)=br, Romanian=ro, Russian=ru, 
     
    10391058 
    10401059# Some graphical reports are followed by the data array of values. 
    1041 # If you don't want this array (to reduce report size for example), you can 
    1042 # set thoose options to 0. 
     1060# If you don't want this array (to reduce the report size for example), you 
     1061# can set thoose options to 0. 
    10431062# Possible values: 0 or 1 
    10441063# Default: 1 
     
    10551074 
    10561075# In the Origin chart, you have stats on where your hits came from. You can 
    1057 # includes hits on pages that comes from pages of same sites in this chart. 
     1076# include hits on pages that come from pages of same sites in this chart. 
    10581077# Possible values: 0 or 1 
    10591078# Default: 0 
     
    10621081 
    10631082 
    1064 # Following parameter can be used to choose maximum number of lines shown for 
    1065 # the particular following report
     1083# The following parameters can be used to choose the maximum number of lines 
     1084# shown for the particular following reports
    10661085# 
    10671086# Stats by countries/domains 
     
    11081127# Choose if you want the week report to start on sunday or monday 
    11091128# Possible values: 
    1110 # 0 - Week start on sunday 
    1111 # 1 - Week start on monday 
     1129# 0 - Week starts on sunday 
     1130# 1 - Week starts on monday 
    11121131# Default: 1 
    11131132# 
     
    11151134 
    11161135 
    1117 # List of visible flags that links to other language translations. 
     1136# List of visible flags that link to other language translations. 
    11181137# See Lang parameter for list of allowed flag/language codes. 
    11191138# If you don't want any flag link, set ShowFlagLinks to "". 
     
    11331152 
    11341153 
    1135 # When AWStats build HTML links in its report pages, it starts thoose link 
     1154# When AWStats builds HTML links in its report pages, it starts those links 
    11361155# with "http://". However some links might be HTTPS links, so you can enter 
    11371156# here the root of all your HTTPS links. If all your site is a SSL web site, 
     
    11461165 
    11471166# Maximum length of URL part shown on stats page (number of characters). 
    1148 # This affects only URL visible text, link still work. 
     1167# This affects only URL visible text, links still work. 
    11491168# Default: 64 
    11501169# 
     
    11741193 
    11751194 
    1176 # Value of maximum bar width/height for horizontal/vertical HTML graphics bar
     1195# Value of maximum bar width/height for horizontal/vertical HTML graphics bars
    11771196# Default: 260/90 
    11781197# 
     
    11911210 
    11921211 
    1193 # Those colors parameters can be used (if StyleSheet parameter is not used) 
     1212# Those color parameters can be used (if StyleSheet parameter is not used) 
    11941213# to change AWStats look. 
    11951214# Example: color_name="RRGGBB"  # RRGGBB is Red Green Blue components in Hex 
     
    12231242#----------------------------------------------------------------------------- 
    12241243 
    1225 # Add here all plugins file you want to load. 
     1244# Add here all plugin files you want to load. 
    12261245# Plugin files must be .pm files stored in 'plugins' directory. 
    12271246# Uncomment LoadPlugin lines to enable a plugin after checking that perl 
     
    12311250# Perl modules required: None 
    12321251# Add some tooltips help on HTML report pages. 
    1233 # Note that enabled this kind of help will increased HTML report pages size, 
     1252# Note that enabling this kind of help will increased HTML report pages size, 
    12341253# so server load and bandwidth. 
    12351254# 
     
    12471266# This plugin gives AWStats capability to make reverse DNS lookup on IPv6 
    12481267# addresses. 
    1249 # Note: If you are interesting in having country report, you should use the 
     1268# Note: If you are interested in having country report, you should use the 
    12501269# geoipfree or geoip plugin instead of enabled reverse DNS lookup. 
    12511270# 
     
    12541273# Plugin: HashFiles 
    12551274# Perl modules required: Storable 
    1256 # AWStats DNS cache files are read/saved as native hash files. This increase 
     1275# AWStats DNS cache files are read/saved as native hash files. This increases 
    12571276# DNS cache files loading speed, above all for very large web sites. 
    12581277# 
     
    12681287# This plugin reduces AWStats speed of 8% ! 
    12691288# 
    1270 #LoadPlugin="geoip GEOIP_STANDARD
     1289#LoadPlugin="geoip GEOIP_STANDARD /pathto/GeoIP.dat
    12711290 
    12721291# Plugin: GeoIPfree 
     
    14021421 
    14031422# You can define your own charts, you choose here what are rows and columns 
    1404 # keys. This feature is particularly usefull for marketing purpose, tracking 
     1423# keys. This feature is particularly useful for marketing purpose, tracking 
    14051424# products orders for example. 
    14061425# For this, edit all parameters of Extra section. Each set of parameter is a 
     
    14171436#   Put an empty string for no test on code. 
    14181437# ExtraSectionConditionX are conditions you can use to count or not the hit, 
    1419 #   Use one of the field condition (URL,URLWITHQUERY,QUERY_STRING,REFERER,UA, 
    1420 #   HOST,extraX) and a regex to match, after a coma. Use "||" for "OR". 
     1438#   Use one of the field condition 
     1439#   (URL,URLWITHQUERY,QUERY_STRING,REFERER,UA,HOST,extraX) 
     1440#   and a regex to match, after a coma. Use "||" for "OR". 
    14211441# ExtraSectionFirstColumnTitleX is the first column title of the chart. 
    14221442# ExtraSectionFirstColumnValuesX is a string to tell AWStats which field to 
    1423 #   extract value from (URL,URLWITHQUERY,QUERY_STRING,REFERER,UA,HOST,extraX) 
     1443#   extract value from 
     1444#   (URL,URLWITHQUERY,QUERY_STRING,REFERER,UA,HOST,VHOST,extraX) 
    14241445#   and how to extract the value (using regex syntax). Each different value 
    14251446#   found will appear in first column of report on a different row. Be sure 
     
    14481469 
    14491470 
    1450 # There is also a global parameter ExtraTrackedRowsLimit that limit the 
     1471# There is also a global parameter ExtraTrackedRowsLimit that limits the 
    14511472# number of possible rows an ExtraSection can report. This parameter is 
    14521473# here to protect too much memory use when you make a bad setup in your 
     
    14671488# You can include other config files using the directive with the name of the 
    14681489# config file. 
    1469 # This is particularly usefull for users who have a lot of virtual servers, so 
     1490# This is particularly useful for users who have a lot of virtual servers, so 
    14701491# a lot of config files and want to maintain common values in only one file. 
    14711492# Note that when a variable is defined both in a config file and in an 
    14721493# included file, AWStats will use the last value read for parameters that 
    14731494# contains one value and AWStats will concat all values from both files for 
    1474 # parameters that are lists of value
     1495# parameters that are lists of values
    14751496# 
    14761497 
  • trunk/configs/crontab/crontab.conf

    r473 r619  
    1515 
    1616# AWStats 
    17 30      */2     * * *   /usr/share/awstats/tools/awstats_updateall.pl now -awstatsprog=/usr/lib/cgi-bin/awstats/awstats.pl 
     17{AWSTATS} 
    1818 
    1919# Rootkit Hunter 
     
    2424 
    2525# delayed tasks END. 
    26  
  • trunk/configs/crontab/working/crontab.conf

    r473 r619  
    33 
    44# Quota 
    5 0               23      * * *  {QUOTA_ROOT_DIR}/ispcp-dsk-quota &>{LOG_DIR}/ispcp-qsk-quota.log 
     50               23             * * *  {QUOTA_ROOT_DIR}/ispcp-dsk-quota &>{LOG_DIR}/ispcp-qsk-quota.log 
    66 
    77# Traffic 
    8 0,30    *       * * *  {TRAFF_ROOT_DIR}/ispcp-srv-traff &>{LOG_DIR}/ispcp-srv-traff.log 
    9 0,30    *       * * *  {TRAFF_ROOT_DIR}/ispcp-vrl-traff &>{LOG_DIR}/ispcp-vrl-traff.log 
    10 30              23      * * *  {TOOLS_ROOT_DIR}/ispcp-httpd-logs-mngr &>{LOG_DIR}/ispcp-httpd-logs-mngr.log 
     80,30    *               * * *  {TRAFF_ROOT_DIR}/ispcp-srv-traff &>{LOG_DIR}/ispcp-srv-traff.log 
     90,30    *               * * *  {TRAFF_ROOT_DIR}/ispcp-vrl-traff &>{LOG_DIR}/ispcp-vrl-traff.log 
     1015,45   *               * * *  {TRAFF_ROOT_DIR}/ispcp-vrl-traff-correction &>{LOG_DIR}/ispcp-vrl-traff-correction.log 
     1130              23              * * *  {TOOLS_ROOT_DIR}/ispcp-httpd-logs-mngr &>{LOG_DIR}/ispcp-httpd-logs-mngr.log 
    1112 
    1213# Backup 
    13 0               1       * * *  {BACKUP_ROOT_DIR}/ispcp-backup-all yes &>{LOG_DIR}/ispcp-backup-all-mngr.log 
     140               1              * * *  {BACKUP_ROOT_DIR}/ispcp-backup-all yes &>{LOG_DIR}/ispcp-backup-all-mngr.log 
    1415 
    1516# AWStats 
    16 30      */2     * * *   /usr/share/awstats/tools/awstats_updateall.pl now -awstatsprog=/usr/lib/cgi-bin/awstats/awstats.pl 
     17{AWSTATS} 
    1718 
    1819# Rootkit Hunter 
    19 0       0,12  * * *   rkhunter --createlogfile --cronjob 
     200              0,12   * * *   rkhunter --createlogfile --cronjob 
    2021 
    2122# [{DMN_NAME}] backup task START. 
  • trunk/configs/ispcp.conf

    r514 r619  
    136136# AWSTATS data 
    137137# 
    138 # Either no or path to the awstats configs dir (mostly: /etc/awstats) 
    139 AWSTATS_DIR = no 
    140  
    141 AWSTSTS_ROOT_DIR = /var/www/ispcp/engine/awstats 
    142  
    143 AWSTATS_WEB_DIR = /var/www/awstats 
     138AWSTATS_ACTIVE = no 
     139 
     140# could be 'dynamic' = 0 or 'static' = 1 
     141AWSTATS_MODE = 0 
     142 
     143AWSTATS_DIR = /etc/awstats 
     144 
     145AWSTATS_CACHE_DIR = /var/cache/awstats 
     146 
     147AWSTATS_CONFIG_DIR = /var/www/awstats 
     148 
     149AWSTATS_ENGINE_DIR = /usr/lib/cgi-bin 
     150 
     151AWSTATS_WEB_DIR = /usr/share/awstats 
     152 
    144153 
    145154# 
    146155# APACHE data 
    147156# 
    148  
    149157 
    150158APACHE_NAME = apache2 
  • trunk/engine/ispcp-dmn-mngr

    r597 r619  
    33253325    my $conf_dir = $main::cfg{'CONF_DIR'}; 
    33263326 
    3327     my $awstats_dir = $main::cfg{'AWSTATS_DIR'}; 
     3327    my $awstats_dir = $main::cfg{'AWSTATS_CONFIG_DIR'}; 
    33283328 
    33293329    my $tpl_dir = "$conf_dir/awstats"; 
     
    34613461    my $dmn_name = @$dmn_data[1]; 
    34623462 
    3463     my $conf_dir = $main::cfg{'CONF_DIR'}; 
    3464  
    3465     my $awstats_dir = $main::cfg{'AWSTATS_DIR'}; 
    3466  
    3467     my $tpl_dir = "$conf_dir/awstats"; 
     3463    my $awstats_dir = $main::cfg{'AWSTATS_CONFIG_DIR'}; 
    34683464 
    34693465    my $awstats_fname = "awstats.$dmn_name.conf"; 
     
    34983494    my $rs = undef; 
    34993495 
    3500     my $awstats_dir = $main::cfg{'AWSTATS_DIR'}; 
     3496    my $awstats = $main::cfg{'AWSTATS_ACTIVE'}; 
    35013497 
    35023498    push_el(\@main::el, 'dmn_add_data()', 'Starting...'); 
     
    35103506    } 
    35113507 
    3512     # check wether AWStats is enabled 
    3513     if ($awstats_dir ne 'no') { 
     3508    # check whether AWStats is enabled 
     3509    if ($awstats ne 'no') { 
    35143510        $rs = dmn_add_awstats_data($dmn_data); 
    35153511        return $rs if ($rs != 0); 
     
    35553551    } 
    35563552 
    3557     my $awstats_dir = $main::cfg{'AWSTATS_DIR'}; 
     3553    my $awstats = $main::cfg{'AWSTATS_ACTIVE'}; 
    35583554 
    35593555    $rs = dmn_change_named_data($dmn_data); 
     
    35693565    return $rs if ($rs != 0); 
    35703566 
    3571         # check wether AWStats is enabled 
    3572         if ($awstats_dir ne 'no') { 
     3567        # check whether AWStats is enabled 
     3568        if ($awstats ne 'no') { 
    35733569        $rs = dmn_change_awstats_data($dmn_data); 
    35743570                return $rs if ($rs != 0); 
     
    35923588    my $rs = undef; 
    35933589 
    3594     my $awstats_dir = $main::cfg{'AWSTATS_DIR'}; 
     3590    my $awstats = $main::cfg{'AWSTATS_ACTIVE'}; 
    35953591 
    35963592    push_el(\@main::el, 'dmn_del_data()', 'Starting...'); 
     
    36043600    } 
    36053601 
    3606         # check wether AWStats is enabled 
    3607         if ($awstats_dir ne 'no') { 
     3602    # check whether AWStats is enabled 
     3603    if ($awstats ne 'no') { 
    36083604        $rs = dmn_del_awstats_data($dmn_data); 
    36093605 
    36103606        return $rs if ($rs != 0); 
    3611        
     3607   
    36123608 
    36133609    $rs = dmn_del_named_data($dmn_data); 
  • trunk/engine/setup/ispcp-setup

    r610 r619  
    121121                 $main::ua{'hostname'} = $rdata; 
    122122                 $main::ua{'hostname_local'} = ( ($1) ? $1 : $4); 
    123 +                $main::ua{'hostname_local'} =~ s/^([\w][\w-]{0,253}[\w])\.(.*?)$/$1/; 
     123         $main::ua{'hostname_local'} =~ s/^([\w][\w-]{0,253}[\w])\.(.*?)$/$1/; 
    124124        } else { 
    125125 
     
    594594} 
    595595 
     596ask_awstats_on { 
     597 
     598        my ($rs, $rdata) = (undef, undef); 
     599 
     600        push_el(\@main::el, 'ask_awstats_on()', 'Starting...'); 
     601 
     602        my $qmsg = "\n    Activate AWStats [no]: "; 
     603 
     604        print STDOUT $qmsg; 
     605 
     606        $rdata = readline(\*STDIN); 
     607        chop($rdata); 
     608 
     609        if (!defined($rdata) || $rdata eq '') { 
     610                $main::ua{'awstats_on'} = 'no'; 
     611        } 
     612        else { 
     613                if ($rdata eq 'yes' || $rdata eq 'y') { 
     614                        $main::ua{'awstats_on'} = 'yes'; 
     615                } 
     616                else if ($rdata eq 'no' || $rdata eq 'n') { 
     617                        $main::ua{'awstats_on'} = 'no'; 
     618                } 
     619                else { 
     620                        print STDOUT "\n    Only '(y)es' and '(n)o' are allowed!"; 
     621                        return 1; 
     622                } 
     623        } 
     624 
     625        push_el(\@main::el, 'ask_awstats_on()', 'Ending...'); 
     626 
     627        return 0; 
     628} 
     629 
     630ask_awstats_dyn { 
     631 
     632        my ($rs, $rdata) = (undef, undef); 
     633 
     634        push_el(\@main::el, 'ask_awstats_dyn()', 'Starting...'); 
     635 
     636        my $qmsg = "\n    AWStats Mode ('(d)ynamic' or '(s)tatic') [dynamic]: "; 
     637 
     638        print STDOUT $qmsg; 
     639 
     640        $rdata = readline(\*STDIN); 
     641        chop($rdata); 
     642 
     643        if (!defined($rdata) || $rdata eq '') { 
     644                $main::ua{'awstats_dyn'} = '0'; 
     645        } 
     646        else { 
     647                if ($rdata eq 'dynamic' || $rdata eq 'd') { 
     648                        $main::ua{'awstats_dyn'} = '0'; 
     649                } 
     650                else if ($rdata eq 'static' || $rdata eq 's') { 
     651                        $main::ua{'awstats_dyn'} = '1'; 
     652                } 
     653                else { 
     654                        print STDOUT "\n    Only '(d)ynamic' or '(s)tatic' are allowed!"; 
     655                        return 1; 
     656                } 
     657        } 
     658 
     659        push_el(\@main::el, 'ask_awstats_dyn()', 'Ending...'); 
     660 
     661        return 0; 
     662} 
     663 
    596664sub user_dialog { 
    597665 
     
    686754        } while ($rs == 1); 
    687755 
     756        do { 
     757 
     758                $rs = ask_awstats_on(); 
     759 
     760        } while ($rs == 1); 
     761 
     762        do { 
     763 
     764                $rs = ask_awstats_dyn(); 
     765 
     766        } while ($rs == 1); 
     767 
     768 
    688769        push_el(\@main::el, 'user_dialog()', "hostname: $main::ua{'hostname'}"); 
    689770 
    690         push_el(\@main::el, 'user_dialog()',  "eth: $main::ua{'eth_ip'}"); 
    691  
    692         push_el(\@main::el, 'user_dialog()',  "panel_vhost: $main::ua{'admin_vhost'}"); 
    693  
    694         push_el(\@main::el, 'user_dialog()',  "db_host: $main::ua{'db_host'}"); 
    695  
    696         push_el(\@main::el, 'user_dialog()',  "db_name: $main::ua{'db_name'}"); 
    697  
    698         push_el(\@main::el, 'user_dialog()',  "db_user: $main::ua{'db_user'}"); 
    699  
    700         push_el(\@main::el, 'user_dialog()',  "db_password: $main::ua{'db_password'}"); 
    701  
    702         push_el(\@main::el, 'user_dialog()',  "admin: $main::ua{'admin'}"); 
    703  
    704         push_el(\@main::el, 'user_dialog()',  "admin_password: $main::ua{'admin_password'}"); 
    705  
    706         push_el(\@main::el, 'user_dialog()',  "admin_email: $main::ua{'admin_email'}"); 
    707  
    708         push_el(\@main::el, 'user_dialog()', 'Ending...'); 
     771        push_el(\@main::el, 'user_dialog()', "eth: $main::ua{'eth_ip'}"); 
     772 
     773        push_el(\@main::el, 'user_dialog()', "panel_vhost: $main::ua{'admin_vhost'}"); 
     774 
     775        push_el(\@main::el, 'user_dialog()', "db_host: $main::ua{'db_host'}"); 
     776 
     777        push_el(\@main::el, 'user_dialog()', "db_name: $main::ua{'db_name'}"); 
     778 
     779        push_el(\@main::el, 'user_dialog()', "db_user: $main::ua{'db_user'}"); 
     780 
     781        push_el(\@main::el, 'user_dialog()', "db_password: $main::ua{'db_password'}"); 
     782 
     783        push_el(\@main::el, 'user_dialog()', "admin: $main::ua{'admin'}"); 
     784 
     785        push_el(\@main::el, 'user_dialog()', "admin_password: $main::ua{'admin_password'}"); 
     786 
     787        push_el(\@main::el, 'user_dialog()', "admin_email: $main::ua{'admin_email'}"); 
     788 
     789        push_el(\@main::el, 'user_dialog()', "admin_email: $main::ua{'awstats_on'}"); 
     790 
     791        push_el(\@main::el, 'user_dialog()', "admin_email: $main::ua{'awstats_dyn'}"); 
     792 
     793        push_el(\@main::el, 'user_dialog()', "Ending..."); 
    709794 
    710795        return 0; 
     
    10551140        $rs = set_conf_val('DEFAULT_ADMIN_ADDRESS', $main::ua{'admin_email'}); 
    10561141 
     1142        return $rs if ($rs != 0); 
     1143 
     1144        $rs = set_conf_val('AWSTATS_ACTIVE', $main::ua{'awstats_on'}); 
     1145 
     1146        return $rs if ($rs != 0); 
     1147 
     1148        $rs = set_conf_val('AWSTATS_MODE', $main::ua{'avstats_dyn'}); 
     1149 
    10571150        $rs = store_conf(); 
    10581151 
     
    12881381        my $cfg_dir = "$main::cfg{'GUI_ROOT_DIR'}/tools/pma/"; 
    12891382        my $tmp_dir = "/var/www/ispcp/gui/phptmp"; 
    1290          
     1383 
    12911384        my @rand_data = ('A'..'Z', 'a'..'z', '0'..'9', '.', '/', '-', '*', ',', ':', ';'); 
    12921385 
    12931386        my ($i, $blowfish) = ('', ''); 
    1294          
     1387 
    12951388        for ($i = 0; $i < 31; $i++) { 
    1296          
     1389 
    12971390                $blowfish .= $rand_data[ rand() * ($#rand_data + 1) ]; 
    1298          
     1391 
    12991392        } 
    13001393 
     
    13651458                return $rs if ($rs != 0); 
    13661459 
     1460                if ($main::cfg{'AWSTATS_ACTIVE'} eq 'on') { 
     1461                        my $awstats = "15     6 * * * $main::cfg{'ROOT_DIR'}/engine/awstats/awstats_updateall.pl now -awstatsprog=$main::cfg{'AWSTATS_ENGINE_DIR'}/awstats.pl"; 
     1462                } 
     1463                else { 
     1464                        my $awstats = ''; 
     1465                } 
     1466 
    13671467                my %tag_hash = ( 
    13681468                                                '{LOG_DIR}' => $main::cfg{'LOG_DIR'}, 
     
    13701470                                                '{TRAFF_ROOT_DIR}' => $main::cfg{'TRAFF_ROOT_DIR'}, 
    13711471                                                '{TOOLS_ROOT_DIR}' => $main::cfg{'TOOLS_ROOT_DIR'}, 
    1372                                                 '{BACKUP_ROOT_DIR}' => $main::cfg{'BACKUP_ROOT_DIR'} 
     1472                                                '{BACKUP_ROOT_DIR}' => $main::cfg{'BACKUP_ROOT_DIR'}, 
     1473                                                '{AWSTATS}' => $awstats 
    13731474                                           ); 
    13741475 
     
    14201521 
    14211522        push_el(\@main::el, 'setup_resolver()', 'Starting...'); 
    1422          
     1523 
    14231524        my $resolv_file = "/etc/resolv.conf"; 
    14241525 
     
    14261527 
    14271528        $cmd = "$main::cfg{'CMD_CP'} -p -f $resolv_file $resolv_file.bkp"; 
    1428          
     1529 
    14291530        $rs = sys_command_rs($cmd); 
    1430          
     1531 
    14311532        return $rs if ($rs != 0); 
    14321533 
     
    14361537                $data .= "nameserver $main::cfg{'SECONDARY_DNS'}\n"; 
    14371538        } 
    1438          
     1539 
    14391540        $resolv_data = get_file($resolv_file); 
    1440          
     1541 
    14411542        # Comment this line if removing the existing nameservers causes any problem 
    14421543        $resolv_data =~ s/^nameserver[[:space:]]+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$//g; 
    1443          
     1544 
    14441545        $data .= $resolv_data; 
    14451546 
     
    14651566 
    14661567        my $ip = $main::ua{'eth_ip'}; 
    1467          
     1568 
    14681569        my $hosts_file = "/etc/hosts"; 
    1469          
     1570 
    14701571        $cmd = "$main::cfg{'CMD_CP'} -p -f $hosts_file $hosts_file.bkp"; 
    1471          
     1572 
    14721573        $rs = sys_command_rs($cmd); 
    1473          
    1474         return $rs if ($rs != 0); 
    1475          
     1574 
     1575        return $rs if ($rs != 0); 
     1576 
    14761577        $data  = "# 'hosts' file configuration.\n\n"; 
    14771578        $data .= "127.0.0.1\t$hostname_local\tlocalhost\n";