# [CLOSED] Apache 2.0.50 won't start  - (98) bind address

## trossachs

I have just made the change to the latest version and for some reason the web server won't run. I have NOT made any changes to the httpd.conf file so it should all be the same. The error:

```

Syntax error on line 153 of /usr/local/apache2/conf/httpd.conf:

Invalid command 'AddType', perhaps mis-spelled or defined by a module not included in the server configuration

```

Line 153:

```

AddType application/x-httpd-php .php5 .php4 .php3 .phtml .php

```

What am I missing out? thxLast edited by trossachs on Wed Oct 06, 2004 6:23 am; edited 7 times in total

----------

## steveb

the addtype needs mod_mime. do you have mod_mime loaded as module in you apache?

anyway... my apache2 setup has no httpd.conf and the AddType for php is in /etc/apache2/conf/modules.d/70_mod_php.conf.

cheers

SteveB

----------

## hanj

Isn't the AddType directive for php handled in the /etc/apache2/conf/modules.d/70_mod_php.conf?

```
 <IfModule mod_mime.c>

        AddType application/x-httpd-php .php

        AddType application/x-httpd-php .phtml

        AddType application/x-httpd-php .php3

        AddType application/x-httpd-php .php4

        AddType application/x-httpd-php-source .phps

    </IfModule>
```

What happens if you comment out that line?

hanji

----------

## trossachs

 *Quote:*   

> 
> 
> What happens if you comment out that line? 
> 
> 

 

It simply goes onto the nxt AddType line and fails to load from there.

----------

## trossachs

Having added mime_module, an error is thrown up at:

```

Syntax error on line 182 of /usr/local/apache2/conf/httpd.conf:

Invalid command 'Order', perhaps mis-spelled or defined by a module not included in the server configuration

```

This is pointing at the "Order" statement below:

```

<Directory "/usr/html">

    Options FollowSymLinks

    AllowOverride Indexes Limit Authconfig Fileinfo

    Order allow,deny

    Allow from all

</Directory>

```

----------

## steveb

 *JulesF wrote:*   

> Having added mime_module, an error is thrown up at:
> 
> ```
> 
> Syntax error on line 182 of /usr/local/apache2/conf/httpd.conf:
> ...

 

probably mod_access missing

but why the hell do you use a non standard apache configuration? with the defalt gentoo configuration you do not have that kind of problems.

cheers

SteveB

----------

## trossachs

I never could the Gentoo version to work. But also, I wanted to make sure that I understood Apache without Gentoo in case I was ever called upon to compile from scratch. Gentoo is great, but like Redhat, it can make you lazy!

----------

## steveb

okay. i got that point.

but why do you then ask us to help?

why don't you read the diffrend apache how to's and the other varios apache related forums?

cheers

SteveB

----------

## trossachs

I can well see your point also. Apache is the only app that I have decided to configure without the aid of emerge. As the server has been down for some 24hrs, I have decided to try emerge again, (some 18 months later). There have been a few errors thrown up, but they were all to do with modules not being put into the correct place.

In this light, perhaps you can assist. I am back at this "order" error as listed, with the newly emerged Apache 2.0.50, but in the commonapache2.conf file:

```

Syntax error on line 177 of /etc/apache2/conf/commonapache2.conf:

Invalid command 'Order', perhaps mis-spelled or defined by a module not included in the server configuration

```

Line 177, is again this "order" statement:

```

<Directory "/usr/html">

    Options FollowSymLinks

    AllowOverride Indexes Limit Authconfig Fileinfo

    Order allow,deny

    Allow from all

</Directory>

```

Am moving steadily down the config file, but I must confess that I do not fully understand these Directives.

----------

## steveb

did you load?

```
LoadModule access_module modules/mod_access.so
```

cheers

SteveB

btw: if you realy want to try the "try and error" method, then use this:

```
# grep -i -R "Order" /usr/lib/apache2/modules/

Binary file /usr/lib/apache2/modules/mod_access.so matches

Binary file /usr/lib/apache2/modules/mod_status.so matches

Binary file /usr/lib/apache2/modules/mod_autoindex.so matches
```

```
# grep -i -R "AddType" /usr/lib/apache2/modules/

Binary file /usr/lib/apache2/modules/mod_mime.so matches
```

----------

## trossachs

Yes thought about that access_module as it was commented out before so enabled it. All works bar that:

```

(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

```

... error. The logs, I can make changes to have them written. Have issued netstat -lnt command, but there is no port 80 being listened out for.

----------

## trossachs

I am constantly getting this (9 :Cool:  Address already in use: could not bind to 0.0.0.0:80 error. To resolve, I have changed the port to 81 for example, restarted Apache and all is well. But when I got back and change, it reverts back.

The output of: 

```

netstat -lnp | grep '0.0.0.0:80'

```

produces:

```

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      30673/apache2

```

So I kill off that particular pid, but it does not stay that way. Somebody pls come back with some suggestions as the box has not been able to serve pages for over 24 hrs. thx

----------

## steveb

 *JulesF wrote:*   

> I am constantly getting this (9 Address already in use: could not bind to 0.0.0.0:80 error. To resolve, I have changed the port to 81 for example, restarted Apache and all is well. But when I got back and change, it reverts back.
> 
> The output of: 
> 
> ```
> ...

 

what is the output of:

ps auxw|grep -i apache2|grep -v grep

on your system?

another question is:

how do you start apache? by your own made script? or with the gentoo init script?

cheers

SteveB

----------

## trossachs

So many issues, blips, problems... Ahhhhhhhhhhhhhhhhhhh! Have all come good in the end. For the benefit of those of you who have faithfully followed this post.: the problem with this '98 bind address error' is that there are two conf files, apache.conf and also commonapache.conf. Both of these config files had got the "listen" directive inserted into them. 

Thus when Apache was started, whichever config file loaded first took that slot. The following config file also loaded, but found that the address was already taken by the first config file! Bloody nightmate and no amount of Googling came to my aid. 

Thanks for all your suggestions. As ever, they are most appreciated. I will provide a "hotnote" on my own home page and post the details here so that you don't have to go thru this shit like I did! cheers.

----------

## Slyde

Similar issue, has me stumped.

```
solstice slyde # /etc/init.d/apache2 restart

 * Starting apache2...

(98)Address already in use: make_sock: could not bind to address 0.0.0.0:443

no listening sockets available, shutting down

Unable to open logs                                                                           [ !! ]
```

Apache is not bound to port 443, sshd is. I have no idea why this happening. I will keep looking...

----------

## Slyde

Um. Ya. Fixed it. I had APACHE2_OPTS="-D SSL" in /etc/conf.d/apache2 so it was trying to go thru 443 and conflicting with sshd (also routed thru 443).

Oh well.  :Very Happy: 

----------

## humbletech99

I've got this same problem, but I commented out the line ou mentioned in /etc/conf.d/apache2 and tried again and it made no difference!

It can't start and there is nothing listening to ports 80 or 443.

I could really use some suggestions at this point...

----------

## trossachs

First of, do:

```
netstat -plnt
```

and come back here with the output. This way we can see what exactly is using port 80 or 443.

----------

## humbletech99

that occurred to me, the output showed nothing was bound so it clicked that it may be trying to bind to the wrong address (the conf was taken from another server). Changed the conf and it's up now. Only problem is this damn segmentation fault I keep getting when trying to view a page, but that's another thread... https://forums.gentoo.org/viewtopic-t-406988.html

----------

## trossachs

Last time I had a seg fault it was to do with php, what version are you using?

----------

