Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / usr / share / bug / apache2 / | server ip : 172.67.156.115 your ip : 172.69.214.80 H O M E |
Filename | /usr/share/bug/apache2/script |
Size | 1.76 kb |
Permission | rwxr-xr-x |
Owner | root : root |
Create time | 27-Apr-2025 10:07 |
Last modified | 26-Nov-2018 20:08 |
Last accessed | 06-Jul-2025 16:42 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
#!/usr/bin/perl -w
use strict;
use Text::Wrap;
$Text::Wrap::columns = 70;
#open (my $out, ">&=3") or die "could not open FD 3\n";
open (my $out, ">&=0") or die "could not open FD 3\n";
our $AQUERY = 0;
our $PHP = 0;
if (-x "/usr/sbin/a2query")
{
$AQUERY = "/usr/sbin/a2query";
}
if ($AQUERY)
{
my $mpm = `$AQUERY -M`;
chomp($mpm);
print $out "Enabled MPM: $mpm\n";
}
my @modules;
if ($AQUERY)
{
print $out "List of enabled modules:\n";
@modules = `$AQUERY -m`;
}
else
{
print $out "a2query is not available.\n";
@modules = sort glob("/etc/apache2/mods-enabled/*.load");
map { s{^/etc/apache2/mods-enabled/(.*)\.load$}{$1} } @modules;
print $out "List of /etc/apache2/mods-enabled/*.load:\n";
}
if (! scalar @modules) {
print $out "Could not determine module list\n";
}
else {
my $missing;
foreach my $m (@modules) {
my ($m, @desc) = split(/\s+/, $m);
if (-e "/etc/apache2/mods-available/$m.conf" and
! -e "/etc/apache2/mods-enabled/$m.conf") {
$m .= "*";
$missing = 1;
}
if ($m =~ /^(php\d)/) {
$PHP = $1;
}
}
print $out wrap(" ", " ", "@modules\n");
print $out
wrap(" ", " ",
"(A * means that the .conf file for that module is not " .
"enabled in /etc/apache2/mods-enabled/)\n")
if $missing;
}
if (defined $PHP) {
my @exts = qx{egrep ^extension= /etc/$PHP/apache2/php.ini /etc/$PHP/apache2/conf.d/* 2>/dev/null};
if (scalar @exts) {
chomp @exts;
@exts = grep { ! m{\.dpkg-(?:bak|dist):} } @exts;
@exts = sort grep { s{^.*:extension=(\S+)\.\S+}{$1} } @exts;
print $out "List of enabled $PHP extensions:\n";
print $out wrap(" ", " ", "@exts\n");
}
}
if ($AQUERY)
{
my @confs;
print $out "List of enabled configurations:\n";
@confs = `$AQUERY -c`;
print $out wrap(" ", " ", "@confs\n");
}
use strict;
use Text::Wrap;
$Text::Wrap::columns = 70;
#open (my $out, ">&=3") or die "could not open FD 3\n";
open (my $out, ">&=0") or die "could not open FD 3\n";
our $AQUERY = 0;
our $PHP = 0;
if (-x "/usr/sbin/a2query")
{
$AQUERY = "/usr/sbin/a2query";
}
if ($AQUERY)
{
my $mpm = `$AQUERY -M`;
chomp($mpm);
print $out "Enabled MPM: $mpm\n";
}
my @modules;
if ($AQUERY)
{
print $out "List of enabled modules:\n";
@modules = `$AQUERY -m`;
}
else
{
print $out "a2query is not available.\n";
@modules = sort glob("/etc/apache2/mods-enabled/*.load");
map { s{^/etc/apache2/mods-enabled/(.*)\.load$}{$1} } @modules;
print $out "List of /etc/apache2/mods-enabled/*.load:\n";
}
if (! scalar @modules) {
print $out "Could not determine module list\n";
}
else {
my $missing;
foreach my $m (@modules) {
my ($m, @desc) = split(/\s+/, $m);
if (-e "/etc/apache2/mods-available/$m.conf" and
! -e "/etc/apache2/mods-enabled/$m.conf") {
$m .= "*";
$missing = 1;
}
if ($m =~ /^(php\d)/) {
$PHP = $1;
}
}
print $out wrap(" ", " ", "@modules\n");
print $out
wrap(" ", " ",
"(A * means that the .conf file for that module is not " .
"enabled in /etc/apache2/mods-enabled/)\n")
if $missing;
}
if (defined $PHP) {
my @exts = qx{egrep ^extension= /etc/$PHP/apache2/php.ini /etc/$PHP/apache2/conf.d/* 2>/dev/null};
if (scalar @exts) {
chomp @exts;
@exts = grep { ! m{\.dpkg-(?:bak|dist):} } @exts;
@exts = sort grep { s{^.*:extension=(\S+)\.\S+}{$1} } @exts;
print $out "List of enabled $PHP extensions:\n";
print $out wrap(" ", " ", "@exts\n");
}
}
if ($AQUERY)
{
my @confs;
print $out "List of enabled configurations:\n";
@confs = `$AQUERY -c`;
print $out wrap(" ", " ", "@confs\n");
}