# starting apache2

## manolo_rulez

I merge apache mysql and mod_php, i configured my apache2.conf,commonapache2.conf and php.ini but when i run apache 2 with " /etc/init.d/apache2 start " or " /usr/sbin/apache2 start " i received this message: 

server2 root # /etc/init.d/apache2 start

 * Starting apache2...

Usage: /usr/sbin/apache2 [-D name] [-d directory] [-f file]

                         [-C "directive"] [-c "directive"]

                         [-k start|restart|graceful|stop]

                         [-v] [-V] [-h] [-l] [-L] [-t] [-S]

Options:

  -D name           : define a name for use in <IfDefine name> directives

  -d directory      : specify an alternate initial ServerRoot

  -f file           : specify an alternate ServerConfigFile

  -C "directive"    : process directive before reading config files

  -c "directive"    : process directive after reading config files

  -e level          : show startup errors of level (see LogLevel)

  -E file           : log startup errors to file

  -v                : show version number

  -V                : show compile settings

  -h                : list available command line options (this page)

  -l                : list compiled in modules

  -L                : list available configuration directives

  -t -D DUMP_VHOSTS : show parsed settings (currently only vhost settings)

  -S                : a synonym for -t -D DUMP_VHOSTS

  -t                : run syntax check for config files                                                                [ !! ]

server2 root #

Every letter i put on my command line does not make apache starting and sometime i get this error message:

 [Mon Dec 15 23:56:37 2003] [crit] (92)Protocol not available: make_sock: for address [::]:80, apr_socket_opt_set: (IPV6_V6ONLY)

Somebody can help me?

Claudio

----------

## steveb

can you post the content of /etc/conf.d/apache2 ?

cheers

SteveB

----------

## manolo_rulez

# Copyright 1999-2003 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License v2

# $Header: /home/cvsroot/gentoo-x86/net-www/apache/files/2.0.40/apache2.confd,v 1.5 2003/09/27 04:47:18 woodchip Exp $

# Config file for /etc/init.d/apache2

# An example from /etc/apache2/conf/modules.d/40_mod_ssl.conf:

#

# <IfDefine SSL>

#  <IfModule !mod_ssl.c>

#    LoadModule ssl_module    extramodules/mod_ssl.so

#  </IfModule>

# </IfDefine>

#

# This means that the mod_ssl.so DSO module is only loaded

# into the server when you pass "-D SSL" at startup.  To

# enable WebDAV, add "-D DAV -D DAV_FS".  If you installed

# mod_php then add "-D PHP4".  For more options, please

# read the files in the /etc/apache2/conf/modules.d directory.

APACHE2_OPTS="-D SSL D PHP4"

----------

## manolo_rulez

i fixed the "-" before D PHP4

(APACHE2_OPTS="-D SSL D PHP4")

then:

server2 root # /etc/init.d/apache2 start

 * Starting apache2...

[Wed Dec 17 00:49:59 2003] [crit] (92)Protocol not available: make_sock: for address [::]:80, apr_socket_opt_set: (IPV6_V6ONLY)

no listening sockets available, shutting down

Unable to open logs

                                                                                                                       [ !! ]

server2 root #

----------

## steveb

what do you get when executing this command:

```
grep ^PROTOCOLS /etc/rc.conf
```

and what do you get, when you execute the following command:

```
ifconfig
```

and what do you get, when you execute the following command:

```
netstat -an | grep -i ":80\ "
```

and what do you get, when you execute the following command:

```
grep -i "^CONFIG_PACKET=\|^CONFIG_UNIX=\|^CONFIG_INET=\|^CONFIG_IPV6=" /lib/modules/$(uname -r)/build/.config
```

and what do you get, when you execute the following command:

```
tail -n 100 /var/log/apache2/error_log
```

cheers

SteveB

----------

## manolo_rulez

1)server2 root # grep ^PROTOCOLS /etc/rc.conf

PROTOCOLS="1 2 10"

2)server2 root # ifconfig

