Over the weekend I enabled FileVault 2 on OS 10.8.4.
When I fired up MAMP PRO just now, I receive the following error:
Apache wasn't able to start. Please check log for more information.
When I look at my log, the last line is:
Fri Jun 21 18:57:52 2013] [notice] caught SIGTERM, shutting down
I have tried stopping and restarting Apache.
If I run: sudo apachectl start, and then try to start MAMP, I receive a different error message:
The built in Apache is active which can cause a port conflict with at least one of your virtual hosts.
It's recommended either to choose a port different than 80 or to stop the built in Apache.
Enabling FileVault is the only thing I can think of since Friday that could have potentially affected Apache. But I'm not sure how to debug what exactly the problem is?
I disabled FileVault, did a system reboot, and everything is back to normal. So apparently there are some issues with running Mac Apache and FileVault. Not much has been said about it online. Hopefully this thread can serve some purpose and we can figure out a solution.
Related
Whenever I'm trying to start my Apache server from XAMPP on my Macbook (MacOS-Sierra) . I'm getting following application log :
Starting Apache Web Server...
/Applications/XAMPP/xamppfiles/apache2/scripts/ctl.sh : httpd started
And status remains Stopped. I re-install XAMPP and restarted my laptop multiple times, but I'm still having same issue. Couldn't find anything help to resolve this issue.
I found the solution:
Make sure port 80 is not being used (Use Network Utility and scan for port 80. If you found any application using port 80, then kill it)
Open terminal and execute
sudo apachectl stop
(ignore, if you get any error)
On the same terminal window execute
sudo /Applications/XAMPP/xamppfiles/bin/apachectl start
Open XAMPP control panel, your apache server might have started by now, if not then you can start manually by clicking start button.
This worked for me!!
Simply goto your terminal and type:
sudo apachectl stop
It'll ask for password. Enter your system password.
Go back to XAMPP control panel and start Apache.
It should get started now.
I had the same Problem and fixed it by deleting the lib folder in Applications/XAMPP/xamppfiles/ and installing XAMPP again. It's probably due to old lib files from previous versions not being updated properly.
Another related issue, which I faced caused Apache sever failure. And failure logs is :
[Sun Jul 30 12:43:58.747822 2017] [unique_id:alert] [pid 9188] (EAI 8)nodename nor servname provided, or not known: AH01564:
unable to find IPv4 address of "MacBook-Pro.local" AH00016: Configuration Failed
To solve this :
Executed following command
sudo -e /etc/hosts
Then, changed following entries
127.0.0.1 localhost
::1 localhost
to
127.0.0.1 localhost MacBook-Pro.local
::1 localhost MacBook-Pro.local
I had the same issue when I update my XAMPP app, if you have to do this, you first have to uninstall your XAMPP (save your HTDOCS files in another folder, NOT in XAMPP folder, or you will lose it), and after that you can install the newest version of XAMPP. It worked for me, hope for you too.
I've been reading about this issue and have tried many things, but none seem to work for me. After being very frustrated with XAMPP, I'm trying to setup a development environment locally using the apache that's already installed (along with php and mySQL).
Whenever I do:
sudo apachectl start
Nothing happens, and the console displays:
8/23/13 3:21:08.262 PM com.apple.launchd[1]: (org.apache.httpd[1086]) Exited with code: 1
8/23/13 3:21:08.262 PM com.apple.launchd[1]: (org.apache.httpd) Throttling respawn: Will start in 10 seconds
I've tried doing the suggestion that is most common, which seems to be to make a directory for the error log, and chmod 777 it.
If I do:
sudo apachectl -t
I get:
Warning: DocumentRoot [/usr/docs/dummy-host.example.com] does not exist
Warning: DocumentRoot [/usr/docs/dummy-host2.example.com] does not exist
httpd: Could not reliably determine the server's fully qualified domain name, using 10.5.120.124 for ServerName
Syntax OK
I see that my IP address is in the 3rd line there, and I'm thinking maybe that's the source of the issue? If anyone can give me any advice as to what might help, that'd be great.
Thanks!
Just to follow up on this for anyone else that might be encountering this issue, it ended up being something amiss in my Virtual Hosts file. After combing through that, there were some syntax issues going on that was, in turn, causing this issue to happen.
So I've been working with several Virtual Hosts on OS X 10.8.2. I'm using the Apache2 installation and MySQL to run name-based virtual hosts. They have all been working perfectly fine until last night. Suddenly, all of my virtual hosts redirect to a "Cannot connect to" page.
After fiddling around and eventually checking the error logs, I've concluded that Apache is NOT actually running. For example, ps aux | grep apache only returns the grep process. However, if I try sudo /usr/sbin/apachectl start I get "org.apache.httpd: Already loaded" in response.
I've checked my httpd.conf file and it looks perfectly fine. I can't see any changes to it. I also ran the syntax check command (which escapes my brain at the exact moment), and it returned OK. The only thing I found in my error logs, the last thing, was from yesterday, Feb 21, and it says: "[Thu Feb 21 21:46:02 2013] [notice] caught SIGTERM, shutting down"
Ever since then, my Apache errors logs contain nothing (because it's not running). I've restarted, tried restarting apache; I'm at a total loss as to why it thinks it's running even though it is not.
Any ideas?
In /var/logs/system.log when I try to start and restart Apache:
Feb 23 09:27:00 Baileys-MacBook-Pro com.apple.launchd[1] (org.apache.httpd[8766]): Exited with code: 1
Feb 23 09:27:00 Baileys-MacBook-Pro com.apple.launchd[1] (org.apache.httpd): Throttling respawn: Will start in 10 seconds
Feb 23 09:27:10 Baileys-MacBook-Pro com.apple.launchd[1] (org.apache.httpd[8767]): Exited with code: 1
Feb 23 09:27:10 Baileys-MacBook-Pro com.apple.launchd[1] (org.apache.httpd): Throttling respawn: Will start in 10 seconds
Feb 23 09:27:16 Baileys-MacBook-Pro.local sudo[8769]: bailey : TTY=ttys000 ; PWD=/private/var/log ; USER=root ; COMMAND=/usr/sbin/apachectl start
Feb 23 09:27:20 Baileys-MacBook-Pro com.apple.launchd[1] (org.apache.httpd[8772]): Exited with code: 1
Feb 23 09:27:20 Baileys-MacBook-Pro com.apple.launchd[1] (org.apache.httpd): Throttling respawn: Will start in 10 seconds
Feb 23 09:27:20 Baileys-MacBook-Pro.local sudo[8773]: bailey : TTY=ttys000 ; PWD=/private/var/log ; USER=root ; COMMAND=/usr/sbin/apachectl restart
Feb 23 09:27:20 Baileys-MacBook-Pro com.apple.launchd[1] (org.apache.httpd[8777]): Exited with code: 1
Feb 23 09:27:20 Baileys-MacBook-Pro com.apple.launchd[1] (org.apache.httpd): Throttling respawn: Will start in 10 seconds
Feb 23 09:27:26 Baileys-MacBook-Pro.local sudo[8778]: bailey : TTY=ttys000 ; PWD=/private/var/log ; USER=root ; COMMAND=/usr/bin/vi system.log
This problem persists after rebooting. Ever since the other day, it will not start but believes the httpd module is loaded.
I'm trying to find out via Google, but -- does anyone know how Apache checks if it's loaded? I know a lot of services lock files to run; is it possible Apache has a lock file somewhere that's still locked despite Apache not currently running?
NOTE: I've posted this on ServerFault, as well -- I'm posting this here as well because so far I'm not getting anything on ServerFault and I've been looking at Apache posts on StackOverflow, so I'm assuming Apache questions are fine for Stack.
I can reproduce the issue (kinda) by starting Apache when there's another process already listening on the same port that Apache wants to bind to (usually that's port 80). So check if there's perhaps another process listening on that port:
sudo lsof -i tcp:80 | grep LISTEN
EDIT: Perhaps easier: you can start Apache manually in debug mode to see what the reason is it won't start:
sudo /usr/sbin/httpd -k start -e Debug -E /dev/stdout
In my case (something already listening on port 80), it will produce:
(48)Address already in use: make_sock: could not bind to address 0.0.0.0:80
In my case I got:
(2)No such file or directory: httpd: could not open error log file
/private/var/log/apache2/error_log. Unable to open logs
Creating the directory apache2 made it running.
Do not know if this is relevant, but since I faced the same problem and I found an alternate solution, let me put in my 2c anyway.
Looked into this post when I got the same issue. Turns out that the httpd.conf file was the culprit. I had changed it to install something. Although I removed the installer files, I forgot to change the httpd.conf back. I hope you did not face the same problem.
Regarding question on port 80, I had seen skype hog the port as well as 443, (God knows for what) and I had better results after I turned it off. Make sure you do no have skype running on port 80 .
robertklep's pointer:
sudo /usr/sbin/httpd -k start -e Debug -E /dev/stdout
solved a related problem for me. Same symptoms, different cause, I think.
I set up a test virtual host with SSL & a self-signed certificate.
I had generated a private key with a passphrase.
So httpd was waiting for a passphrase (which I wasn't supplying).
When I started with the debug option, I got the prompt, supplied the passphrase & httpd started up.
So, will redo the private key without a passphrase...
Just got XAMPP 1.8.1 installed on my Windows 8 PC, this version includes packages mentioned below:
Apache 2.4.3
MySQL 5.5.27
PHP 5.4.7
phpMyAdmin 3.5.2.2
FileZilla FTP Server 0.9.41
Tomcat 7.0.30 (with mod_proxy_ajp as connector)
Strawberry Perl 5.16.1.1 Portable
XAMPP Control Panel 3.1.0 (from hackattack142)
When I launched and tried to start Apache, it gave following error:
12:04:41 PM [Apache] Attempting to start Apache app...
12:04:41 PM [Apache] Status change detected: running
12:04:42 PM [Apache] Status change detected: stopped
12:04:42 PM [Apache] Error: Apache shutdown unexpectedly.
12:04:42 PM [Apache] This may be due to a blocked port, missing dependencies,
12:04:42 PM [Apache] improper privileges, a crash, or a shutdown by another method.
12:04:42 PM [Apache] Check the "/xampp/apache/logs/error.log" file
12:04:42 PM [Apache] and the Windows Event Viewer for more clues
After that I checked error.log, it was empty so no help from there.
So here is the solution for this:
I check port 80 used by Skype, after that I changes port to 81 and also along with that somewhere i read this error may be because of SSL Port then I changed SSL port to 444. However this got resolved easily.
One most important thing to notice here, all the port changes should be done inside config files, for http port change: httpd.conf for SSL httpd-ssl.conf. Otherwise changes will not replicate to Apache, Sometime PC reboot is also required.
Edit: Make Apache use port 80 and make Skype communicate on other Port
For those who are struggling with Skype, want to change its port and to make Apache to use port 80.
No need to Re-Install, Here is simply how to change Skype Port
Goto: Tools > Options > Advanced > Connection
There you need to uncheck Use port 80 and 443 as alternative for incoming connections.
That's it, here is screen shot of it.
I had the exact same error.
It was because i didn't run setup_xampp.bat
This is a better solution than going through config files and changing ports.
This problem may occur due to apache not getting required port (default is 80).
The port may be being used by other services.
For example: Skype also has default port 80.
Installing Skype and Apache both on same machine will cause conflict and hence Apache will not start.
Either, you change Skype port or change Apache port as described in following steps:
Change the ports of Apache and it will work for you.
Go to httpd.conf
How to change port for Apache:
Search for:
ServerName localhost:80
Change it to:
ServerName localhost:81
Also Search For:
Listen 80
Change it to:
Listen 81
If you have created any virtual hosts, change the ports there also.
Then restart your apache.
I had the same problem, but I understand the VMware service is the problem. VMware host service and Apache service conflict together.
To Solve it »
Run your task manager » in services tab find VMwareHostd » then right click and stop it » every thing have been solved.
Enter services.msc and shutdown anything SQL you have running.
The SQL server might be taking over the port.
I had the same problem and error, I tried changing the ports for http port from 80 to 81 and ssl port from 443 to 444 but still received the same error so I reverted the ports to default and ran setup_xampp.bat which solve the problem in seconds.
Skype is usually the culprit because it uses port 80 by default. Just close it or uncheck "Use port 80 and 443 as alternatives for incoming connections" under tools > options... > advanced > connection and then restart Skype.
I had to manually edit the 2 text files (httpd.conf and httpd-ssl.conf) using the Config button for Apache to run and change in notepad from 80 > 81 and 443 > 444
Using the Xampp UI config manager doesn't save the changes into Apache.
change 80 to 81 and 443 to 444 by clicking config button and editing httpd.conf and httpd-ssl.congf. Now you can Access XAMPP from 127.0.0.1:81
An error in your httpd.conf or other Apache config files will cause this. Revert httpd.conf et al to the pristine, installer versions and see if Apache runs again.
(I tried Skype and other suggestions here, no luck, but logs [XAMPP > Apache > Logs button] showed that it ran once when first installed. That was the giveaway.)
Likely errors:
Did you edit with a Windows text editor that changes line endings to non-Unix? (Solution here.)
Missing or invalid DSO files (.so)
I had this problem and then I ran "apache_start.bat" the error in german told me there was a problem with line 51 in httpd-ssl.conf which is
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
What I did was comment lines 163 (ssl module) and 522 (httpd-ssl.conf include) in httpd.conf;
I don't need ssl for development, so that solved it for me.
I recently installed Apache 2.4.1 on my mac(10.7) and executed "httpd". I received these two error messages when websharing was turned off in system preferences:
//(1)-In the console//
httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.1.65 for ServerName
(48)Address already in use: make_sock: could not bind to address [::]:80
(48)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
//(2)-In the browser//
Not Found
The requested URL / was not found on this server.
Apache/2.2.20 (Unix) DAV/2 PHP/5.3.6 with Suhosin-Patch Server at 0.0.0.0 Port 80
// 2nd Test for Clarification
Quick experiment: Websharing turned on.
I switched to the 2.4.1 folder and ran "apachectl start". Here is the code:
usr/local/apache2/bin] root# apachectl start
org.apache.httpd: Already loaded
I checked 0.0.0.0 on chrome
The message, "It works", popped up. No sign of the apache 2.2.2 404 error message seen when websharing was off.
I typed in terminal "apachectl stop"
I checked 0.0.0.0 again and received the message "Oops! Google Chrome could not connect to 0.0.0.0."
//Added clarification 3/25/12
This mac already came pre-installed with apache 2.2.2. Does the presence of it (It is not running. I had the websharing option turned off.) on my hard drive interfere with the recent installation of apache 2.4.1?
When I turn websharing on, I do not get the apache 2.2.2 404 error message but the index.html page at 0.0.0.0:80. I don't understand why apache 2.4.1 will not run even when the websharing option is turned off. I think when I execute "apachectl start" in "usr/local/apache2/bin/" the computer activates apache 2.2.2 instead of 2.4.1. Why?
Could anyone add some clarity to this problem? I want to use apache 2.4.1 instead of being forced to use apache 2.2.2. Thanks!