Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

[SOLVED] Apache:Cannot assign requested address,bind to port

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
11 posts • Page 1 of 1
Author
Message
dragos240
Apprentice
Apprentice
Posts: 252
Joined: Sun Apr 19, 2009 2:04 pm

[SOLVED] Apache:Cannot assign requested address,bind to port

  • Quote

Post by dragos240 » Thu Jun 02, 2011 11:02 pm

Hello,

I can't get apache to use my server's name, it also doesn't want to bind to port 80. Here's the error on startup:

Code: Select all

 * Starting apache2 ...
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
(99)Cannot assign requested address: make_sock: could not bind to address 24.61.157.141:80
no listening sockets available, shutting down
Unable to open logs                                                      [ !! ]
 * ERROR: apache2 failed to start
Help appreciated.

Thanks,
Dragos240
Last edited by dragos240 on Fri Jun 03, 2011 5:13 pm, edited 1 time in total.
Top
davidm
Guru
Guru
User avatar
Posts: 557
Joined: Sun Apr 26, 2009 4:05 pm
Location: US

  • Quote

Post by davidm » Thu Jun 02, 2011 11:16 pm

First things first, is that the correct IP and is there something already binding to port 80 (use netstat to check)? And just to check what are some details about this server and how it is connected. Also it's not able to open the logs which is strange. Do you have root on this server and have you done anything with the configuration files yet? How are you invoking apache?
Top
dragos240
Apprentice
Apprentice
Posts: 252
Joined: Sun Apr 19, 2009 2:04 pm

  • Quote

Post by dragos240 » Thu Jun 02, 2011 11:30 pm

davidm wrote:First things first, is that the correct IP and is there something already binding to port 80 (use netstat to check)? And just to check what are some details about this server and how it is connected. Also it's not able to open the logs which is strange. Do you have root on this server and have you done anything with the configuration files yet? How are you invoking apache?

netstat -ltnp:

Code: Select all

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      16422/mysqld        
tcp        0      0 0.0.0.0:10000           0.0.0.0:*               LISTEN      14731/perl          
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      19646/sshd          
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      15017/cupsd         
tcp        0      0 0.0.0.0:17500           0.0.0.0:*               LISTEN      10692/dropbox       
tcp6       0      0 :::22                   :::*                    LISTEN      19646/sshd          
tcp6       0      0 ::1:631                 :::*                    LISTEN      15017/cupsd         
tcp6       0      0 :::25565                :::*                    LISTEN      22273/java
Nothing on port 80.

My previous config broke for some reason, and was giving the same errors. I then deleted all apache conf files are re-emerged apache. I did this to delete the config files:

rm -r /etc/apache2/
rm /etc/conf.d/apache2

The server after emerge ran fine but still gave this error:

Code: Select all

* Starting apache2 ...
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName 
After adding a Listen option which I told to attach to my server IP and port 80, this happens. When I just have it listen on port 80 alone it does this:

"Could not bind to port: 80" or something similar.

Also before editing the conf files, localhost can access the server on 127.0.0.1 and the local ip: 192.168.1.101, but other people on LAN cannot access it on 192.168.1.101

I know my ISP is not blocking port 80, and I'm 100% positive that's my IP, I use it for other services I use daily.

Also, is that Zorak from The Brak Show?

Thanks,
Dragos240
Top
davidm
Guru
Guru
User avatar
Posts: 557
Joined: Sun Apr 26, 2009 4:05 pm
Location: US

  • Quote

Post by davidm » Thu Jun 02, 2011 11:50 pm

The 'ServerName' directive should get rid of the message about getting the Fully qualified domain name.

If you can post some of your apache2 conf files (modify the IP's a little if you want for privacy) just to see what you have. If this is a home connection and you are using the external IP address for the listen directive then it would make sense that other people can't access it on the LAN possibly due to NAT issues depending on how you have things configured.

Yep it's Zorak from Space Ghost Coast To Coast. :)

Also a thought- If you are trying to access it from outside using an external IP using port 80 also make sure there isn't any sort of server running already on port 80 such as on your router's remote management. That would not show up on netstat. I'm guessing this is a home network and not on a remote server somewhere, right?
Top
KWhat
l33t
l33t
User avatar
Posts: 673
Joined: Sun Sep 04, 2005 4:49 pm
Location: Los Angeles

  • Quote

Post by KWhat » Fri Jun 03, 2011 5:15 am

My previous config broke for some reason, and was giving the same errors. I then deleted all apache conf files are re-emerged apache ...
Generally when an Apache config breaks for some reason it was because of an upgrade. Most likely it was the default virtual host config files.

Also before editing the conf files, localhost can access the server on 127.0.0.1 and the local ip: 192.168.1.101, but other people on LAN cannot access it on 192.168.1.101
You cannot bind to what i am assuming is your external ip address (24.61.157.141) behind the router. Change that ip in your config file to the ip address assigned to eth0 and setup your nat properly. You can usually forward an http alt port like 8080 or 8000 to NAT to port 80 at 192.168.1.101.
Top
dragos240
Apprentice
Apprentice
Posts: 252
Joined: Sun Apr 19, 2009 2:04 pm

  • Quote

Post by dragos240 » Fri Jun 03, 2011 12:56 pm

Ah that makes sense. I wasn't sure how that worked entirely. I'll see how that works and get back to you.
Top
dragos240
Apprentice
Apprentice
Posts: 252
Joined: Sun Apr 19, 2009 2:04 pm

  • Quote

Post by dragos240 » Fri Jun 03, 2011 1:05 pm

I changed the port to 8000 and I have no-ip, it can redirect a certain port to port 80 for me.

It starts now, but a different error arose. I can't access anything on the server. It gives me a 403 Forbidden.
Top
KWhat
l33t
l33t
User avatar
Posts: 673
Joined: Sun Sep 04, 2005 4:49 pm
Location: Los Angeles

  • Quote

Post by KWhat » Fri Jun 03, 2011 3:26 pm

Post the error you are getting in the /var/log/apache/error log.
Top
dragos240
Apprentice
Apprentice
Posts: 252
Joined: Sun Apr 19, 2009 2:04 pm

  • Quote

Post by dragos240 » Fri Jun 03, 2011 3:44 pm

KWhat wrote:Post the error you are getting in the /var/log/apache/error log.
This appears to be the 403 Forbidden error in the log:

Code: Select all

[Fri Jun 03 11:56:48 2011] [error] [client 173.13.89.145] client denied by server configuration: /usr/htdocs
Top
dragos240
Apprentice
Apprentice
Posts: 252
Joined: Sun Apr 19, 2009 2:04 pm

  • Quote

Post by dragos240 » Fri Jun 03, 2011 5:11 pm

I created a new vhost and it fixed itself. Solved.
Top
yupan
n00b
n00b
Posts: 2
Joined: Thu Sep 22, 2011 6:21 am
Location: 92cto.com
Contact:
Contact yupan
Website

  • Quote

Post by yupan » Thu Sep 22, 2011 6:27 am

you can try ,then delete file httpd.conf about :Listen 24.61.157.141:80
92cto.com
Top
Post Reply

11 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic