richardforth / apache2buddy

apache2buddy
Apache License 2.0
384 stars 72 forks source link

Apache2buddy does not find apache on bitnami installation #401

Open muimid opened 2 years ago

muimid commented 2 years ago

Hi, I'm trying to test apache on my bitnami canvas installation but running the script presents with the error below:

################################################## apache2buddy.pl report for d**s (x.x.x.x) ################################################## [ OK ] This script is being run as root. [ OK ] The utility 'pmap' exists and is available for use: /usr/bin/pmap [ OK ] The utility 'netstat' exists and is available for use: /bin/netstat [ @@ ] Unable to locate the PHP binary. PHP specific checks will be skipped. [ -- ] Unable to locate the apachectl utility. This script requires apachectl to analyze Apache's vhost configurations. [ -- ] Not fatal yet, trying to locate the apache2ctl utility instead. [ !! ] Unable to locate the apache2ctl utility. This script now requires apache2ctl to analyze Apache's vhost configurations. [ -- ] It looks like you might be running something else, other than apache..

My application runs ok but it runs within the bitnami stack... /opt/bitnami/...

If I try to run the script within the stack (with the command: /opt/bitnami/use_canvaslms), I get the error below:

[ FATAL ] Could not load the Diagnostics module.

Try:

  sudo apt-get install perl-modules

Then try running this script again.

--

So I'm stuck. Any help?

richardforth commented 2 years ago

Hi muimid,

Unfortunately if it is not a standard installation of Apache it will not work with apache2buddy.

Kind regards Richard.

On Fri, 14 Oct 2022, 15:04 muimid, @.***> wrote:

Hi, I'm trying to test apache on my bitnami canvas installation but running the script presents with the error below:

################################################## apache2buddy.pl report for d**s (x.x.x.x) ################################################## [ OK ] This script is being run as root. [ OK ] The utility 'pmap' exists and is available for use: /usr/bin/pmap [ OK ] The utility 'netstat' exists and is available for use: /bin/netstat [ @@ ] Unable to locate the PHP binary. PHP specific checks will be skipped. [ -- ] Unable to locate the apachectl utility. This script requires apachectl to analyze Apache's vhost configurations. [ -- ] Not fatal yet, trying to locate the apache2ctl utility instead. [ !! ] Unable to locate the apache2ctl utility. This script now requires apache2ctl to analyze Apache's vhost configurations. [ -- ] It looks like you might be running something else, other than apache..

My application runs ok but it runs within the bitnami stack... /opt/bitnami/...

If I try to run the script within the stack (with the command: /opt/bitnami/use_canvaslms), I get the error below:

[ FATAL ] Could not load the Diagnostics module.

Try:

sudo apt-get install perl-modules

Then try running this script again.

--

So I'm stuck. Any help?

— Reply to this email directly, view it on GitHub https://github.com/richardforth/apache2buddy/issues/401, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNFIV2RUHA3SIYNHBHHATTWDFR6LANCNFSM6AAAAAARFIWXNI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

muimid commented 2 years ago

Hi Richard,

Thank you for your quick response.

I made some progress from the initial error I was getting. I managed to install Apache2buddy within my stack and got it fired up with the commands below:

cd /opt

wget https://raw.githubusercontent.com/richardforth/apache2buddy/master/apache2buddy.pl

chmod +x apache2buddy.pl

I got a longer (and more encouraging?) report this time:

################################################## apache2buddy.pl report for ds (x.x.x.x) ################################################## [ OK ] This script is being run as root. [ OK ] The utility 'pmap' exists and is available for use: /usr/bin/pmap [ OK ] The utility 'netstat' exists and is available for use: /bin/netstat [ OK ] 'php' exists and is available for use: /opt/exam/php/bin/php [ OK ] The utility 'apachectl' exists and is available for use: /opt/bitnami/apache2/bin/apachectl [ OK ] The port (port 80) is a valid port. [ -- ] We are attempting to discover the operating system type and version number ... [ OK ] The 'python' binary exists and is available for use: /usr/bin/python [ -- ] Distro: Ubuntu [ -- ] Version: 16.04 [ -- ] Codename: xenial [ >> ] OS Version Checks were skipped by user directive, you may get errors. [ -- ] Hostname: ds [ -- ] Primary IP: x.x.x.x [ -- ] We are checking the service running on port 80... [ -- ] The process listening on port 80 is /opt/bitnami/apache2/bin/httpd.bin [ -- ] The process running on port 80 is not Apache. Falling back to process list... [ !! ] Could not find Apache process. Exiting...

