# Apache22 error



## Tosti (Apr 1, 2013)

Hi, *I* tried to install Apache on my FreeBSD s*y*stem(9.0) and *I* got this error when *I* tried to start it (Apache)

```
$ /usr/local/etc/rc.d/apache22 start
Performing sanity check on apache22 configuration:
httpd: apr_sockaddr_info_get() failed for privat
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
Syntax OK
Starting apache22.
httpd: apr_sockaddr_info_get() failed for privat
httpd: 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 [::]:80
(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
/usr/local/etc/rc.d/apache22: WARNING: failed to start apache22
```

Can you give me some advice?

Thanks.


----------



## kpa (Apr 1, 2013)

This is an FAQ and I'm sure the Apache documentation includes a solution to this but basically you're missing the host name that Apache is trying to use for listening address in either /etc/hosts or in DNS


----------



## Savagedlight (Apr 2, 2013)

Tosti said:
			
		

> ```
> $ /usr/local/etc/rc.d/apache22 start
> (...)
> (13)Permission denied: make_sock: could not bind to address [::]:80
> ...



Judging by the console prompt ($) and the permission errors, it looks like you are trying to start Apache as a non-privileged user. su(1) to root (or use sudo(8)) and then start Apache.


----------



## Tosti (Apr 2, 2013)

I tried as root too, but I got the same error. I may need to configure DNS server?


----------



## SirDice (Apr 2, 2013)

Tosti said:
			
		

> I may need to configure DNS server?


Not strictly necessary, just make sure your /etc/hosts file contains the IP and hostname.


----------



## Tosti (Apr 2, 2013)

Here is what I got in hosts:

```
::1                     localhost localhost.my.domain
127.0.0.1               localhost localhost.my.domain
#
# Imaginary network.
#10.0.0.2               myname.my.domain myname
#10.0.0.3               myfriend.my.domain myfriend
#
# According to RFC 1918, you can use the following IP networks for
# private nets which will never be connected to the Internet:
#
#       10.0.0.0        -   10.255.255.255
#       172.16.0.0      -   172.31.255.255
#       192.168.0.0     -   192.168.255.255
```
What to do now ?


----------



## SirDice (Apr 2, 2013)

Add something like this:

```
10.0.0.2 myserver myserver.my.domain
```
Replace the IP address and hostname with what you have.


----------



## chatwizrd (Apr 2, 2013)

I would try something like:

`# sockstat -4 -p80`

Then you will know if something is already running on port 80 and what it is.


----------

