Re: [users@httpd] Problem with Apache2 after upgrade from Ubuntu14.04 to 16.04

2017-04-18 Thread Marat Khalili
> Given where I AM what would you suggest would be the best course of action to 
> get back to a working system please?

As was already suggested, run:
  sudo netstat -tpln
to see what program occupies port 80. Also try:
  ps -AFH
to see if other instances of Apache are already running. Compare their PIDs 
with those reported by:
  systemctl status apache2

If you don't know how to interpret the outputs post them here.

If you already established that e.g. nginx is to blame, decide what to do with 
it, e.g. daisy-chain web servers, bind them to different IPs or leave only one.
-- 

With Best Regards,
Marat Khalili

Re: [users@httpd] Problem with Apache2 after upgrade from Ubuntu14.04 to 16.04

2017-04-18 Thread Purvez

Hi Eric

The info I'm getting from Phusion is that Standalone Passenger only uses 
port 3000 by default or whatever else you stipulate at start time.  
However they are helping me decipher why nginx 'appears' to be grabbing 
port 80.  Once I have an understanding of 'that bit' maybe I'll have a 
better understanding of what to do next.


I do agree that currently there appears to be a squabble about port 80 
between the servers.  Once I get to the bottom of it I will post my 
findings here so that others may benefit from my (painful) experience. LOL!!



On 18/04/17 17:04, Eric Covener wrote:

On Tue, Apr 18, 2017 at 12:01 PM, Purvez  wrote:

Given where I AM what would you suggest would be the best course of action
to get back to a working system please?

Decide which http server will listen on port 80?  Whoever gets port 80
may have to proxy to the other server on an alt port.




-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Problem with Apache2 after upgrade from Ubuntu14.04 to 16.04

2017-04-18 Thread Eric Covener
On Tue, Apr 18, 2017 at 12:01 PM, Purvez  wrote:
> Given where I AM what would you suggest would be the best course of action
> to get back to a working system please?

Decide which http server will listen on port 80?  Whoever gets port 80
may have to proxy to the other server on an alt port.

-- 
Eric Covener
cove...@gmail.com

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Problem with Apache2 after upgrade from Ubuntu14.04 to 16.04

2017-04-18 Thread Purvez

Hi Marat

Many thanks for your input.  Yes 14.04 was an upgrade from 13.10 ...BUT 
I had tested it and it DID WORK!!  I must admit that I didn't look at 
the apache versions between 13.10 and 14.04 on ubuntu. (I really had no 
'need' to...as everything worked)


Given where I AM what would you suggest would be the best course of 
action to get back to a working system please?


Regards

Purvez



On 18/04/17 16:49, Marat Khalili wrote:
Versions of Apache used by 14.04 and 16.04 are in fact very close: 
2.4.7 and 2.4.18, I doubt their configurations are so much different 
(unless 14.04 was also an upgrade, since 13.10 used 2.2.x AFAIR). 
Breakage in the way Apache is started (upstart vs systemd) is much 
more probable. Reinstallation of Apache might not even fix this.


Moreover, Apache clearly complains on ports being already in use. It'd 
investigate what uses the ports before doing anything else. It could 
even be Apache itself (different instance started independently).



--

With Best Regards,
Marat Khalili


-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Problem with Apache2 after upgrade from Ubuntu14.04 to 16.04

2017-04-18 Thread Marat Khalili
Versions of Apache used by 14.04 and 16.04 are in fact very close: 2.4.7 
and 2.4.18, I doubt their configurations are so much different (unless 
14.04 was also an upgrade, since 13.10 used 2.2.x AFAIR). Breakage in 
the way Apache is started (upstart vs systemd) is much more probable. 
Reinstallation of Apache might not even fix this.


Moreover, Apache clearly complains on ports being already in use. It'd 
investigate what uses the ports before doing anything else. It could 
even be Apache itself (different instance started independently).



--

With Best Regards,
Marat Khalili


-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[users@httpd] Error in serving PHP pages from mod_fcgid

2017-04-18 Thread John Iliffe
Having spent considerable time chasing this problem around over the last 
few weeks (and a sincere thank you to Daniel for his assistance) here is 
some information that might save some time for somebody!

Environment:
Apache 2.4.25 compiled from source
PHP 7.1.3 compiled from source
mod_fcgid downloaded from Apache and compiled from source
Fedora 25, Apache started from systemctl  

