gustavmaskowitz / apachebuddy.pl

Not written by me, no longer maintained by me : Apachebuddy.pl
97 stars 59 forks source link

DOS Newlines in Configs #8

Open tonyborries opened 11 years ago

tonyborries commented 11 years ago

On CentOS (6.4) Windows / DOS newlines in the config files cause a crash.

[root@tonyb-centoslamp apachebuddy.pl]# unix2dos /etc/httpd/conf/httpd.conf 
unix2dos: converting file /etc/httpd/conf/httpd.conf to DOS format ...
[root@tonyb-centoslamp apachebuddy.pl]# perl apachebuddy.pl 
########################################################################
# Apache Buddy v 0.3 ###################################################
########################################################################
Gathering information...
We are checking the service running on port 80
The process listening on port 80 is /usr/sbin/httpd
The process running on port 80 is Apache/2.2.15 (Unix)
Apache has been running 0d 0h 59m 40s
The full path to the Apache config file is: /etc/httpd/conf/httpd.conf
Apache is using prefork model

Examining your Apache configuration...
Apache runs as apache
Your max clients setting is 33

Analyzing memory use...
Your server has 489 MB of memory
Use of uninitialized value $proc_mem_usages[0] in division (/) at
    apachebuddy.pl line 330 (#1)
    (W uninitialized) An undefined value was used as if it were already
    defined.  It was interpreted as a "" or a 0, but maybe it was a mistake.
    To suppress this warning assign a defined value to your variables.

    To help you figure out what was undefined, perl will try to tell you the
    name of the variable (if any) that was undefined. In some cases it cannot
    do this, so it also tells you what operation you used the undefined value
    in.  Note, however, that perl optimizes your program and the operation
    displayed in the warning may not necessarily appear literally in your
    program.  For example, "that $foo" is usually optimized into "that "
    . $foo, and the warning will refer to the concatenation (.) operator,
    even though there is no . in your program.

Use of uninitialized value $proc_mem_usages[0] in division (/) at
    apachebuddy.pl line 336 (#1)
Use of uninitialized value $count in division (/) at apachebuddy.pl line 350 (#1)

Illegal division by zero at apachebuddy.pl line 350 (#2)
    (F) You tried to divide a number by 0.  Either something was wrong in
    your logic, or you need to put a conditional in to guard against
    meaningless input.

Uncaught exception from user code:
    Illegal division by zero at apachebuddy.pl line 350.
 at apachebuddy.pl line 350
    main::get_memory_usage('/usr/sbin/httpd', 'apache\x{d}', 'average') called at apachebuddy.pl line 1044
[root@tonyb-centoslamp apachebuddy.pl]# dos2unix /etc/httpd/conf/httpd.conf 
dos2unix: converting file /etc/httpd/conf/httpd.conf to UNIX format ...
[root@tonyb-centoslamp apachebuddy.pl]# perl apachebuddy.pl 
########################################################################
# Apache Buddy v 0.3 ###################################################
########################################################################
Gathering information...
We are checking the service running on port 80
The process listening on port 80 is /usr/sbin/httpd
The process running on port 80 is Apache/2.2.15 (Unix)
Apache has been running 0d 01h 00m 05s
The full path to the Apache config file is: /etc/httpd/conf/httpd.conf
Apache is using prefork model

Examining your Apache configuration...
Apache runs as apache
Your max clients setting is 33

Analyzing memory use...
Your server has 489 MB of memory
The largest apache process is using 6.92 MB of memory
The smallest apache process is using 6.92 MB of memory
The average apache process is using 6.92 MB of memory
Going by the average Apache process, Apache can potentially use 228.36 MB RAM (46.70 % of available RAM)
Going by the largest Apache process, Apache can potentially use 228.36 MB RAM (46.70 % of available RAM)

Generating reports...
### GENERAL REPORT ###

Settings considered for this report:

    Your server's physical RAM:     489MB
    Apache's MaxClients directive:      33
    Apache MPM Model:           prefork
    Largest Apache process (by memory): 6.92MB
[ OK ]  Your MaxClients setting is within an acceptable range.
    Max potential memory usage:         228.36 MB

    Percentage of RAM allocated to Apache   46.70 %

-----------------------------------------------------------------------
-----------------------------------------------------------------------