eth0      Link encap:Ethernet  HWaddr 00:20:18:55:13:B4

          inet addr:1.32.1.43  Bcast:1.32.1.255  Mask:255.255.255.0

          inet6 addr: fe80::220:18ff:fe55:13b4/10 Scope:Link

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:202744 errors:0 dropped:0 overruns:0 frame:0

          TX packets:146434 errors:345 dropped:0 overruns:0 carrier:332

          collisions:48751 txqueuelen:100

          RX bytes:39589101 (37.7 Mb)  TX bytes:17525279 (16.7 Mb)

          Interrupt:9 Base address:0xe400

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:16886 errors:0 dropped:0 overruns:0 frame:0

          TX packets:16886 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:676200 (660.3 Kb)  TX bytes:676200 (660.3 Kb)

klod      Link encap:IPv6-in-IPv4

          inet6 addr: 2001:b40:def:5000::1a0/0 Scope:Global

          inet6 addr: fe80::c0a8:6302/10 Scope:Link

          inet6 addr: fe80::120:12b/10 Scope:Link

          inet6 addr: 2001:b40:def:f000::34/0 Scope:Global

          UP POINTOPOINT RUNNING NOARP  MTU:1480  Metric:1

          RX packets:49271 errors:0 dropped:0 overruns:0 frame:0

          TX packets:48927 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:6930990 (6.6 Mb)  TX bytes:4000541 (3.8 Mb)

sit0      Link encap:IPv6-in-IPv4

          inet6 addr: ::192.168.99.2/96 Scope:Compat

          inet6 addr: ::127.0.0.1/96 Scope:Unknown

          inet6 addr: ::1.32.1.43/96 Scope:Compat

          inet6 addr: 2001:b40:def:f000::34/0 Scope:Global

          inet6 addr: 2001:b40:def:f000::35/0 Scope:Global

          UP RUNNING NOARP  MTU:1480  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

tun0      Link encap:Point-to-Point Protocol

          inet addr:192.168.99.2  P-t-P:192.168.99.1  Mask:255.255.255.255

          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1450  Metric:1

          RX packets:3283 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1576 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:10

          RX bytes:408660 (399.0 Kb)  TX bytes:412458 (402.7 Kb)

3)server2 root # netstat -an | grep -i ":80\ "

server2 root #

4)server2 root # grep -i "^CONFIG_PACKET=\|^CONFIG_UNIX=\|^CONFIG_INET=\|^CONFIG_IPV6=" /lib/modules/$(uname -r)/build/.config

CONFIG_PACKET=y

CONFIG_UNIX=y

CONFIG_INET=y

CONFIG_IPV6=y

server2 root #

5)server2 root # tail -n 100 /var/log/apache2/error_log

tail: cannot open `/var/log/apache2/error_log' for reading: No such file or directory

server2 root #

i've /var/log/apache2 but no logs in it.

thnx klod

----------

## korozion

You forgot a - before the second D

----------

## steveb

do you realy need IPv6 support? if not, then turn it off!

and check your apache configuraton. did you set the servername correctly?

cheers

SteveB

----------

## korozion

I run Apache2 with IPv6 and all is well.  But like I said, you have -D PHP4 D SSL  and it should be -D PHP4 -D SSL   and on the same line

----------

## manolo_rulez

in my previous message:

>i fixed the "-" before D PHP4 

>

>(APACHE2_OPTS="-D SSL D PHP4") 

Yes, i nedd also ipv6 on my apache webserver because i'm behind a nat

----------

## manolo_rulez

I forgot to tell you that i'm on a unstable version of gentoo, is it possible that apache2 with ipv6 doesn't run on a ~x86 ?

----------

## steveb

 *manolo_rulez wrote:*   

> I forgot to tell you that i'm on a unstable version of gentoo, is it possible that apache2 with ipv6 doesn't run on a ~x86 ?

 if you read the post of korozion, then you will see, that he uses IPv6.

cheers

SteveB

----------