Problem:
Couldn't find any configuration in the httpd.conf file that would allow either 
php-fpm OR mod_fcgid to serve dynamic pages.  Standard html worked fine, PHP 
scripts usually ended with either "File Not Found" or "No Input File 
Specified".

Solution (?)

In the php.ini file there is a parameter "display_errors" that controls 
whether a script error is displayed on the served output page.  Some of 
these errors are really script errors but some can be run-time situations 
too, so displaying the offending line of code to the browser is rather 
dangerous.  Looks rather silly too.

Anyhow, if this parameter is set to On, the pages display fine; if it is set 
to Off, then the result is a served page that says:  "File not found".  The 
default is On but I turned it off before trying to get php-fpm working, and 
spent all this time chasing the problem.  

This isn't at all intuitive but I have reset this parameter both ways 
several times now with the same result.  You have to stop Apache and 
restart it between changes.  Note that the problem occurs even when the 
page has no errors.  (eg, phpinfo.php wouldn't run either)

So, good luck!

John

[here is the relevant part of php.ini


; This directive controls whether or not and where PHP will output errors,
; notices and warnings too. Error output is very useful during development, 
but
; it could be very dangerous in production environments. Depending on the 
code
; which is triggering the error, sensitive information could potentially 
leak
; out of your application such as database usernames and passwords or 
worse.
; For production environments, we recommend logging errors rather than
; sending them to STDOUT.
; Possible Values:
;   Off = Do not display any errors
;   stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
;   On or stdout = Display errors to STDOUT
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/display-errors
  display_errors = On<--
; display_errors = Off
---
]





-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Problem with Apache2 after upgrade from Ubuntu14.04 to 16.04

2017-04-18 Thread Mitchell Krog Photography
Trust me. it’s the safest way to know you are starting off clean and have
no remnants that didn’t upgrade properly, there were a number of
deprecations from old to new Apache and they do not upgrade nicely.

And it really does not take that long, it should take you (depending on how
many sites) that entire fresh upgrade in under an hour.

For me when I had to do it after one upgrade from 14 > 16 I had 18 sites,
it took me barely an hour and everything was fresh and working properly,
then I moved to Nginx a few months later but that was for other reasons.

Tell me about it ….. the things we have to do !!! LOL

But just bite the bullet and start fresh, then you know you are fresh and
squeaky clean

Cheers
Mitch



From: Purvez 

Reply: users@httpd.apache.org 

Date: 18 April 2017 at 5:25:21 PM
To: users@httpd.apache.org  
Subject:  Re: [users@httpd] Problem with Apache2 after upgrade from
Ubuntu14.04 to 16.04

Hi Mitchell

Many thanks for your response.  I'm coming to the same conclusion as you.
Best to cut my losses and rebuild Apache and PHPbut I HATE not knowing
what went wrong.  So...I'm going to spend some time getting to the bottom
of the problem...whilst being pragmatic and building my production server
with apache and php again to get back to 'real life'!!  Ugh the things we
have to do to survive in this game!! LOL.

On 18/04/17 12:59, Mitchell Krog Photography wrote:

My experience with upgrading from 14.04 to 16.04 is apache does not upgrade
well at all, had it happen on several servers already in the past.

I would suggest backup your entire etc/apache2 folder or rename it
/etc/apache_backup/

Then uninstall apache and purge it, uninstall PHP and purge it and then
reinstall both Apache and PHP

Then you will get a clean Apache with PHP 7, then move your sites back into
/etc/apache2/sites-available/ one at a time, enable them one at a time and
test as you go along.

Good luck


From: Purvez 

Reply: users@httpd.apache.org 

Date: 18 April 2017 at 1:35:12 PM
To: users@httpd.apache.org  
Subject:  [users@httpd] Problem with Apache2 after upgrade from Ubuntu14.04
to 16.04

Hi

Newbie to the forum here so I hope I'm doing this right.  If not please
would someone guide me.  Thx in advance.

As the subject line says Apache2 is not working at all / satisfactorily
since the Ubuntu upgrade.  The details follow:

===

Here is my full post on askubuntu:

http://askubuntu.com/questions/904042/upgrade-to-16-04-lts-has-broken-apache

Currently the biggest help I could get would be if someone would decipher
what the following output means when I do :

systemctl status apache2.service

output:
===
*Code:*

purvez@127:~$ systemctl status apache2.service
● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
   └─apache2-systemd.conf
   Active: inactive (dead) since Thu 2017-04-13 10:01:02 BST; 11s ago
 Docs: man:systemd-sysv-generator(8)
  Process: 6997 ExecStop=/etc/init.d/apache2 stop (code=exited,
status=0/SUCCESS)
  Process: 6978 ExecStart=/etc/init.d/apache2 start (code=exited,
status=0/SUCCESS)

Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: (98)Address
already in use: AH00072: make_sock: could not bind to address [::]:80
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: (98)Address
already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: no listening
sockets available, shutting down
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: AH00015: Unable
to open logs
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: Action 'start'
failed.
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: The Apache error
log may have more information.
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]:  *
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6997]:  * Stopping
Apache httpd web server apache2
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6997]:  *
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 systemd[1]: Started LSB:
Apache2 web server.
purvez@127:~$


The MAIN question is : Is Apache started and functioning or is it inactive
(dead)?

The last line of the output suggests that it is working but the 5th / 6th
line from the top suggests the opposite.

The errorlog is blank and the accesslog is blank as well since the day of
the upgrade.
===
Thanks in advance

Purvez


Re: [users@httpd] Problem with Apache2 after upgrade from Ubuntu14.04 to 16.04

2017-04-18 Thread Purvez

Hi Mitchell

Many thanks for your response.  I'm coming to the same conclusion as 
you.  Best to cut my losses and rebuild Apache and PHPbut I HATE not 
knowing what went wrong.  So...I'm going to spend some time getting to 
the bottom of the problem...whilst being pragmatic and building my 
production server with apache and php again to get back to 'real 
life'!!  Ugh the things we have to do to survive in this game!! LOL.



On 18/04/17 12:59, Mitchell Krog Photography wrote:
My experience with upgrading from 14.04 to 16.04 is apache does not 
upgrade well at all, had it happen on several servers already in the past.


I would suggest backup your entire etc/apache2 folder or rename it 
/etc/apache_backup/


Then uninstall apache and purge it, uninstall PHP and purge it and 
then reinstall both Apache and PHP


Then you will get a clean Apache with PHP 7, then move your sites back 
into /etc/apache2/sites-available/ one at a time, enable them one at a 
time and test as you go along.


Good luck


From: Purvez  

Reply: users@httpd.apache.org  
 

Date: 18 April 2017 at 1:35:12 PM
To: users@httpd.apache.org  
 
Subject: [users@httpd] Problem with Apache2 after upgrade from 
Ubuntu14.04 to 16.04



Hi

Newbie to the forum here so I hope I'm doing this right. If not 
please would someone guide me.  Thx in advance.


As the subject line says Apache2 is not working at all / 
satisfactorily since the Ubuntu upgrade.  The details follow:


===

Here is my full post on askubuntu:

http://askubuntu.com/questions/904042/upgrade-to-16-04-lts-has-broken-apache

Currently the biggest help I could get would be if someone would 
decipher what the following output means when I do :


systemctl status apache2.service

output:
===
*Code:*

purvez@127:~$ systemctl status apache2.service
● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
 └─apache2-systemd.conf
   Active: inactive (dead) since Thu 2017-04-13 10:01:02 BST; 11s ago
 Docs: man:systemd-sysv-generator(8)
  Process: 6997 ExecStop=/etc/init.d/apache2 stop (code=exited, 
status=0/SUCCESS)
  Process: 6978 ExecStart=/etc/init.d/apache2 start (code=exited, 
status=0/SUCCESS)


Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: 
(98)Address already in use: AH00072: make_sock: could not bind to 
address [::]:80
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: 
(98)Address already in use: AH00072: make_sock: could not bind to 
address 0.0.0.0:80 
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: no 
listening sockets available, shutting down
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: AH00015: 
Unable to open logs
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: Action 
'start' failed.
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: The Apache 
error log may have more information.

Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: *
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6997]:  * 
Stopping Apache httpd web server apache2

Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6997]: *
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 systemd[1]: Started LSB: 
Apache2 web server.

purvez@127:~$



The MAIN question is : Is Apache started and functioning or is it 
inactive (dead)?


The last line of the output suggests that it is working but the 5th / 
6th line from the top suggests the opposite.


The errorlog is blank and the accesslog is blank as well since the 
day of the upgrade.

===
Thanks in advance

Purvez




Re: [users@httpd] What is preferred PHP interface?

2017-04-18 Thread Eric Covener
On Tue, Apr 18, 2017 at 10:35 AM, Rose, John B  wrote:
> What are some troubleshooting methods that utilize this config to “helps to
> determine when the issue is php and when the issue is Apache.”

A high memory, high cpu, or crashed process can be determined to be
one or the other trivially if it's fastcgi.

-- 
Eric Covener
cove...@gmail.com

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] What is preferred PHP interface?

2017-04-18 Thread Rose, John B
What are some troubleshooting methods that utilize this config to “helps to 
determine when the issue is php and when the issue is Apache.”

Thanks

From: Daniel 
Reply-To: "users@httpd.apache.org" 
Date: Friday, April 7, 2017 at 9:18 AM
To: "" 
Subject: Re: [users@httpd] What is preferred PHP interface?

Unless you recompile mod_php and all its extensions to be thread-safety, the 
most manegeable and performant solution will always be:

Apache w/ mpm_event + mox_proxy_fcgi -> php-fpm

Besides php-fpm is a very complete daemon/service to serve php, it allows for 
different pools with pretty different configurations/users/permissions/paths, 
etc. and to have a separate service for php content helps much.

For example, an added benefit from this setup is, for the not too experienced, 
it helps to determine when the issue is php and when the issue is Apache.

I see lots of folks in stackoverflow or asking for help in the #httpd channel 
at Freenode who confuse their problems as Apache being the source of them 
instead of PHP scripts or the php configuration itself.

2017-04-07 2:45 GMT+02:00 William A Rowe Jr 
>:
There is little activity on mod_fcgid because it works. There has been talk of 
tagging 2.3.10 at some point for very minor fixes.

Mod_proxy_fcgi is a viable alternative, and offers the ability to load balance, 
but managing the process pool of available fcgi workers is offloaded from httpd 
and becomes a distinct ops responsibility. It too has changed little since 2013.



--
Daniel Ferradal
IT Specialist

email dferradal at gmail.com
linkedin 
es.linkedin.com/in/danielferradal


Re: [users@httpd] Problem with Apache2 after upgrade from Ubuntu14.04 to 16.04

2017-04-18 Thread Purvez

Hi Luca

Many thanks for your quick response.  I think you have identified the 
problem.  I am running an ROR website with Phusion Passenger Standalone 
to serve it via reverse proxy.  Under 14.04 as far as I can tell 
Passenger Standalone did not use any outside 'help'. However their 
latest version seems to be running nginx core as part of Standalone and 
I think it is nginx that is grabbing port 80.


I'm going to go back to Phusion and explain the problem to them and ask 
for a work around.


I will report back here once I have an answer.

Thanks again


Purvez


On 18/04/17 12:45, Luca Toscano wrote:

Hi!

2017-04-18 13:35 GMT+02:00 Purvez >:


Hi

Newbie to the forum here so I hope I'm doing this right.  If not
please would someone guide me.  Thx in advance.

As the subject line says Apache2 is not working at all /
satisfactorily since the Ubuntu upgrade.  The details follow:

===

Here is my full post on askubuntu:

http://askubuntu.com/questions/904042/upgrade-to-16-04-lts-has-broken-apache




Currently the biggest help I could get would be if someone would
decipher what the following output means when I do :

systemctl status apache2.service

output:
===
*Code:*

purvez@127:~$ systemctl status apache2.service
● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
   └─apache2-systemd.conf
   Active: inactive (dead) since Thu 2017-04-13 10:01:02 BST; 11s ago
 Docs: man:systemd-sysv-generator(8)
  Process: 6997 ExecStop=/etc/init.d/apache2 stop (code=exited,
status=0/SUCCESS)
  Process: 6978 ExecStart=/etc/init.d/apache2 start (code=exited,
status=0/SUCCESS)

Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]:
(98)Address already in use: AH00072: make_sock: could not bind to
address [::]:80
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]:
(98)Address already in use: AH00072: make_sock: could not bind to
address 0.0.0.0:80 
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: no
listening sockets available, shutting down


It seems that you have another process holding TCP port 80, so you 
need to kill/stop it first. You can use something like netstat -nlpt 
(needs super user to list all the info in this case) to find your target.


Hope that helps!

Luca





Re: [users@httpd] Problem with Apache2 after upgrade from Ubuntu14.04 to 16.04

2017-04-18 Thread Mitchell Krog Photography
My experience with upgrading from 14.04 to 16.04 is apache does not upgrade
well at all, had it happen on several servers already in the past.

I would suggest backup your entire etc/apache2 folder or rename it
/etc/apache_backup/

Then uninstall apache and purge it, uninstall PHP and purge it and then
reinstall both Apache and PHP

