Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Could not find Apache process. Exiting..." #17

Open
stephen304 opened this issue Mar 18, 2014 · 27 comments
Open

"Could not find Apache process. Exiting..." #17

stephen304 opened this issue Mar 18, 2014 · 27 comments

Comments

@stephen304
Copy link

I have apache2 installed via apt-get on ubuntu 13.10 x64. Here is the output of apachebuddy:

########################################################################
# 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/apache2
The process running on port 80 is not Apache. 
 Falling back to process list...
Could not find Apache process. Exiting...

So you can see it finds apache2, but it somehow doesn't think it's apache...

@JordanMagnuson
Copy link

I'm running Apache2 behind Varnish, and no luck...

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/varnishd
The process running on port 80 is not Apache.
Falling back to process list...
Could not find Apache process. Exiting...

@JordanMagnuson
Copy link

Easy fix in my case:

perl apachebuddy.pl --port=8080

@stephen304
Copy link
Author

The problem for me is that apahe is running on port 80, not 8080... yet apachebuddy still won't recognize it.

@willtate
Copy link

I'm seeing the same issue as @stephen304. I initially installed via Ubuntu 13.10 but recently upgraded to 14.04 LTS.

output:

########################################################################
# 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/apache2
The process running on port 80 is not Apache. 
 Falling back to process list...
Could not find Apache process. Exiting...

@draiocht
Copy link

Same output as willtate
Ubuntu 14.04 LTS Server 64bit
Clean install on 14.04, basic apache install, no varnish
$apache2 -v
Server version: Apache/2.4.7 (Ubuntu)
Server built: Apr 3 2014 12:20:28

@draiocht
Copy link

Same output as willtate
Ubuntu 14.04 LTS Server 64bit
Clean install on 14.04, basic apache install, no varnish
$apache2 -v
Server version: Apache/2.4.7 (Ubuntu)
Server built: Apr 3 2014 12:20:28

CAUSE : CAPITAL V unnecessary for the purpose of the function to ID apache.
On my system it invokes
sudo /usr/sbin/apache2 -V
which outputs nonsense only, no versions.
sudo /usr/sbin/apache2 -v just gives a version without a mile of complaints first which throw perl off as it looks for the id in the first line of output only.

SOLUTION TO JUST THIS STEP - which basically only hides the underlying problem so apachebuddy does recognise it is apache.
CHANGE
my @output = $process_name -V 2>&1;
to
my @output = $process_name -v 2>&1;

that got me past that issue - but onwards into other ones..... Ubuntu really changed about a lot of apache structural stuff with 14.04. Paths, splitting up configs etc. mucho broken :/ /usr/sbin/apache2 cant really be invoked in this way. for more info, see the default index.html file on a fresh install of 14.04, it talks a lot about what changed and is unusually informative.

@draiocht
Copy link

Rename issue to compatibility with Ubuntu 14.04 LTS apache2

@BillyGriffiths
Copy link

Experience same issue on 14.04 LTS. Anyone have a workaround for this yet?

########################################################################

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/apache2
The process running on port 80 is not Apache.
Falling back to process list...
Could not find Apache process. Exiting...

@kfo2010
Copy link

kfo2010 commented Nov 13, 2014

Experience same issue on 14.04 LTS w/ Apache 2.4. States constants set by envvars do not exist or the script can't read them when loading /etc/apache2/apache2.conf.

AH00526: Syntax error on line 76 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}
[Thu Nov 13 16:23:06.209479 2014] [core:warn] [pid 5640] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Thu Nov 13 16:23:06.209798 2014] [core:warn] [pid 5640] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Thu Nov 13 16:23:06.209922 2014] [core:warn] [pid 5640] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Thu Nov 13 16:23:06.210032 2014] [core:warn] [pid 5640] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Thu Nov 13 16:23:06.210151 2014] [core:warn] [pid 5640] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Thu Nov 13 16:23:06.232641 2014] [core:warn] [pid 5640] AH00111: Config variable ${APACHE_LOG_DIR} is not defined

