4

New Pi user here - I popped it out of the box and immediately went to work trying to turn it into a web server. I managed to install Apache, PHP5 and MySQL5 no problem. I can SSH in without issue.

However, Apache doesn't seem to want to start. I get this error:

$ /etc/init.d/apache2 start
[....] Starting web server: apache2/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)

apache2: apr_sockaddr_info_get() failed for memlbiometric

apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80

no listening sockets available, shutting down

Unable to open logs
Action 'start' failed.

The Apache error log may have more information.

 failed!

I have to admit, I'm a little flummoxed. Whats the issue here?

syb0rg
  • 8,188
  • 4
  • 37
  • 51
user8741
  • 141
  • 1
  • 2

3 Answers3

1
$ /etc/init.d/apache2 start

is deprecated, you should use new interface for starting services:

$ sudo service apache2 start
lenik
  • 11,541
  • 1
  • 30
  • 37
1

Based on the description you gave in your question, I don't believe you performed the full setup process. From the tutorial I linked in my comment:

A little Debian/Apache foreknowledge: The default Debian install of Apache will be configured to run in the "www-data" user space, and use the "www-data" group. The version of Debian used for this guide (debian6-19-04-2012) already includes the "www-data" user, but not the "www-data" group. The following commands will create the "www-data" group, and add the "www-data" user to the newly-created group:

# Create the www-data group
sudo addgroup www-data
sudo adduser www-data www-data

A touch more Debian/Apache foreknowledge: The default Debian install of Apache will be configured to serve HTML pages from the "/var/www" folder. While this folder is created during the Apache2 install process, it will likely be created with the wrong owner:group (root:root). We can ensure a smoother install and successful running of Apache2 by creating this folder ahead of time and changing owner:group to www-data:www-data.

# Create the /var/www folder and reassign ownership of the folder (and any files/subfolders)
sudo mkdir /var/www
sudo chown -R www-data:www-data /var/www
syb0rg
  • 8,188
  • 4
  • 37
  • 51
0

The issue is that apache couldn't listen on port 80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
That's because you didn't run /etc/init.d/apache2 start as root.

If you run it as root, it should be able to start fine. Apache being unable to resolve a FQDN will not stop it from starting.

Lawrence
  • 2,672
  • 14
  • 14
  • Not to demean this answer, but I don't see how this got upvoted after I suggested the same thing to the OP in the comments 4 hours earlier. It didn't work -1. – syb0rg Jul 30 '13 at 17:24
  • Perhaps the people who upvoted felt I had provided more information ? I'm not sure why I got upvoted. However I don't really see how the OP could have run it as root and still had the same issue. The issue originally was that port 80 couldn't be accessed. Running as root would solve that. As the OP did not provide an updated error message, I assumed that he didn't actually run it as root. – Lawrence Jul 31 '13 at 01:21