Then you will get a clean Apache with PHP 7, then move your sites back into
/etc/apache2/sites-available/ one at a time, enable them one at a time and
test as you go along.

Good luck


From: Purvez 

Reply: users@httpd.apache.org 

Date: 18 April 2017 at 1:35:12 PM
To: users@httpd.apache.org  
Subject:  [users@httpd] Problem with Apache2 after upgrade from Ubuntu14.04
to 16.04

Hi

Newbie to the forum here so I hope I'm doing this right.  If not please
would someone guide me.  Thx in advance.

As the subject line says Apache2 is not working at all / satisfactorily
since the Ubuntu upgrade.  The details follow:

===

Here is my full post on askubuntu:

http://askubuntu.com/questions/904042/upgrade-to-16-04-lts-has-broken-apache

Currently the biggest help I could get would be if someone would decipher
what the following output means when I do :

systemctl status apache2.service

output:
===
*Code:*

purvez@127:~$ systemctl status apache2.service
● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
   └─apache2-systemd.conf
   Active: inactive (dead) since Thu 2017-04-13 10:01:02 BST; 11s ago
 Docs: man:systemd-sysv-generator(8)
  Process: 6997 ExecStop=/etc/init.d/apache2 stop (code=exited,
status=0/SUCCESS)
  Process: 6978 ExecStart=/etc/init.d/apache2 start (code=exited,
status=0/SUCCESS)

Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: (98)Address
already in use: AH00072: make_sock: could not bind to address [::]:80
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: (98)Address
already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: no listening
sockets available, shutting down
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: AH00015: Unable
to open logs
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: Action 'start'
failed.
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: The Apache error
log may have more information.
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]:  *
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6997]:  * Stopping
Apache httpd web server apache2
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6997]:  *
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 systemd[1]: Started LSB:
Apache2 web server.
purvez@127:~$


The MAIN question is : Is Apache started and functioning or is it inactive
(dead)?

The last line of the output suggests that it is working but the 5th / 6th
line from the top suggests the opposite.

The errorlog is blank and the accesslog is blank as well since the day of
the upgrade.
===
Thanks in advance

Purvez


Re: [users@httpd] Problem with Apache2 after upgrade from Ubuntu14.04 to 16.04

2017-04-18 Thread Luca Toscano
Hi!

2017-04-18 13:35 GMT+02:00 Purvez :

> Hi
>
> Newbie to the forum here so I hope I'm doing this right.  If not please
> would someone guide me.  Thx in advance.
>
> As the subject line says Apache2 is not working at all / satisfactorily
> since the Ubuntu upgrade.  The details follow:
>
> ===
>
> Here is my full post on askubuntu:
>
> http://askubuntu.com/questions/904042/upgrade-to-
> 16-04-lts-has-broken-apache
>
> Currently the biggest help I could get would be if someone would decipher
> what the following output means when I do :
>
> systemctl status apache2.service
>
> output:
> ===
> *Code:*
>
> purvez@127:~$ systemctl status apache2.service
> ● apache2.service - LSB: Apache2 web server
>Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
>   Drop-In: /lib/systemd/system/apache2.service.d
>└─apache2-systemd.conf
>Active: inactive (dead) since Thu 2017-04-13 10:01:02 BST; 11s ago
>  Docs: man:systemd-sysv-generator(8)
>   Process: 6997 ExecStop=/etc/init.d/apache2 stop (code=exited,
> status=0/SUCCESS)
>   Process: 6978 ExecStart=/etc/init.d/apache2 start (code=exited,
> status=0/SUCCESS)
>
> Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: (98)Address
> already in use: AH00072: make_sock: could not bind to address [::]:80
> Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: (98)Address
> already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
> Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: no listening
> sockets available, shutting down
>

It seems that you have another process holding TCP port 80, so you need to
kill/stop it first. You can use something like netstat -nlpt (needs super
user to list all the info in this case) to find your target.

Hope that helps!

Luca


[users@httpd] Problem with Apache2 after upgrade from Ubuntu14.04 to 16.04

2017-04-18 Thread Purvez

Hi

Newbie to the forum here so I hope I'm doing this right.  If not please 
would someone guide me.  Thx in advance.


As the subject line says Apache2 is not working at all / satisfactorily 
since the Ubuntu upgrade.  The details follow:


===

Here is my full post on askubuntu:

http://askubuntu.com/questions/904042/upgrade-to-16-04-lts-has-broken-apache 