Unfortunately, that's where I hit another brick wall. Can you figure out why the Apache process cannot be found even after the apachectl utility has been detected before?

Thank you.

richardforth commented 2 years ago

Hi muimid,

I admire your persistence.

I think it is that apache2buddy doesn't recognize this binary path as legitimate:

(Note there will be a big 'if' block somewhere checking this against known paths):

/opt/bitnami/apache2/bin/httpd.bin

On Sat, 15 Oct 2022, 09:06 muimid, @.***> wrote:

Hi Richard,

Thank you for your quick response.

I made some progress from the initial error I was getting. I managed to install Apache2buddy within my stack and got it fired up with the commands below:

cd /opt wget https://raw.githubusercontent.com/richardforth/apache2buddy/master/apache2buddy.pl chmod +x apache2buddy.pl

I got a longer (and more encouraging?) report this time:

################################################## apache2buddy.pl report for d

s (x.x.x.x) ################################################## [ OK ] This script is being run as root. [ OK ] The utility 'pmap' exists and is available for use: /usr/bin/pmap [ OK ] The utility 'netstat' exists and is available for use: /bin/netstat [ OK ] 'php' exists and is available for use: /opt/exam/php/bin/php [ OK ] The utility 'apachectl' exists and is available for use: /opt/bitnami/apache2/bin/apachectl [ OK ] The port (port 80) is a valid port. [ -- ] We are attempting to discover the operating system type and version number ... [ OK ] The 'python' binary exists and is available for use: /usr/bin/python [ -- ] Distro: Ubuntu [ -- ] Version: 16.04 [ -- ] Codename: xenial [ >> ] OS Version Checks were skipped by user directive, you may get errors. [ -- ] Hostname: ds [ -- ] Primary IP: x.x.x.x [ -- ] We are checking the service running on port 80... [ -- ] The process listening on port 80 is /opt/bitnami/apache2/bin/httpd.bin [ -- ] The process running on port 80 is not Apache. Falling back to process list... [ !! ] Could not find Apache process. Exiting...

Unfortunately, that's where I hit another brick wall. Can you figure out why the Apache process cannot be found even after the apachectl utility has been detected before?

Thank you.

— Reply to this email directly, view it on GitHub https://github.com/richardforth/apache2buddy/issues/401#issuecomment-1279691082, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNFIV7KK24PHJ4K4MU6GRLWDJQXNANCNFSM6AAAAAARFIWXNI . You are receiving this because you commented.Message ID: @.***>

muimid commented 2 years ago

I've tried some options you provided on the script:

Usage: apache2buddy.pl [OPTIONS] If no options are specified, the basic tests will be run. -p, --port=PORT Specify an alternate port to check (default: 80) --pid=PID Specify a PID to bypass the "Multiple PIDS listening on port 80" error. -v, --verbose Use verbose output (this is very noisy, only useful for debugging) -P, --no-check-pid DON'T Check the Parent Pid File Size (only use if desperate for more info, results may be skewed).

But while I'm able to get more info (verbose), it seems the script does not bypass the PID I provide.

####################################################### apache2buddy.pl report for ds () ####################################################### VERBOSE: UID of user is: 0 [ OK ] This script is being run as root. [ OK ] The utility 'pmap' exists and is available for use: /usr/bin/pmap [ OK ] The utility 'netstat' exists and is available for use: /bin/netstat [ OK ] 'php' exists and is available for use: /opt/bitnami/php/bin/php [ OK ] The utility 'apachectl' exists and is available for use: /opt/bitnami/apache2/bin/apachectl [ OK ] The port (port 80) is a valid port. [ -- ] We are attempting to discover the operating system type and version number ... [ OK ] The 'python' binary exists and is available for use: /usr/bin/python VERBOSE: Check OS platform VERBOSE: /usr/bin/python -c 'try: import platform print(platform.linux_distribution()) except AttributeError as e: pass' [ -- ] Distro: Ubuntu [ -- ] Version: 16.04 [ -- ] Codename: xenial [ >> ] OS Version Checks were skipped by user directive, you may get errors. [ -- ] Hostname: ds [ -- ] Primary IP: [ -- ] We are checking the service running on port 80... VERBOSE: PID is 1140 VERBOSE: Finding process running with a PID of 1140 VERBOSE: Found process /opt/bitnami/apache2/bin/httpd.bin [ -- ] The process listening on port 80 is /opt/bitnami/apache2/bin/httpd.bin [ -- ] The process running on port 80 is not Apache. Falling back to process list... [ !! ] Could not find Apache process. Exiting...

