# Apache on AMD64 "httpd (no pid file) not running"

## evlich

I installed apache on my amd64 arch and it doesn't serve files. Here's what I get when I start and stop it:

```
# /etc/init.d/apache2 start

 * Starting apache2 ...

apache2: apr_sockaddr_info_get() failed for xshard

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

```

```

# /etc/init.d/apache2 stop

 * Stopping apache2 ...

apache2: apr_sockaddr_info_get() failed for xshard

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

httpd (no pid file) not running                                           [ ok ]

```

Does anyone know what could be the problem? There seem to be two (possibly unrelated since I've gotten the message about apr_sockaddr_info_get() before and apache has still worked by going to 127.0.0.1), the second one being that httpd is not starting for some reason.

My online searches found me this: http://newsgroups.derkeiler.com/Archive/Comp/comp.infosystems.www.servers.unix/2008-07/msg00002.html but I tried making /var/run/httpd.pid and that didn't solve the problem.

Thanks for any suggestions.

----------

## balkira

hi,

I'm having the same issue as I updated from 2.0.59 to 2.2.9.

```
tubbyblog run # /etc/init.d/apache2 restart

 * Stopping apache2 ...

httpd (no pid file) not running                                                                                        [ ok ]

 * Starting apache2 ...                                                                                                [ ok ]

tubbyblog run # /etc/init.d/apache2 restart

 * Stopping apache2 ...

httpd (no pid file) not running                                                                                        [ ok ]

 * Starting apache2 ...                                                                                                [ ok ]

tubbyblog run #

tubbyblog run # lsof -i |grep http

tubbyblog run # netstat -putan | grep 80

tubbyblog run #

```

I noticed that "starting" apache2 lasts 10sec ( the default timeout). But no process loads at all.

As a fix for:

 *Quote:*   

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

 

I added my own ServerName to httpd.conf as follow:

```
ServerName tubbyblog.com
```

 *Quote:*   

> My online searches found me this: http://newsgroups.derkeiler.com/Archive/Comp/comp.infosystems.www.servers.unix/2008-07/msg00002.html but I tried making /var/run/httpd.pid and that didn't solve the problem. 

 

By looking at google I came across this link but it didn't help at all. I tried to manually create a /var/run/apache2.pid file with rights root:root (and tried apache:apache too) but none of this helped me out.

I'm running out of ideas, if any gentoo fellow could guide us, that would be nice, thanks for reading.

----------

## gimpel

* Did you guys run etc-update and updated the configs correctly?

* What is in apache's error_log?

* Which USE flags and APACHE_MODULES are enabled?

Further reading: http://www.gentoo.org/proj/en/apache/doc/upgrading.xml

----------

## balkira

hi,

 *Quote:*   

> * Did you guys run etc-update and updated the configs correctly?
> 
> * What is in apache's error_log?
> 
> * Which USE flags and APACHE_MODULES are enabled?
> ...

 

Thanks for your advice, but even after changing the old apache2-builtin-mods file into APACHE_MODULES flags didn't do the trick.

So I just backed up /etc/apache2 and erased it all. I then rebuilt apache php mod_perl and the process now loads.

So far for me, the process loads and I can at least browse some html.

Thanks for your help.

@evlich: I would recommend to do the same _if_ you can't find your way out using the upgrade guide.

----------

## evlich

I checked my apache error log and noticed that it was failing to load the module unique_id, I commented that out and it worked for me. It is strange though, because mod_unique_id is in my APACHE_MODULES use flag (comes out red on emerge -av apache) so it seems like it should be installed.

Thanks for your help.

----------

## Mgiese

i got the same problem here, but how to disable the unique_id modul ?

when i try to disable the useflag it just does not work :

```
USE="-unique_id" emerge -av apache

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] www-servers/apache-2.2.9-r1  USE="ldap ssl -debug -doc (-selinux) -sni -static -suexec -threads" APACHE2_MODULES="actions alias asis auth_digest authz_host autoindex cache dav deflate dir env expires filter headers include info log_config logio mime negotiation proxy rewrite setenvif speling status unique_id userdir usertrack -auth_basic -authn_alias -authn_anon -authn_dbd -authn_dbm -authn_default -authn_file -authz_dbm -authz_default -authz_groupfile -authz_owner -authz_user -cern_meta -charset_lite -dav_fs -dav_lock -dbd -disk_cache -dumpio -ext_filter -file_cache -ident -imagemap -log_forensic -mem_cache -mime_magic -proxy_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http -substitute -version -vhost_alias" APACHE2_MPMS="-event -itk -peruser -prefork -worker" 4,887 kB

```

thx a lot

----------

## evlich

It looks like you can set something in APACHE2_MODULES variable:

http://www.gentoo.org/proj/en/apache/doc/upgrading.xml

I looked in my laptop and didn't find anything, but I might have been having this problem only on my desktop, I'm not entirely sure.

----------

## turudd

I had the same problem, once I  added the name it was getting from the apr_sockaddr_info_get() to the /etc/hosts file it worked fine.

in your case "xshard".

sample /etc/hosts

```

127.0.0.1      localhost       xshard

```

----------

## yealexxx

hello all, my problem is same. I resolved apr_sockaddr_info_get() with /etc/hosts add 

```
 127.0.0.1      localhost       alex  
```

but. When I do. /etc/init.d/apache2 start this is the out.

```
alex alex # /etc/init.d/apache2 start

 * Starting apache2 ...

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

what's the problem with this?

----------

