Apache couldn't be started. Setting up Virtual Hosts. MAMP - apache

I'm trying to setup Virtual Hosts on my mac using MAMP but I was not able to run my apache.
I already did this before by following this tutorial but still my attempts are unsuccessful.
I'm running OSX Yosemite and MAMP 4.5
Update 1:
I tried running sudo /Applications/MAMP/Library/bin/apachectl start
and it returns this
(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
Update 2:
I tried renaming envvars_ and restarted the apache sudo apachectl restart still the apache is not running
Solved
Upon troubleshooting, what I did is force quit all the httpd processes on my activity monitor and restarted the mamp!!

Another server is already using port 80. You need to change the port of one of them. A port, like 80, can be used once per IP address.
Peter

Related

Starting web server apache2 failed

I have a Virtual Server. Till yesterday everything works fine on it.
Today my Hostcompany restarted my server to config something on I/O.
When I trying to get to my address I get
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
I tried to sudo service apache2 start and get these Error Message:
* Starting web server apache2
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
*
* The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
Does someone know how I can fix this problem?
Stop Nginx service nginx stop
Restart Apache service apache2 restart
You have another webserver that's running on the host (probably as part of the startup during the restart) You need to shut that off first.
You can run netstat -tulpn | grep :80 and that'll tell you what that process is
The problem is this, Nginx (another web server engine) it's using your port 80 so apache it's unable to start, a fast fix it turn of nginx and then restart apache.
You can do it with service nginx stop and service apache2 restart if you are using Ubuntu or Debian based release, if you are using an RHEL distro then use service nginx stop and service httpd restart
Here is my solution
first: sudo update-rc.d -f nginx remove
than: sudo rm /etc/init.d/nginx
after restarting VM almost everything works fine. Some strange thing is almost there.
When I goto www.myfoobarwebpage.com now apache is working and it's all ok!
When I goto myfoobarwebpage.com (without www.) I get "Welcome to nginx! ..."
Try this. My Apache config has 2 extra lines by mistake.
"Include conf/extra/httpd-8080.conf"
"Include conf/extra/httpd-8080.conf"
Therefore, it was saying address already in use because it already loaded the Virtual host once and was trying again.
Solution was to delete this extra line and have only one include.

apache service not started xampp

I am using Apache 2.2.17 with XAMPP Control Version 2.5 but and apache is using port 8080 but when I start apache service it shows:
ERROR : Apache service not started [-1]
and to see the port is used by any other program i did
netstat -a -n -o
from where i got PID 2952 is using that port which is java.exe as I need that to run my program.
I had changed port in the apache/conf/httpd.conf file as
#Listen 0.0.0.0:87
#Listen [::]:87
Listen 87
and ServerName localhost:87 and restarted my pc but the port was not changed .Please help to get access to localhost/phpmyadmin
Take care of a few things.
Firstly, close Xampp completely before editing the httpd.conf file. Xampp tends to run Apache and other stuffs in the background even after you quit it. To check if it's closed completely, use the Task Manager.
Secondly, try any other Port number. To check which ports are unused, open command prompt and type netstat -an. You can view the list of ports that are open.

(99)Cannot assign requested address: AH00072: make_sock: could not bind to address xx.xxx.xxx.xx:80

I am trying to configure access over Internet for xampp under Ubuntu. All works fine but when I add: Listen myip:80 in httpd.conf I cannot start apache server again. This is the error shown in /opt/lampp/logs/error_log:
(99)Cannot assign requested address: AH00072: make_sock: could not bind to address xx.xxx.xxx.xx:80
no listening sockets available, shutting down
AH00015: Unable to open logs
I cannot start Apache only if I add Listen xx.xxx.xxx.xx:80. If I change the Listen 80 to Listen 1234 or another port it runs ok. The problem seems to exist only if I add an IP.
I found this comment over the internet but I have no idea how to do it for xampp:
"The problem was the additional network cards were not configure with the addition IP's."
Also running from root netstat -ltnp | grep ':80' does not show anything.
I do not have Skype installed and it seems that there is no other process running on port 80.
Any ideas why this could be or how to fix?
I finally managed to get this working. I turned out I had not properly configured the forwarding of the IP from my outside address to the local IP address obtained by the Virtualbox.
I was using a Bridged Adapter, when I should have used a NAT connection and forward the outside IP to the Virtual box IP.
Hope this answer helps others with similar issue.

Apache SSL server not starting, "Address already in use"?

I have installed Apache 2.0.58 together with PHP 5.1.4. When I start the server using ./apachectl start, I manage to get the server running to serve HTTP as well as PHP pages, but when I try to start SSL for HTTPS using ./apachectl startssl, I get the error below:
(125)Address already in use: make_sock: could not bind to address [::]:54912
no listening sockets available, shutting down
Unable to open logs
When I run netstat -an | grep 54912 I don't see that port 54912 is being used at all. For reference, I hosted my HTTPS page on port 54912, and while in "httpd.conf" it already has the Listen 54912 directive, I also changed the file "ssl.conf" to Listen 54912 from the default Listen 443for https.
Any idea how I can get my server to run and serve HTTPS?
It's probably because apachectl startssl was deprecated in version 2.0 (and was removed in has version 2.2)
It's likely that apache start has already started the SSL virtual hosts, in particular if these virtual hosts (or other SSL-related options) haven't been defined in a <IfDefine SSL> section (because in Apache 2.0, apachectl startssl is equivalent to apachectl -k start -DSSL): they would be part of the main configuration.
Got the server running! :)
As mentioned by #EJP, the problem is because there are 2 Listen 54912 inside config. So by changing the file httpd.conf to Listen 14912 and retaining the file ssl.conf to Listen 54912, I can now run apachectl startssl and after entering the password, the server is up and running!
Special thanks to Tim Yencken for the help. (Dunno if he's here or not).

Unable to change Apache port number in Xampp

I just downloaded Xampp server xampp-win32-1.8.2-0-VC9.zip file for windows and tried to start the apache server. But the server failed to start with the following message:
XAMPP now starts as a console application.
Instead of pressing Control-C in this console window, please use xampp_stop.exe
to stop XAMPP, because it lets XAMPP end any current transactions and cleanup
gracefully.
(OS 10048)Only one usage of each socket address (protocol/network address/port)
is normally permitted. : AH00072: make_sock: could not bind to address 0.0.0.0:
80
AH00451: no listening sockets available, shutting down
AH00015: Unable to open logs
So clearly the port number 80 is already occupied.
So I went to the apache/conf/httpd.conf file and found the line:
#Listen 12.34.56.78:80
Listen 80
And changed the second line above to
Listen 8010
So the server must now start at port number 8010.But its instead starting on https default port number 443 and again giving the same error:
XAMPP now starts as a console application.
Instead of pressing Control-C in this console window, please use xampp_stop.exe
to stop XAMPP, because it lets XAMPP end any current transactions and cleanup
gracefully.
(OS 10048)Only one usage of each socket address (protocol/network address/port)
is normally permitted. : AH00072: make_sock: could not bind to address 0.0.0.0:
443
AH00451: no listening sockets available, shutting down
AH00015: Unable to open logs
So how should I make the server run at the port number of my choice and why is my approach not working. As far as I can remember, the approach used to work on earlier versions of xampp but is not working now.
This is the link which helped me to change my port.
And this video too.
Turns out that Skype blocks XAMPP from running apache. Just close skype, open the server, and reopen skype. That fixed the issue for me.
If you are using Xampp, open this file httpd-ssl.conf and search for this entry Listen 443, change it to ,say, Listen 444
Then restart apache.
You need to change the port from the https-ssl.conf. From control panel of xamp config and apache (Httpd-ssl.conf) change the port.
I ran setup_xampp.bat and edited the port number from the control panes using the config button of apache. Then I found this line Listen 80 and change the port number to 81 by editing this line. This solved the problem for me.