Anyway, the hunt continues...

richardforth commented 2 years ago

Are you able to put together a Docker file for a system that mimics your installation?

On Sat, 15 Oct 2022, 11:09 muimid, @.***> wrote:

I've tried some options you provided on the script:

Usage: apache2buddy.pl [OPTIONS] If no options are specified, the basic tests will be run. -p, --port=PORT Specify an alternate port to check (default: 80) --pid=PID Specify a PID to bypass the "Multiple PIDS listening on port 80" error. -v, --verbose Use verbose output (this is very noisy, only useful for debugging) -P, --no-check-pid DON'T Check the Parent Pid File Size (only use if desperate for more info, results may be skewed).

But while I'm able to get more info (verbose), it seems the script does not bypass the PID I provide.

####################################################### apache2buddy.pl report for d

s () ####################################################### VERBOSE: UID of user is: 0 [ OK ] This script is being run as root. [ OK ] The utility 'pmap' exists and is available for use: /usr/bin/pmap [ OK ] The utility 'netstat' exists and is available for use: /bin/netstat [ OK ] 'php' exists and is available for use: /opt/bitnami/php/bin/php [ OK ] The utility 'apachectl' exists and is available for use: /opt/bitnami/apache2/bin/apachectl [ OK ] The port (port 80) is a valid port. [ -- ] We are attempting to discover the operating system type and version number ... [ OK ] The 'python' binary exists and is available for use: /usr/bin/python VERBOSE: Check OS platform VERBOSE: /usr/bin/python -c 'try: import platform print(platform.linux_distribution()) except AttributeError as e: pass' [ -- ] Distro: Ubuntu [ -- ] Version: 16.04 [ -- ] Codename: xenial [ >> ] OS Version Checks were skipped by user directive, you may get errors. [ -- ] Hostname: ds [ -- ] Primary IP: [ -- ] We are checking the service running on port 80... VERBOSE: PID is 1140 VERBOSE: Finding process running with a PID of 1140 VERBOSE: Found process /opt/bitnami/apache2/bin/httpd.bin [ -- ] The process listening on port 80 is /opt/bitnami/apache2/bin/httpd.bin [ -- ] The process running on port 80 is not Apache. Falling back to process list... [ !! ] Could not find Apache process. Exiting...

Anyway, the hunt continues...

— Reply to this email directly, view it on GitHub https://github.com/richardforth/apache2buddy/issues/401#issuecomment-1279711859, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNFIVYYTD4ERCUOIORH4XTWDJ7GHANCNFSM6AAAAAARFIWXNI . You are receiving this because you commented.Message ID: @.***>

muimid commented 2 years ago

Hmmm... I've never done it before but I could try. I've currently cloned my system on a desktop computer on my network that allows me to run tests before implementing them on the production server. But I'll let you know if I make progress.

richardforth commented 2 years ago

If not if you have any instructions for installing bitnami I can use one of my existing Dockerfiles for Ubuntu.

I can't promise anything though as I've tried to avoid supporting edge cases.

On Sun, 16 Oct 2022, 08:56 muimid, @.***> wrote:

Hmmm... I've never done it before but I could try. I've currently cloned my system on a desktop computer on my network that allows me to run tests before implementing them on the production server. But I'll let you know if I make progress.

— Reply to this email directly, view it on GitHub https://github.com/richardforth/apache2buddy/issues/401#issuecomment-1279915534, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNFIVYGEH7PRAQRO2T553DWDOYKFANCNFSM6AAAAAARFIWXNI . You are receiving this because you commented.Message ID: @.***>

muimid commented 2 years ago

Hi Richard,

Thank you for your continued support (and bearing with me). I run my organisation's learning management system (Canvas) which we installed through an application provided by Bitnami.

To try it out, you can install a prepackaged virtual machine from here:

https://bitnami.com/stack/canvaslms/virtual-machine

Or you can install an earlier opensource linux package (similar to the one we are currently running) on your docker machine that I have saved at the link below:

File

Please let me know when you get the file so that I can remove the link. I would really like to know how to tune our server as we're expecting a lot of (concurrent) traffic during student online examinations soon.

richardforth commented 2 years ago

If you need some inspiration for Dockerfiles, here is a repository of the Dockerfiles Im using for my Jenkins Pipelines:

https://github.com/richardforth/docker/tree/main/forric

I cant use Virtual Machines I'm afraid.

I'm in the process of downloading the file, I'll let you know when it is downloaded.

richardforth commented 2 years ago

File has been downloaded, and Checked: Virus Free by Avast