View previous topic :: View next topic |
Author |
Message |
Moriah Advocate
Joined: 27 Mar 2004 Posts: 2365 Location: Kentucky
|
Posted: Wed Jul 24, 2013 3:20 am Post subject: HELP - apache could not bind to address 0.0.0.0:80 SOLVED |
|
|
I am setting up a new web server that is basicly a clone of an 8 year old machine. The idea is to migrate to new hardware, but keep the web server basicly the same. I emerged www-servers/apache-2.2.25 and copied the directory tree below /etc/apache2 from the old server. I edited all the places I could find where the server domain name or ip address appeared (I grepped for them), and changed them to the temporary ip address the new server is using on my lan for testing during bring-up.
But when I try to start it, this is what I get:
Code: |
hophni etc # /etc/init.d/apache2 status
* status: stopped
hophni etc # ps ax | grep apache
2750 pts/0 S+ 0:00 grep --colour=auto apache
hophni etc # /etc/init.d/apache2 start
* Starting apache2 ...
(98)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
* start-stop-daemon: failed to start `/usr/sbin/apache2' [ ok ]
hophni etc #
|
The system log file shows:
Code: |
Jul 23 23:18:50 hophni /etc/init.d/apache2[2761]: start-stop-daemon: failed to start `/usr/sbin/apache2'
|
I know I shoudl be able to figure this out, but I am loosing patience with it; can anybody help me get this thing to start? _________________ The MyWord KJV Bible tool is at http://www.elilabs.com/~myword
Foghorn Leghorn is a Warner Bros. cartoon character.
Last edited by Moriah on Wed Jul 24, 2013 1:36 pm; edited 1 time in total |
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Wed Jul 24, 2013 3:34 am Post subject: |
|
|
as root run & post output of
Code: |
netstat -ltnp | grep ':80'
|
(to show whats running on port 80) |
|
Back to top |
|
|
Moriah Advocate
Joined: 27 Mar 2004 Posts: 2365 Location: Kentucky
|
Posted: Wed Jul 24, 2013 3:40 am Post subject: |
|
|
Nothing has that port open:
Code: |
hophni ~ # netstat -ltnp | grep ':80'
hophni ~ #
|
So, anticipating your next question, here it is without the grep:
Code: |
hophni ~ # netstat -ltnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1905/sshd
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 1966/sshd: root@pts
hophni ~ #
|
_________________ The MyWord KJV Bible tool is at http://www.elilabs.com/~myword
Foghorn Leghorn is a Warner Bros. cartoon character. |
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Wed Jul 24, 2013 4:13 am Post subject: |
|
|
no it was actually post output of this command
|
|
Back to top |
|
|
Moriah Advocate
Joined: 27 Mar 2004 Posts: 2365 Location: Kentucky
|
Posted: Wed Jul 24, 2013 4:15 am Post subject: |
|
|
Unfortunately, I cannot post the entire output of that file for security reasons, but I could post an excerpt, if you can tell me what you are looking for. _________________ The MyWord KJV Bible tool is at http://www.elilabs.com/~myword
Foghorn Leghorn is a Warner Bros. cartoon character. |
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Wed Jul 24, 2013 4:18 am Post subject: |
|
|
# IPv4 and IPv6 localhost aliases
127.0.0.1 localhost mksrv
(im looking to make sure you have an alias set)
yours should be
127.0.0.1 localhost hophni |
|
Back to top |
|
|
Moriah Advocate
Joined: 27 Mar 2004 Posts: 2365 Location: Kentucky
|
Posted: Wed Jul 24, 2013 4:22 am Post subject: |
|
|
Here is what I think you want to see:
Code: |
hophni ~ # grep hoph /etc/hosts
192.168.1.12 hophni hophni.elilabs.com
hophni ~ # grep localhost /etc/hosts
127.0.0.1 localhost.localdomain localhost
hophni ~ # grep 127 /etc/hosts
127.0.0.1 localhost.localdomain localhost
|
So I do not seem to have what you say I need. _________________ The MyWord KJV Bible tool is at http://www.elilabs.com/~myword
Foghorn Leghorn is a Warner Bros. cartoon character. |
|
Back to top |
|
|
Moriah Advocate
Joined: 27 Mar 2004 Posts: 2365 Location: Kentucky
|
Posted: Wed Jul 24, 2013 4:25 am Post subject: |
|
|
So I added this:
Code: |
127.0.0.1 localhost hophni
|
to /etc/hosts and it still does the same thing:
Code: |
hophni ~ # ps ax | grep apache
3355 pts/0 S+ 0:00 grep --colour=auto apache
hophni ~ # /etc/init.d/apache2 status
* status: stopped
hophni ~ # /etc/init.d/apache2 start
* Starting apache2 ...
(98)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
* start-stop-daemon: failed to start `/usr/sbin/apache2' [ ok ]
hophni ~ #
|
_________________ The MyWord KJV Bible tool is at http://www.elilabs.com/~myword
Foghorn Leghorn is a Warner Bros. cartoon character. |
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Wed Jul 24, 2013 4:26 am Post subject: |
|
|
(all as root)
Code: |
echo "127.0.0.1 localhost hophni" >> /etc/hosts
|
new terminal, then try rc-service apache restart
(also whats ping -c 5 0.0.0.0 showing?)
for me mkultra@mksrv [ ~ ]$ ping -c 5 0.0.0.0
PING 0.0.0.0 (127.0.0.1) 56(84) bytes of data. |
|
Back to top |
|
|
Moriah Advocate
Joined: 27 Mar 2004 Posts: 2365 Location: Kentucky
|
Posted: Wed Jul 24, 2013 4:32 am Post subject: |
|
|
Not sure what you mean by:
"new terminal, then try rc-service apache restart"
But I guess you saw our posts crossed in the mail, so to speak...
Also:
Code: |
hophni ~ # ping -c 5 0.0.0.0
PING 0.0.0.0 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.015 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.010 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.012 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.028 ms
64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.028 ms
--- 0.0.0.0 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3997ms
rtt min/avg/max/mdev = 0.010/0.018/0.028/0.009 ms
hophni ~ #
|
_________________ The MyWord KJV Bible tool is at http://www.elilabs.com/~myword
Foghorn Leghorn is a Warner Bros. cartoon character. |
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Wed Jul 24, 2013 4:47 am Post subject: |
|
|
|
|
Back to top |
|
|
Moriah Advocate
Joined: 27 Mar 2004 Posts: 2365 Location: Kentucky
|
Posted: Wed Jul 24, 2013 4:58 am Post subject: |
|
|
Code: |
hophni apache2 # equery l apache -p
* Searching for apache ...
[-P-] [ ] www-servers/apache-2.2.24:2
[-P-] [ ~] www-servers/apache-2.2.24-r1:2
[IP-] [ ] www-servers/apache-2.2.25:2
[-P-] [ ~] www-servers/apache-2.4.4:2
[-P-] [ ~] www-servers/apache-2.4.4-r3:2
[-P-] [ ~] www-servers/apache-2.4.6:2
hophni apache2 #
|
_________________ The MyWord KJV Bible tool is at http://www.elilabs.com/~myword
Foghorn Leghorn is a Warner Bros. cartoon character. |
|
Back to top |
|
|
Moriah Advocate
Joined: 27 Mar 2004 Posts: 2365 Location: Kentucky
|
Posted: Wed Jul 24, 2013 1:36 pm Post subject: |
|
|
Found it!
It was in /etc/apache2/vhosts.d/ssl-vhost.conf:
Code: |
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
#Listen 80
#Listen 192.168.1.12:80
|
The last "Listen" was not commented out. It is now, and it now works.
Thanks for the help! _________________ The MyWord KJV Bible tool is at http://www.elilabs.com/~myword
Foghorn Leghorn is a Warner Bros. cartoon character. |
|
Back to top |
|
|
|