httpd is not running on startup - apache

Everything was going alright, no edits have been done on the configurations, suddenly the httpd stopped running on start up, and another service made by me as well.
one information that the hard disk reached his full space so I had to delete some files.
the result of chkconfig --list is
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off

If httpd fails to start up, you should be able to find an error message in the error-log (/var/log/httpd/error_log or wherever you have configured its errors to). Check what gets logged when you manually try to start the service ("service httpd start") and get back with more information if you don't understand what it is trying to tell you.

If hard disk was full that would be the first reason of apache service not starting. Did you try restarting httpd service after freeing up some sufficient disk space and please also check the httpd error logs in /var/log/httpd/error.log. I think the major problem would have been due to disk space got full.
Try to free up some log files also to free up some more space in /var/log directory.

In my case it was a problem in log configuration:
AH00015: Unable to open logs
(1)Operation not permitted: AH00091: httpd: could not open error log file /usr/teste.localhost-error.log.
I Changed my log path, created the file into my path setted and it worked after restarting.

Related

Service httpd restart isn't displaying any info

After updating Apache it's no longer printing info on restart:
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
When entering:
service httpd restart
It is completely silent.
When I stop apache I see the following message:
Found 1 leftover httpd processes. Killing.
I'm running Apache/2.4.34 (Unix) on CentOS 6.10. I have updated Apache using Custombuild (DirectAdmin)
Question: Is the leftover httpd process preventing Apache from printing info on restart? How do I fix this?
The showing of messages on service restart is part of the sysvinit scripts. That code in particular is shared among all scripts.
The gist is that the update must have overwritten /etc/init.d/httpd. You can copy an existing script (or recover the httpd one from the distribution's rpm) and fix executable paths or other services that should be running (such as htcacheclean, if it exists in your apache build) based on the one installed by the update.
Now, be aware that systemd is also completely silent when restarting services, although (newer) CentOS init scripts do wrap the call to show messages, if invoked that way.
Also, the rogue left-over process is something you should look at but no, it's not the cause of the messages not printing anymore.

While starting Squid on "cmd" it gives a "System error 1067 has occurred"

I am trying to use Squid's (its 2.7STABLE8 version) reverse proxy service on Windows 7. When I try to start squid from "cmd" (as administrator) I get an error message such as;
"The Squid service could not be started
A system error has occurred
System error 1067 has occurred message
The process terminated unexpectedly"
To solve it I tried:
setting "http_port" to 80 and 8080
disabling user account control settings.
and followed the instructions on this website: Configuring a Basic Reverse Proxy in Squid on Windows
However, none of the solutions worked. Therefore if there is any other solution you might know it would be great.
Thanks
I checked my cache.log file, and it was reporting to;
"FATAL: ipcache_init: DNS name lookup tests failed"
Therefore, in the squid.conf file I set my dns_testname to;
"dns_testnames 0.0.0.0"
and it solved my problem.
Try this to check:
squid -k check
I had the same issue.
Just in case it helps someone, I got the same problem and was low disk space.
I made some cleanup and went back on in seconds.
Thanks.
when I check logs, I saw there is not "logs" folder under "c:\squid\var". after I create "logs" folder under there, it starts working. please make sure you have "c:\squid\var\logs"
My error it was the same.
My solution was: check the log in C:\squid\var\logs in the file chache, and i found this;
commBind: Cannot bind socket FD 14 to 192.168.3.12:3128: (10049) WSAEADDRNOTAVAIL, Cannot assign requested address.
FATAL: Cannot open HTTP Port
In a last time, i change the dir IP of my server, this was the origin of my trouble. In the file C:\squid\etc\squid.conf i change it again, and it solve of my.

errors attempting to start Apache through XAMPP

This is what shows up when I attempt to run Apache without Apache service being activated:
>Status change detected: running
>Status change detected: stopped
>Error: Apache shutdown unexpectedly.
>This may be due to a blocked port, missing dependencies,
>improper privileges, a crash, or a shutdown by another method.
>Check the "/xampp/apache/logs/error.log" file
>and the Windows Event Viewer for more clues
This is what happens when I attempt to install the Apache service:
>Installing service...
>Apache Service detected with wrong path
>Change XAMPP Apache settings or
>Uninstall/disable the other service manually first
>Found Path: ERROR: Not Able To Open Service Manager
>Expected Path: "c:\xampp\apache\bin\httpd.exe" -k run service
>Successful!
...followed by attempting to start Apache after the service (failed) attempt:
>Attempting to start Apache service...
>System Error. Code: 5.
>Access is denied
Does anyone know what's going on here and/or are able to help troubleshoot?
I've already uninstalled and reinstalled with and without (zip file extraction) the installer.
It sounds like something may be running on port 80 already. What happens when you run
netstat -an |find /i "listening"
from the command line?
I had those messages as well. You probably have IIS and XAMPP clashing at port 80. You can either:
disable IIS (if you are not going to run the server regularly).
change XAMPP default ports.
change IIS default ports.
To change XAMPP default ports
Open your XAMPP\apache\conf\httpd.conf file and change the "80" ports to something else, people like "8080".
Open your XAMPP\apache\conf\extra\httpd-ssl.conf file and change the "443" ports to another number.
It should make both services run without conflicts.

Apache Daemon trying to Ping on CentOS but not working (SELinux issue)

I have developped an application in php. One of its functions is to ping an external server.
However, when this action was fired nothing happened. I checked the SELinux log and generated a policy to allow apache daemon to ping (ping works fine if log in as apache user). After installing that policy, no error is shown on SELinux log, but on the httpd log appears a lot of times:
ping: recvmsg: Permission denied
I know it is a SELinux configuration problem (Socket connection maybe?) because if I disable it, it works nice, but this is not an option for me.
I have redirected the output of the ping command to a text file and, after firing the action, this is the result:
PING myhost (myip) 56(84) bytes of data.
--- myhost ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 13002ms
So I am kind of stuck at this point. Anyone can help me?
Thanks a lot.
After a fresh install it all worked. Don't mess with policies, kids.

WAMP / Xamp Apache Server not Starting

The other day my Wamp server stopped starting (server will not start). I uninstalled, reinstalled etc. I restored my computer back 4 days to where it ran fine. Then I ran Xampp server and had the exact same problem. To me this indicates a Windows problem. HTTPD.exe crashes every time it is initiated. I have shut off the firewall and antivirus to no avail.
running netstat -o in cmd gives me 127.0.0.1:31595 and higher ports. Port 80 is not in use and is clear.
In Services (wampapache) when I attempt to start the service I get
error 1058, "The service cannot be enabled because it is either
diabled or has no enabled devices".
Apache logs gives me
[mpm_winnt:error] [pid 10764:tid 2012] (OS 10022)An invalid argument
was supplied. : AH00332: winnt_accept: getsockname error on listening
socket, is IPv6 available?
Event Viewer gives me this
Faulting application name: httpd.exe, version: 2.4.3.0, time stamp:
0x502f70a3
Faulting module name: nvLsp.dll, version: 2.2.0.7316, time stamp: 0x4a80a5fd
Exception code: 0xc00000fd
Fault offset: 0x0000c257
Faulting process id: 0x2390
Faulting application start time: 0x01cde46e3fdd7d20
Faulting application path: C:\xampp\apache\bin\httpd.exe
Faulting module path: C:\Program Files\NVIDIA Corporation\NetworkAccessManager\bin32\nvLsp.dll
Report Id: 7eee3b80-5061-11e2-886a-00248c1defca
This is Win 7 home premium, Wamp is 64 bit and Xampp is 32 bit. Both worked before. I have read other threads here but they apply mainly to XP.
EDIT One thing I have done if went into Nvidia network controller and disabled the first packet. This got Xampp(partially, server will stay green but still no localhost) to work but not Wamp.
A lot of times skype/gtalk desktop version is the reason to make the port 80 busy. This dont appears on the netstat for some reason, but try to quit this kind of programs and start again your server.
I had the same issue. Turned out that the Apache service was disabled for some reason.
To fix it, run the command services.msc and set Apache as enabled.
For the record, this helped me getting it solved:
Check if you can start apache as program, not service, but via command prompt!
httpd or httpd -e debug for all possible error & debug messages
If it won't start, it will probably tell you the reason (e.g. php or apache configuration error)
If still not OK then install and run it as a service* via command prompt to see if there is anything else wrong.
httpd -k install and httpd -k start
Check output at command prompt, error.log and Windows System Event Viewer (Windows Logs/System)
For me this learned me that I had errors in my httpd.conf.
After a while I discovered it had something to do with my alias directory, probably permissions. Changing permissions on folder didn't help much (probably bc. I don't know which User the default service uses), but changing service to log on as my user (which is admin) did work.
* Remove this service afterwards if you have xampp or wamp, or you'll have a double entry.
Try "run as administrator". Somewhere in windows7, those settings are corrupted somehow, i guess.
i once had this issue on windows 8 for wamp server. But i did get the solution.
firstly press the windows + R keys on your keyboard
then type services.msc
search and locate wampapache
right click and select properties
change startup type from manual to automatic
click apply and ok
do same for wampmysqld