# Apache don't want to start... no log...

## pep_gentoo

Hello I've just upgraded apache 2.0 to 2.2.

It has all messed up...  :Sad: 

Then I've perhaps done something wrong ... : 

emerge --unmerge apache

rm -rf /var/www

rm -rf /etc/apache

emerge apache

And now apache still doesn't work  :Sad: 

/etc/init.d/apache2 start

/etc/init.d/apache2 stop

 * WARNING:  apache2 has not yet been started.

!!

There is no interesting log in /var/log/apache, i'm a bit lost ...

I've readen gentoo wiki without any help...

```

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

```

Can anybody help me??

----------

## geowapa

Apache 2.2 restructured the configuration files as I recall.    You might try running httpd manually and pick through the errors that way.  For example here are some manual execution attempts on my system.

```

myhost geo # /usr/sbin/apache2

Syntax error on line 23 of /etc/apache2/vhosts.d/01_lists.vhost1.org.conf:

Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration

myhost gac # /usr/sbin/apache2 -DSSL

Syntax error on line 133 of /etc/apache2/vhosts.d/30_vhost2.org.conf:

Invalid command 'php_admin_flag', perhaps misspelled or defined by a module not included in the server configuration

myhost gac # /usr/sbin/apache2 -DSSL -DPHP5

Syntax error on line 5 of /etc/apache2/vhosts.d/99_twiki.vhost3.com.conf:

```

----------

## pep_gentoo

Ok I've just tried what you said... and it works ...

/usr/sbin/apache2 starts and I can reach a forbidden page. (Ok t's forbidden but since before i've got something!)

If i do /etc/init.d/apache2 start

nothing happens...