@xn
Copy link

xn commented Nov 26, 2014

#22 addresses the issue. Long story short running apache2 does not load the env vars, however apache2ctl does. I tweaked a regex to deal with the different format for the compiled modules. I'm pretty sure this solution will not work for everyone, so I wouldn't merge as is unless someone else really puts it through its paces.

@manuelsdt
Copy link

I've got the same issue on 14.04 (14.04.1 LTS codename trusty) running apache2. I don't really understand how to try the fix above (#22), can anyone explain?

root@www:/home/manuel# ./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/apache2
The process running on port 80 is not Apache.
Falling back to process list...
Could not find Apache process. Exiting...

@xn
Copy link

xn commented Apr 11, 2015

You can just yank the code from my fork:
https://github.com/xn/apachebuddy.pl

@manuelsdt
Copy link

xn, thanks a lot, didn't realize it was that simple, this is my first use of github. This worked flawlessly for me.

@xn
Copy link

xn commented Apr 11, 2015

No worries. Great to hear. Open source for the win!

@manuelsdt
Copy link

I missed something the first time around. I'm still getting this:

"Unsuccessful stat on filename containing newline at ./apachebuddy.pl line 125 (#1)
(W newline) A file operation was attempted on a filename, and that
operation failed, PROBABLY because the filename contained a newline,
PROBABLY because you forgot to chomp() it off. See "chomp" in perlfunc."

Does this matter or something to just ignore?

@xn
Copy link

xn commented Apr 13, 2015

I just updated my fork, you can try that.

@manuelsdt
Copy link

Beautiful. Works perfect without any errors now! Thanks so much!

@davidak
Copy link

davidak commented Jun 11, 2015

I have also the problem on 14.04 LTS with a Plesk install (Apache behind Nginx). Also the fork don't work for me.

# ./apachebuddy.pl -p 7080
########################################################################
# Apache Buddy v 0.3 ###################################################
########################################################################
Gathering information...
We are checking the service running on port 7080
The process listening on port 7080 is /usr/sbin/apache2
The process running on port 7080 is not Apache. 
 Falling back to process list...
Could not find Apache process. Exiting...

@xn
Copy link

xn commented Jun 11, 2015

What is the process running under?

@xn
Copy link

xn commented Jun 11, 2015

you can run this to see if you get the correct pid:
ps aux | grep -v grep | egrep '^root.*(httpd|apache2)' | awk 'BEGIN {ORS=""} {print $2}'

@xn
Copy link

xn commented Jun 11, 2015

if it does, you can edit this line: https://github.com/xn/apachebuddy.pl/blob/master/apachebuddy.pl#L974
to:

$pid = ps aux | grep -v grep | egrep '^root.*(httpd|apache2)' | awk 'BEGIN {ORS=""} {print $2}' ;

@billynoah
Copy link

I am under the impression that Apache 2.4+ doesn't even use the MaxClients directive which has been replaced by MaxRequestWorkers. Presumably there are other changes as well which would require a more thorough examination of this script and it's recommendations.

@ksashikumar
Copy link

This worked for me:
curl -sL apache2buddy.pl | perl

@hrazouk
Copy link

hrazouk commented Aug 7, 2017

Hello when do curl -sL apache2buddy.pl | perl I receive curl -sL apache2buddy.pl | perl Please help

@hrazouk
Copy link

hrazouk commented Aug 7, 2017

sorry I receive There are multiple PIDs listening on port 80

@fedya
Copy link

fedya commented Aug 14, 2017

`root@old:~# 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/apache2
The process running on port 80 is not Apache. 
 Falling back to process list...
Could not find Apache process. Exiting...
```

@AmirHome
Copy link

curl -sL apachebuddy.pl | perl

########################################################################

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/apache2
The process running on port 80 is not Apache.
Falling back to process list...
Could not find Apache process. Exiting...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests