I have a centos server with 4Gb RAM.
I'm doing a PHP console batch process that may take some hours... however it doesn't finish as the server shutdown after 1 or 2 hours from lauching the process...
Here are the logs:
Dec 28 04:39:01 www systemd[1]: Starting Clean php session files...
Dec 28 04:39:02 www systemd[1]: Started Clean php session files.
Dec 28 04:40:04 www systemd[1]: Stopped target Mail Transport Agent.
Dec 28 04:40:04 www systemd[1]: Stopped target Timers.
Dec 28 04:40:04 www systemd[1]: Stopping User Manager for UID 0...
Dec 28 04:40:04 www systemd[1]: Stopping Session 12236053 of user root.
Dec 28 04:40:04 www systemd[1]: Stopped Daily apt upgrade and clean activities.
Dec 28 04:40:04 www systemd[24724]: Stopped target Default.
Dec 28 04:40:04 www systemd[24724]: Stopped target Basic System.
Dec 28 04:40:04 www systemd[24724]: Stopped target Sockets.
Dec 28 04:40:04 www systemd[24724]: Reached target Shutdown.
Dec 28 04:40:04 www systemd[24724]: Starting Exit the Session...
Dec 28 04:40:04 www systemd[24724]: Stopped target Timers.
Dec 28 04:40:04 www systemd[24724]: Stopped target Paths.
Dec 28 04:40:04 www systemd[1]: Stopping Session 12226070 of user root.
Dec 28 04:40:04 www systemd[1]: Stopped Run certbot twice daily.
Dec 28 04:40:04 www systemd[1]: Stopped Daily apt download activities.
Dec 28 04:40:04 www systemd[1]: Stopped Clean PHP session files every 30 mins.
Dec 28 04:40:04 www systemd[1]: Stopped Daily Cleanup of Temporary Directories.
Dec 28 04:40:04 www systemd[1]: Stopped target Graphical Interface.
Dec 28 04:40:04 www systemd[1]: Stopped target Multi-User System.
Dec 28 04:40:04 www systemd[1]: Stopped target Login Prompts.
Dec 28 04:40:04 www systemd[1]: Stopping Console Getty...
Dec 28 04:40:04 www systemd[1]: Stopping Getty on tty2...
Dec 28 04:40:04 www systemd[1]: Stopping LSB: modules.dep creation....
Dec 28 04:40:04 www systemd[1]: Stopping Unattended Upgrades Shutdown...
Dec 28 04:40:04 www systemd[1]: Stopping OpenBSD Secure Shell server...
Dec 28 04:40:04 www systemd[1]: Stopping LSB: Record successful boot for GRUB...
Dec 28 04:40:04 www systemd[1]: Stopping LSB: Start/stop sysstat's sadc...
Dec 28 04:40:04 www systemd[1]: Stopping A high performance web server and a reverse proxy server...
Dec 28 04:40:04 www systemd[1]: Stopping Regular background program processing daemon...
Dec 28 04:40:04 www systemd[1]: Stopping Runit service supervision...
Dec 28 04:40:04 www systemd[1]: Stopping D-Bus System Message Bus...
Dec 28 04:40:04 www systemd[24724]: Received SIGRTMIN+24 from PID 11820 (kill).
Dec 28 04:40:04 www systemd[1]: Stopping LSB: Starts or stops the xinetd daemon....
Dec 28 04:40:04 www systemd[1]: Stopping LSB: Postfix Mail Transport Agent...
Dec 28 04:40:04 www systemd[1]: Stopping The PHP 7.0 FastCGI Process Manager...
Dec 28 04:40:04 www systemd[1]: Stopping vsftpd FTP server...
Dec 28 04:40:04 www rsyslogd: [origin software="rsyslogd" swVersion="8.20.0" x-pid="370" x-info="http://www.rsyslog.com"] exiting on signal 15.
It starts the clean php session files then suddently stops all services and shuts down!
My code seems ok....do I need to force cleaning the variables on code?
What is the problem?
Thanks
Related
See "systemctl status apache2.service" and "journalctl -xe" for details.
root#ip-172-31-43-5:/home/ubuntu/asterisk-18.13.0/freepbx# systemctl status apache2.service
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2022-07-27 08:30:40 UTC; 8s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 11172 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
Jul 27 08:30:40 ip-172-31-43-5 systemd[1]: Starting The Apache HTTP Server...
Jul 27 08:30:40 ip-172-31-43-5 apachectl[11175]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Jul 27 08:30:40 ip-172-31-43-5 apachectl[11175]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Jul 27 08:30:40 ip-172-31-43-5 apachectl[11175]: no listening sockets available, shutting down
Jul 27 08:30:40 ip-172-31-43-5 apachectl[11175]: AH00015: Unable to open logs
Jul 27 08:30:40 ip-172-31-43-5 apachectl[11172]: Action 'start' failed.
Jul 27 08:30:40 ip-172-31-43-5 apachectl[11172]: The Apache error log may have more information.
Jul 27 08:30:40 ip-172-31-43-5 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Jul 27 08:30:40 ip-172-31-43-5 systemd[1]: apache2.service: Failed with result 'exit-code'.
Jul 27 08:30:40 ip-172-31-43-5 systemd[1]: Failed to start The Apache HTTP Server.
uninstall apache and reinstall again
sudo apt-get install apache2
install Apache2
sudo a2enmod proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http
I am completely new to Ubuntu and everything and am just trying to set up MyBB on my VPS with OVH. When I restart my Apache server using sudo systemctl -l status apache2, I get an error that says:
Nov 02 09:48:19 vps607432 systemd[1]: Starting The Apache HTTP Server...
Nov 02 09:48:19 vps607432 apachectl[18213]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Nov 02 09:48:19 vps607432 apachectl[18213]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Nov 02 09:48:19 vps607432 apachectl[18213]: no listening sockets available, shutting down
Nov 02 09:48:19 vps607432 apachectl[18213]: AH00015: Unable to open logs
Nov 02 09:48:19 vps607432 apachectl[18213]: Action 'start' failed.
Nov 02 09:48:19 vps607432 apachectl[18213]: The Apache error log may have more information.
Nov 02 09:48:19 vps607432 systemd[1]: apache2.service: Control process exited, code=exited status=1
Nov 02 09:48:19 vps607432 systemd[1]: apache2.service: Failed with result 'exit-code'.
Nov 02 09:48:19 vps607432 systemd[1]: Failed to start The Apache HTTP Server.
I understand what the issue is here as it plainly says inside of the error what is wrong. It's just that I am unsure on how I would go about solving this issue that I am experiencing.
Thanks for taking the time to read this question, I hope that I am able to find a solution as fast as possible.
These are the follow output streamed when I give command to restart the service of apache
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: failed (Result: exit-code) since Tue 2017-08-08 11:14:56 IST; 42s ago
Docs: man:systemd-sysv-generator(8)
Process: 3568 ExecStart=/etc/init.d/apache2 start (code=exited, status=2)
Aug 08 11:14:56 Lab2-73 systemd[1]: Starting LSB: Apache2 web server...
Aug 08 11:14:56 Lab2-73 apache2[3568]: /etc/init.d/apache2: 46: .: Can't open /e
Aug 08 11:14:56 Lab2-73 apache2[3568]: /etc/init.d/apache2: 57: .: Can't open /e
Aug 08 11:14:56 Lab2-73 apache2[3568]: ERROR: APACHE_PID_FILE needs to be define
Aug 08 11:14:56 Lab2-73 systemd[1]: apache2.service: Control process exited, cod
Aug 08 11:14:56 Lab2-73 systemd[1]: Failed to start LSB: Apache2 web server.
Aug 08 11:14:56 Lab2-73 systemd[1]: apache2.service: Unit entered failed state.
Aug 08 11:14:56 Lab2-73 systemd[1]: apache2.service: Failed with result 'exit-co
Please check your configuration under /etc/init.d/apache2/. There migth be a misconfiguration. Have a look at this little guide.
If you cant find the mistake you can also reinstall apache2 but keep in mind that you will loose your whole configuration (depending on the actual configuration)
I updated today my httpd and php version on Arch for ARM.
The current version is now:
apachectl -V
Server version: Apache/2.4.7 (Unix)
Server built: Mar 6 2014 17:04:51
Server's Module Magic Number: 20120211:27
Server loaded: APR 1.5.0, APR-UTIL 1.5.3
Compiled using: APR 1.5.0, APR-UTIL 1.5.3
Architecture: 32-bit
Server MPM: event
threaded: yes (fixed thread count)
forked: yes (variable process count)
I need also php for owncloud and other php project, because of that I added the lines:
LoadModule php5_module modules/libphp5.so
AddHandler php5-script php
Include conf/extra/php5_module.conf
to the file /etc/httpd/conf/httpd.conf.
Before the update this config works fine, after the update apache will not start anymore and it shows always the error:
Mar 07 03:43:59 alarm apachectl[1006]: [Fri Mar 07 03:43:59.408232 2014] [:crit] [pid 1008:tid 3070083072] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP.
Mar 07 03:43:59 alarm apachectl[1006]: AH00013: Pre-configuration failed
Mar 07 03:43:59 alarm systemd[1]: httpd.service: control process exited, code=exited status=1
Mar 07 03:43:59 alarm systemd[1]: Failed to start Apache Web Server.
Mar 07 03:43:59 alarm systemd[1]: Unit httpd.service entered failed state.
Removing and reinstalling php does not help. How can I fix this problem?
To switch to prefork MPM on Apache/2.4.7 (like the previous version of Apache), do this in /etc/httpd/conf/httpd.conf:
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
#LoadModule mpm_event_module modules/mod_mpm_event.so
and after httpd restart, on my raspberry pi.
apache upgrade in 2.4.7 :
Mar 07 19:33:56 rasperus systemd[1]: Starting Apache Web Server...
Mar 07 19:33:56 rasperus apachectl[23469]: [Fri Mar 07 19:33:56.909344 2014] [:crit] [pid 23471:tid 3069247488] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP.
Mar 07 19:33:56 rasperus apachectl[23469]: AH00013: Pre-configuration failed
Mar 07 19:33:56 rasperus systemd[1]: httpd.service: control process exited, code=exited status=1
Mar 07 19:33:56 rasperus systemd[1]: Failed to start Apache Web Server.
Mar 07 19:33:56 rasperus systemd[1]: Unit httpd.service entered failed state.
and after modification in httpd.conf :
Mar 07 19:45:11 rasperus systemd[1]: Starting Apache Web Server...
Mar 07 19:45:12 rasperus systemd[1]: PID file /run/httpd/httpd.pid not readable (yet?) after start.
Mar 07 19:45:12 rasperus systemd[1]: Started Apache Web Server.
Switch to the prefork MPM (in 2.4, you can change with just LoadModule) or switch your mod_php out to using one of the many fastcgi based options (php-fpm + mod_proxy_fcgi is a popular one).
I have worked on localhost all these while till I ran some updates on Windows 7 and restarted. Now I can no longer access to localhost from browser. But Aapache service is running. Showing on system tray. May I know what is the problem?
Error log:
[Thu Dec 16 00:33:35 2010] [notice] Parent: Received restart signal -- Restarting the server.
[Thu Dec 16 00:33:35 2010] [notice] Child 4248: Exit event signaled. Child process is ending.
[Thu Dec 16 00:33:36 2010] [notice] Child 4248: Released the start mutex
[Thu Dec 16 00:33:37 2010] [notice] Child 4248: All worker threads have exited.
[Thu Dec 16 00:33:37 2010] [notice] Child 4248: Child process is exiting
[Thu Dec 16 00:33:40 2010] [notice] Apache/2.2.17 (Win32) PHP/5.2.14 configured -- resuming normal operations
[Thu Dec 16 00:33:40 2010] [notice] Server built: Oct 18 2010 01:58:12
[Thu Dec 16 00:33:40 2010] [notice] Parent: Created child process 4672
[Thu Dec 16 00:33:40 2010] [notice] Child 4672: Child process is running
[Thu Dec 16 00:33:40 2010] [notice] Child 4672: Acquired the start mutex.
[Thu Dec 16 00:33:40 2010] [notice] Child 4672: Starting 64 worker threads.
[Thu Dec 16 00:33:40 2010] [notice] Child 4672: Starting thread to listen on port 80.
I found that Local Address 0.0.0.0:80 is bound to PID 1476 which is httpd.exe
check if your hosts file under C:\Windows\System32\drivers\etc\hosts has been changed by some other program just a guess ...
Maybe it is an error of the DNS service. Have you tried to access the system using the PCs IP-Address or the IP 127.0.0.1 (like http://127.0.0.1)?
Try forwarding port 80.
Also, restart the Apache server once.
En last but not least, a seengee suggested, if you'r running Skype, close it and try again.
I've seen Skype cause this issue in the past as i think it falls back to port 80 by default if its main port is blocked. If you use Skype, try turning it off and check again
Check the logs. Check the httpd instance and see if it appears to be functioning smoothly.
I had a similar problem a month back where the electrician killed the power to my computer and I wound up with a corrupt Apache and MySQL install. I had to re-install and copy the .conf files over to resolve the issue.
Edit
Considering this is an update, check your firewall to assure the update did not restore it to it's defaults (stranger things have happened).
before you restarted, did you install anything? What other services are running? Check if port 80 is already taken ...
Run notepad.exe as administrator. Open c:\windows\system32\drivers\etc\hosts file.
put this line :
127.0.0.1 localhost
save the file. you should have localhost.
Other thing is misconfig in your httpd.conf.
open your httpd.conf (usualy in c:\program files\apache software foundation\apache2.2\conf).
check this line:
ServerName xxxxx:80
where xxxx should be localhost or 127.0.0.1
change it if necessary, and save. Restart apache services.