Apache Webserver stopped working on windows7 - php

I have an Apache 2.4.9 web-server running php5 on windows7. It had been working fine, but now it isn't running. I see nothing about php in the application logs, nor in the Apache logs.
I do not know how to troubleshoot php5 in windows. I cannot run any phpinfo(); scripts, but I can see where php is started in the Apache logs
[Mon May 12 17:26:49.832429 2014] [mpm_winnt:notice] [pid 1388:tid 528] AH00455: Apache/2.4.9 (Win32) PHP/5.5.11 configured -- resuming normal operations
I see no notice of PHP crashing though.
The page is http://rm362c.umecheme.maine.edu/
and you can see the php in the source now.
what steps can I take to troubleshoot and debug php5 as it pertains to Apache2.4 and Windows7?

Add below lines to php.ini to view any php error in your browser --
error_reporting = -1
display_errors = On
Remove above lines in your production environment (Source: http://php.net/manual/en/errorfunc.configuration.php#89648 ).
For more check http://php.net/manual/en/errorfunc.configuration.php .

If port 80 is blocked by Skype or some other applications you will not be able to run apache since http requires port 80 and https require port 443 open. or if you have IIS web server running it also could be reason.
Please go through below article for further details if its xampp on windows7
http://www.nextofwindows.com/how-to-troubleshoot-xampp-apache-not-running-on-windows-7/

Related

After restart of apache server, php script no longer works

after (just) restarting my apache server, which runs a php script,
the website no more works.
I can see the landing page, and that's it.
(cannot click buttons, no reaction, no backend entrance..)
I have checked log files of server:
Everything is ok & working.
I have checked log files of apache, and got these errors:
HTTPD
The timeout specified has expired:
[client 2.247.241.109:11131] AH01075: Error dispatching request to : (polling), referer: (ip of my server)
Do you know what is going on?
I guessed that apache won't execute php (script) any more, is that correct?
Or is it something different?
Big thanks to anyone who can help me out.
Try the following:
service httpd restart
systemctl restart httpd
Make sure no rerwite rules are added in the .htaccess file.

Lamp server restart causing http error 503

I have restarted my AWS EC2 LAMP stack server with $ Sudo /etc/init.d/httpd restart after having made some changes to enable .htaccess on httpd.conf.
My server seems to have now crashed and is throwing Http error 503.
I've checked the error log and found this but not sure if it's relevant:
[Sun Sep 08 03:16:02.048610 2019] [http2:warn] [pid 2599] AH10034: The
mpm module (prefork.c) is not supported by mod_http2. The mpm
determines how things are processed in your server. HTTP/2 has more
demands in this regard and the currently selected mpm will just not
do. This is an advisory warning. Your server will continue to work,
but the HTTP/2 protocol will be inactive.
Primarily I'm just trying to get my servers back up and running. Any help at this point is like a glass of water in the Sahara - many many thanks in advance

Apache 2.4 Error: FCGI: attempt to connect to Unix domain socket /run/php/php7.0-fpm.sock (*) failed

I have updated my working Froxlor installation to PHP 7.
All my customer-sites work perfectly fine (with PHP 7 via FPM).
The only problem is, that if I want to access the Froxlor Backend, I get an Erorr 503.
The apache Error-Log says:
`[Tue Oct 11 10:01:04.067069 2016] [proxy:error] [pid 23949] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php7.0-fpm.sock (*) failed`
`[Tue Oct 11 10:01:04.089648 2016] [proxy_fcgi:error] [pid 23949] [client xx.xx.xx.xx:1819] AH01079: failed to make connection to backend: httpd-UDS`
The Error-Log of PHP-FPM says nothing.
The same thing happens, if I try to access the server directly via IP.
System-Details:
Debian 8
Apache 2.4
PHP7
PHP7-FPM
Where I have to serach for the Problem? If needed, config-files can be provided.
If you are using PHP-FPM, the problem may also be that you need to start the PHP service.
Apache does not automatically stop the process, so you will either manually start it up or automatically on startup
For PHP 7.x (remember to include your version):
service php7.x-fpm start
For PHP 7:
service php7-fpm start
For PHP 5:
service php-fpm start
This will begin the FPM process for you.
Additionally, you may also want the process to startup on boot. To do that simply enter the following, of course considering your respective version.
systemctl enable php7.x-fpm
I had same issue, on New server having php7.4 and these virtual host configuration files(located in /etc/apache2/sites-available/ directory) i migrated from server having php7.2.
When checked in detail i found
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php/php7.2-fpm.sock|fcgi://localhost/"
</FilesMatch>
Which then i replaced with
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost/"
</FilesMatch>
Basically updating php version and it worked fine after restarting apache2
Steps I made in order to make it work on my host:
in /etc/apt/sources.list - added non-free to debian repository
apt update
apt install libapache2-mod-fastcgi
a2enmod fastcgi
(That made the "Invalid command 'FastCgiExternalServer' error, I encountered on a new installation", go away).
In Froxlor - "Settings" - "Froxlor VirtualHost settings":
[X] Enable PHP-FPM for the Froxlor vHost If enabled, Froxlor will also be running under a local user.
I also removed all "Listen" entries from apache2's ports.conf

How to restart apache2 without terminating docker container?

I am using as a base the php docker container with the tag:
php:5.6-apache
When I try to restart the apache2 inside the container, the container stops:
root#phalconapp:/var/www/html# service apache2 restart
Restarting web server: apache2Terminated
root#phaclonapp:/var/www/html#
me#myLocalComputer:
How to restart apache2 without stopping the container?
I want to play around with the container and customize it, before I put my changes into the dockerfile. I want to install some extension and for them to work I need to restart apache for the changes to take effect.
This is the log file via:
Attaching to dltasklight_phlaconapp_1
phlaconapp_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
phlaconapp_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
phlaconapp_1 | [Mon May 30 10:19:24.556154 2016] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.10 (Debian) PHP/5.6.22 configured -- resuming normal operations
phlaconapp_1 | [Mon May 30 10:19:24.556181 2016] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
phlaconapp_1 | [Mon May 30 10:21:11.754993 2016] [mpm_prefork:notice] [pid 1] AH00169: caught SIGTERM, shutting down
dltasklight_phlaconapp_1 exited with code 0
If you use apache as the primary service to keep your running container, you can NOT reboot it. Simply because you built the image and sets the CMD with it.
The main purpose of a CMD is to provide defaults for an executing container. These defaults can include an executable, or they can omit the executable, in which case you must specify an ENTRYPOINT instruction as well.
Try to reload without restart a service:
/etc/init.d/apache2 reload
My solution to this was to exit my bash shell into the container, and just restart the container outside of Docker. Because Apache is set as the primary service, this also restarts Apache, and doesn't crash the container.
docker restart <container>
sudo docker kill --signal="USR1" your_appache_container
Other signals that you can use to achieve the following :
Stop Now Signal: TERM
Graceful Restart Signal: USR1
Restart Now Signal: HUP
Graceful Stop Signal: WINCH
From: this website
I want to customize the container, I need to install some extension
and for them to work I need to restart apache for the changes to take
effect.
This is against the Docker's immutable infrastructure principle. IMHO, you are using the docker container similar to a full blown VM. Instead, I would suggest you to treat the docker image as the final artifact and version it.
Note: This is just my humble opinion, you may have a valid usecase which I am not aware of, which I am curious to find out.
Inside docker, I use a command like this:
exec /usr/sbin/httpd -D FOREGROUND
But before going, does your apache fails while doing the restart? Thats how it exits? In that case, please do make it run by setting right configurations and having a look at those logs.
One method you can try is login to the container (to bash) and you could always have a docker commit at a point where it works. You can then change your base container image to that.
I had workarounds for similar situations by building new images from these committed ones using different ENTRYPOINT's in my Dockefile.

High memory usage nginx (reverse proxy) on new vps

I recently set up a new vps (Cent OS7) with custombuild 2.0, Apache 2.4 with nginx reverse proxy, php-fpm 5.6 (and 7), mpm worker, MariaDB 10.1, mod_security and csf.
For some reason Nginx uses 675mb of memory (http://prntscr.com/91bu6t) with only 1 (1mb) website on the server and 1 light (300mb) website which consits mostly of pictures.
When i restart nginx the memory usage is still about 175mb after some time, back to +/- 675mb again.
I don't think this is normal. The config files seem ok.
And I don't see much in the nginx logs, except these lines returning:
2015/11/10 21:20:41 [notice] 24971#0: ModSecurity for nginx
(STABLE)/2.9.0 (http://www.modsecurity.org/) configured. 2015/11/10
21:20:41 [notice] 24971#0: ModSecurity: APR compiled version="1.5.2";
loaded version="1.5.2" 2015/11/10 21:20:41 [notice] 24971#0:
ModSecurity: PCRE compiled version="8.20 "; loaded version="8.20
2011-10-21" 2015/11/10 21:20:41 [notice] 24971#0: ModSecurity: LIBXML
compiled version="2.9.2" 2015/11/10 21:20:41 [notice] 24971#0:
ModSecurity: Status engine is currently disabled, enable it by set
SecStatusEngine to On.
Are these lines indicating an issue? (Google doesn't make me much wiser..)
And mainly, why is the nginx memory usage so high with so little going on the server? What to do about it?
Thanks!
Hard to tell based on just the output of your admin panel but it could be that the server / nginx is caching a lot of memory to improve performance. If you have shell access, you can see more details using for example the top command.
If caching is the case, there is nothing wrong with that, it just optimizes your memory use versus disk use.

Categories