Currently the biggest help I could get would be if someone would 
decipher what the following output means when I do :


systemctl status apache2.service

output:
===
*Code:*

purvez@127:~$ systemctl status apache2.service
● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
   └─apache2-systemd.conf
   Active: inactive (dead) since Thu 2017-04-13 10:01:02 BST; 11s ago
 Docs: man:systemd-sysv-generator(8)
  Process: 6997 ExecStop=/etc/init.d/apache2 stop (code=exited, 
status=0/SUCCESS)
  Process: 6978 ExecStart=/etc/init.d/apache2 start (code=exited, 
status=0/SUCCESS)


Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: (98)Address 
already in use: AH00072: make_sock: could not bind to address [::]:80
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: (98)Address 
already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: no listening 
sockets available, shutting down
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: AH00015: 
Unable to open logs
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: Action 
'start' failed.
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: The Apache 
error log may have more information.

Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6978]: *
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6997]: * Stopping 
Apache httpd web server apache2

Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 apache2[6997]: *
Apr 13 10:01:02 127.0.1.1purvez-Aspire-5750 systemd[1]: Started LSB: 
Apache2 web server.

purvez@127:~$



The MAIN question is : Is Apache started and functioning or is it 
inactive (dead)?


The last line of the output suggests that it is working but the 5th / 
6th line from the top suggests the opposite.


The errorlog is blank and the accesslog is blank as well since the day 
of the upgrade.

===
Thanks in advance

Purvez


Re: [users@httpd] Reg: Custom error message at Apache 2.4.25

2017-04-18 Thread Velmurugan Dhakshnamoorthy
Hi Luca,
Is it possible to pinpoint what is the wrong in my setting. I am still
unable to display the custom error message.

*The actual message from weblogic 12c in browser*

Error 500--Internal Server Error
>From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.5.1 500 Internal Server Error
The server encountered an unexpected condition which prevented it from
fulfilling the request.

*Apache Proxy 2.4.25 setting in httpd.conf*

*Configuration to forward request from Apache to Weblogic 12c*

   
   SetHandler weblogic-handler
   WebLogicHost hawley760
  WebLogicPort 8062
   Debug ON
   WLLogFile /opt/app/bea/apache2.4/httpd-2.4.25/logs/RPS-8060.log
  


*config related to error document in httpd.conf*

DocumentRoot "/opt/app/bea/apache2.4/httpd-2.4.25/htdocs"
ProxyPreserveHost On
ProxyPass /error !
ProxyErrorOverride On
Alias /error /opt/app/bea/apache2.4/httpd-2.4.25/htdocs
ErrorDocument 500 /error/500.html

I tried to setup this in virtual host as well, but cannot re-write the
default 500 error message. I am also attaching my httpd.conf file.

Appreciate if you can tell me what I am doing wrong, it would be much
appreciated.

Regards,
Vel






Regards,
Velmurugan Dhakshnamoorthy (Vel)
Singapore.

On Tue, Apr 18, 2017 at 6:56 AM, Velmurugan Dhakshnamoorthy <
dvel@gmail.com> wrote:

> Thanks again for your valuable inputs,  I am actually restricting number
> of HTTP sessions at weblogic layer,  beyond the specified limit,  weblogic
> throws 500 error message,  which is not very useful to users,  I want only
> the 500 error page to be re-written by Apache proxy with simple message
> (ex: server is busy,  login after sometime), I want only 500 generic error
> message to re-write,  I don't want to re-write any other content from
> back-end server.
>
> Regards,
> Vel
>
> On Apr 18, 2017 00:19, "Luca Toscano"  wrote:
>
>> Hi!
>>
>> As Nick mentioned there are a couple of options:
>>
>> 1) https://httpd.apache.org/docs/2.4/mod/mod_substitute.html or
>> https://httpd.apache.org/docs/current/mod/mod_proxy_html.html in case
>> you want to replace some parts of the response coming from the backend with
>> your content.
>>
>> 2) Write your own content output filter to modify the backend response as
>> you wish before flushing it out to the client. I'd suggest to follow
>> https://httpd.apache.org/docs/2.4/mod/mod_lua.html#modifying_buckets if
>> you want to attempt this road since using Lua instead of C is generally
>> easier for people not used to write Apache code.
>>
>> My personal suggestion is to not use any of the above but to re-think
>> about why you want to force the proxy to do this work. A proxy should be as
>> lightweight as possible and ideally should mask backend failures with
>> pre-defined error pages.
>>
>> Hope that helps!
>>
>> Luca
>>
>> 2017-04-17 9:57 GMT+02:00 Velmurugan Dhakshnamoorthy 
>> :
>>
>>> Hi Nick,
>>> yes exactly,  I want the error message produced by back-end weblogic
>>> server to be re-written by Apache proxy and then display custom message to
>>> user.
>>>
>>> Regards,
>>> Vel
>>>
>>>
>>> On Apr 17, 2017 15:34, "Nick Kew"  wrote:
>>>
>>> On Mon, 2017-04-17 at 09:04 +0800, Velmurugan Dhakshnamoorthy wrote:
>>>
>>> >
>>> > Thanks Luca,  I tried setting proxyerroroverride and error
>>> > document  in virtual host, however,  the 500 error produced by
>>> > content server is displayed as it is via Apache proxy. Any
>>> > further help?
>>>
>>> Are you saying you want an error message coming from the backend
>>> but modified by the proxy?  That would imply using a content filter
>>> (such as mod_proxy_html, mod_sed, or mod_substitute) to rewrite
>>> the response from the backend.
>>>
>>> --
>>> Nick Kew
>>>
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
>>> For additional commands, e-mail: users-h...@httpd.apache.org
>>>
>>>
>>>
>>