I suspect ${APACHE2} not defined on my system! (In fact I don't know where it is defined...)

How can I solve this ?_?

----------

## upengan78

post your /etc/conf.d/apache2 and /etc/init.d/apache2 files..

----------

## pep_gentoo

/usr/sbin/apache2 -D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST

(98)Address already in use: make_sock: could not bind to address [::]:80

(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

/etc/conf.d/apache2

 *Quote:*   

> 
> 
> # /etc/conf.d/apache2: config file for /etc/init.d/apache2
> 
> # When you install a module it is easy to activate or deactivate the modules
> ...

 

Here is /etc/apache/httpd.conf

 *Quote:*   

> 
> 
> # This is a modification of the default Apache 2.2 configuration file
> 
> # for Gentoo Linux.
> ...

 

Perhaps my serverName localhost line is bad???

----------

## pep_gentoo

Also here is my /etc/init.d/apache2

 *Quote:*   

> 
> 
> #!/sbin/runscript
> 
> # Copyright 1999-2007 Gentoo Foundation
> ...

 

----------

## upengan78

Could be this is my httpd.conf

 *Quote:*   

> 
> 
> ServerRoot "/usr/lib64/apache2"
> 
> LoadModule actions_module modules/mod_actions.so
> ...

 

Also

/etc/apache2/vhosts.d/00_default_vhost.conf

 *Quote:*   

> # Virtual Hosts
> 
> <IfDefine DEFAULT_VHOST>
> 
> #Listen 12.34.56.78:80
> ...

 

----------

## pep_gentoo

Hum I've copied your conf file in mine:

apache2: Syntax error on line 13 of /etc/apache2/httpd.conf: Cannot load /usr/lib64/apache2/modules/mod_authn_dbd.so into server: /usr/lib64/apache2/modules/mod_authn_dbd.so: cannot open shared object file: No such file or directory

apache2: Syntax error on line 40 of /etc/apache2/httpd.conf: Cannot load /usr/lib64/apache2/modules/mod_dbd.so into server: /usr/lib64/apache2/modules/mod_dbd.so: cannot open shared object file: No such file or directory

apache2: Syntax error on line 54 of /etc/apache2/httpd.conf: Cannot load /usr/lib64/apache2/modules/mod_ident.so into server: /usr/lib64/apache2/modules/mod_ident.so: cannot open shared object file: No such file or directory

apache2: Syntax error on line 55 of /etc/apache2/httpd.conf: Cannot load /usr/lib64/apache2/modules/mod_imagemap.so into server: /usr/lib64/apache2/modules/mod_imagemap.so: cannot open shared object file: No such file or directory

Then I've commented the lines.

mediabox ~ # /usr/sbin/apache2 -D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST

apache2: apr_sockaddr_info_get() failed for mediabox

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

mediabox ~ # /usr/sbin/apache2 -D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST -k stop

apache2: apr_sockaddr_info_get() failed for mediabox

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

Perhaps there is something wrong with my compilation... ???

Arf...

----------

## upengan78

you have written you rm -rf /etc/apache but config files are in /etc/apache2

delete every config file of apache and take back up before that !!

emerger apache2 and etc-update and check again

----------

## zouzou85

I also have the same problem. to be precise, it is apache-2.2.6-r7

i followed this tutorial http://gentoo-wiki.com/Apache2_Install and put the Servername as localhost and Listen at port 80 but didn't start, when i deleted those two lines from /etc/apache2/httpd.conf, apache started with the command /etc/init.d/apache2 start. However, when i type http://localhost in the web browser (links), it says that "error loading http://localhost: Connection refused"

am I doing something wrong?

----------

## zouzou85

ok, 

I looked more into it and found this https://forums.gentoo.org/viewtopic.php?t=104806&highlight=apache+php.

in step 3.1, the Servername is put as both localhost and the ip address such as 192.168.0.1:80 (the port seems important, since they don't have the "Listen" line. 

then i tested in links (web browser), and i had to type the ip address (with out port) and voila, it worked. but when i type localhost, it doesn't. I am not sure about the reasons for that tho. 

anyway, hope that helps a little and PLEASE CORRECT ME IF I AM WRONG, AS THIS IS THE FIRST TIME I INSTALL APACHE

zouzou

P.S.: I also noticed that if i type 127.0.0.1 in the web browser i get the default apache page., but localhost doesn't work. weird!!!!

----------

## upengan78

if 127.0.0.1 works and localhost does not work then check /etc/hosts file guys

127.0.0.1  localhost in one line and you can add hostname to this line too.

----------

## zouzou85

 *Quote:*   

> if 127.0.0.1 works and localhost does not work then check /etc/hosts file guys
> 
> 127.0.0.1 localhost in one line and you can add hostname to this line too.

 

well, /etc/hosts doesn't seem to affect anything. i changed localhost to tuxhost so the line looks like this:

 *Quote:*   

> 127.0.0.1                tuxhost.tuxdomain tuxhost localhost
> 
> ::1                   tuxhost.tuxdomain tuxhost localhost

 

and it is not helping when trying to login to apache using any of the above host names. but ip addresses work.

----------

## upengan78

can you try restarting net.eth0

----------

## zouzou85

 *upengan78 wrote:*   

> can you try restarting net.eth0

 

yes, even rebooted after that a couple of times ( not for this specific issue)

----------

## upengan78

did you check in apache error logs and /var/log/messages any lines when you access http://localhost

----------

## Tintamarre

Did you try adding your APACHE2_MODULES config infos to your /etc/make.conf according to :

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

----------

## stuorguk

 *Tintamarre wrote:*   

> Did you try adding your APACHE2_MODULES config infos to your /etc/make.conf according to :
> 
> http://www.gentoo.org/doc/en/apache-upgrading.xml

 

I have done that, but same problem.

----------

## stuorguk

It seems to be a PHP problem. If I disable it, apache works again.   :Confused: 

----------

## Tintamarre

Did you try re- emerge php ? I had to do it, last time I upgraded apache ?

( Apache is always painful to upgrade  :Sad:  )

----------

## stuorguk

It's eaccelerator thats the problem.  If I disable that, php & apache works.

----------

