Open stephen304 opened 10 years ago
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...
Easy fix in my case:
perl apachebuddy.pl --port=8080
The problem for me is that apahe is running on port 80, not 8080... yet apachebuddy still won't recognize it.
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...
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
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.
Rename issue to compatibility with Ubuntu 14.04 LTS apache2
Experience same issue on 14.04 LTS. Anyone have a workaround for this yet?
########################################################################
######################################################################## 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...
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
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.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 ########################################################################
######################################################################## 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...
You can just yank the code from my fork: https://github.com/xn/apachebuddy.pl
xn, thanks a lot, didn't realize it was that simple, this is my first use of github. This worked flawlessly for me.
No worries. Great to hear. Open source for the win!
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?
I just updated my fork, you can try that.
Beautiful. Works perfect without any errors now! Thanks so much!
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...
What is the process running under?
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}'
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}\' ;
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.
This worked for me: curl -sL apache2buddy.pl | perl
Hello when do curl -sL apache2buddy.pl | perl I receive curl -sL apache2buddy.pl | perl Please help
sorry I receive There are multiple PIDs listening on port 80
`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...
########################################################################
######################################################################## 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...
I have apache2 installed via apt-get on ubuntu 13.10 x64. Here is the output of apachebuddy:
So you can see it finds apache2, but it somehow doesn't think it's apache...