httpd.conf
Description: Binary data

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Re: [users@httpd] Help: Apache Crashing Everyday

2017-04-18 Thread Luca Toscano
Hi,

Some suggestions:

1) check your RHEL ulimits applied to httpd, the error message "Resource
temporarily unavailable: setuid: unable to change to uid" could be related
to maximum number of processes (allowed by the OS) reached. This should
allow you to spawn more httpd processes.

2) Have you checked when the "hang" happens? If you have long lived
connections and your httpd server reloads (for example for log rotation)
then it might hang a bit while waiting for the remaining connections to
drain.

3) If possible I'd consider to upgrade httpd to >= 2.4.25 and use mpm-event
(rather than prefork).

Hope that helps!

Luca

2017-04-16 13:18 GMT+02:00 Jayaram Ponnusamy :

> Dear All,
>
> We were runnig our site in PHP based CMS tool earlier, and normally 20-30K
> users will access our sites daily. But in new system with Tomcat, we are
> facing performance and availability issue frequently, when i access the
> tomcat url directly the page is loading within 3seconds, but if we access
> webServer URL then its taking more than 9seconds.
>
> Also, Each day I am seeing more and more of these in my error_logs, and
> when the Total Children value is reached 999 the Apache is not responding
> and Server reboot only help to bring the site back. Every day atleast 4-5
> times we are facing this issue (we are using mod_jk to connect with tomcat).
>
> Kindly please help on this.
>
> Usually I am seeing this on my error_log:
> [Sat Apr 15 20:49:33 2017] [info] server seems busy, (you may need to
> increase StartServers, or Min/MaxSpareServers), spawning 8 children, there
> are 4 idle, and 31 total children
> [Sat Apr 15 20:51:14 2017] [info] server seems busy, (you may need to
> increase StartServers, or Min/MaxSpareServers), spawning 8 children, there
> are 0 idle, and 20 total children
> [Sat Apr 15 20:51:15 2017] [info] server seems busy, (you may need to
> increase StartServers, or Min/MaxSpareServers), spawning 16 children, there
> are 0 idle, and 28 total children
> [Sat Apr 15 20:51:16 2017] [info] server seems busy, (you may need to
> increase StartServers, or Min/MaxSpareServers), spawning 32 children, there
> are 0 idle, and 44 total children
> We are using two Apache Nodes and Connected with Two Tomcat (at
> Application Level Clustering).
> Apache Servers:
> 4 Core 64-bit, Rhel System running on 16GB RAM (Both Servers)
> Server version: Apache/2.2.21 (Unix)
>
> *httpd.conf*
> KeepAlive On
> Timeout 300
> MaxKeepAliveRequests 100
> KeepAliveTimeout 15
> 
> StartServers 80
> ServerLimit 3500
> MaxClients 3500
> MaxRequestsPerChild  0
> 
>
> *workers.properties*
> worker.list=loadbalancer,status
> worker.qu_prod_live_svr.type=ajp13
> worker.qu_prod_live_svr.host=cmsp1
> worker.qu_prod_live_svr.port=8009
> worker.qu_prod_live_svr.socket_keepalive=1
> worker.qu_prod_live_svr.socket_timeout=300
> worker.qu_prod_live_svr1.type=ajp13
> worker.qu_prod_live_svr1.host=cmsp2
> worker.qu_prod_live_svr1.port=8009
> worker.qu_prod_live_svr1.socket_keepalive=1
> worker.qu_prod_live_svr1.socket_timeout=300
> worker.qu_prod_live_svr.lbfactor=1
> worker.qu_prod_live_svr1.lbfactor=1
> worker.loadbalancer.type=lb
> worker.loadbalancer.balance_workers=qu_prod_live_svr,qu_prod_live_svr1
> worker.status.type=status
>
> *Tomcat Servers:*
> 4 Core 64-bit, Rhel System running on 16GB RAM (Both Servers)
> Server version: Apache Tomcat/7.0.42
>  URIEncoding="UTF-8" emptySessionPath="true" maxThreads="500"
> minSpareThreads="10" connectionTimeout="-1" />
>  URIEncoding="UTF-8" />
>
> *error_log:*
> [Sat Apr 15 21:52:36 2017] [info] server seems busy, (you may need to
> increase StartServers, or Min/MaxSpareServers), spawning 32 children, there
> are 0 idle, and 839 total children
> [Sat Apr 15 21:52:37 2017] [info] server seems busy, (you may need to
> increase StartServers, or Min/MaxSpareServers), spawning 32 children, there
> are 0 idle, and 871 total children
> [Sat Apr 15 21:52:38 2017] [info] server seems busy, (you may need to
> increase StartServers, or Min/MaxSpareServers), spawning 32 children, there
> are 0 idle, and 903 total children
> [Sat Apr 15 21:52:39 2017] [info] server seems busy, (you may need to
> increase StartServers, or Min/MaxSpareServers), spawning 32 children, there
> are 0 idle, and 935 total children
> [Sat Apr 15 21:52:40 2017] [info] server seems busy, (you may need to
> increase StartServers, or Min/MaxSpareServers), spawning 32 children, there
> are 0 idle, and 967 total children
> [Sat Apr 15 21:52:41 2017] [info] server seems busy, (you may need to
> increase StartServers, or Min/MaxSpareServers), spawning 32 children, there
> are 0 idle, and 999 total children
> [Sat Apr 15 21:52:41 2017] [alert] (11)Resource temporarily unavailable:
> setuid: unable to change to uid: 2
> [Sat Apr 15 21:52:41 2017] [alert] (11)Resource temporarily unavailable:
> setuid: unable to change to uid: 2
> [Sat Apr 15 21:52:41 2017] [alert] (11)Resource temporarily unavailable:
> setuid: 

Re: [users@httpd] Re: Reg : Limiting http connections at Apache 2.4.25

2017-04-18 Thread Luca Toscano
Not sure what is the status of mod_qos (third party module), but you might
want to give it a try and see if it fits your needs!

http://mod-qos.sourceforge.net/#requestlevelcontrol

Luca

2017-04-17 3:08 GMT+02:00 Velmurugan Dhakshnamoorthy :

> Dear All,
> Any specific setup to cut and disallow the the further HTTP connections
> after specified limit (ex: 50 sessions?).
>
> My requirement is to allow only 50 users and 51st user should get a custom
> error message to login after sometime.
>
> Regards,
> Vel
>
> On Mar 16, 2017 21:30, "Velmurugan Dhakshnamoorthy" 
> wrote:
>
>> Thanks for response,
>>
>> Yes my requirement is to completely restrict/disalllow any further
>> connections, example I want to allow only 50 sessions,  51st connection
>> should get an error message to login later  after certain period of time.
>>
>>
>> Regards,
>> Vel
>>
>> On Mar 16, 2017 18:58, "Nick Kew"  wrote:
>>
>>> On Thu, 2017-03-16 at 02:05 +0100, Daniel wrote:
>>> > See about mpm settings/directives such as MaxRequestWorkers, which
>>> > will limit the number of concurrent requests your server can take.
>>>
>>> Indeed, but I don't think that's what the OP is looking for in an
>>> apache proxy.  Rather the proxy reply with a "too busy" error page
>>> than not take the connection at all, right?
>>>
>>> The proxy balancer would be a place to look: that offers various
>>> ways to determine how much traffic to send to a backend.  If that
>>> doesn't meet your needs, there are several third-party traffic-
>>> limiting modules.
>>>
>>> --
>>> Nick Kew
>>>
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
>>> For additional commands, e-mail: users-h...@httpd.apache.org
>>>
>>>