# [solved] User apache: apache won't start

## donjames

Hi,

I have a new install of apache that won't start.  I get the following error message:

```

/etc/init.d/apache2 start

 * Caching service dependencies ...                                          [ ok ]

 * apache2 has detected an error in your setup:

AH00526: Syntax error on line 149 of /etc/apache2/httpd.conf:

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

 * ERROR: apache2 failed to start

```

Line 149 of /etc/apache2/httpd.conf is

```

User apache

```

Can someone give me a  hint about what is going on here?

Thanks,

Don JamesLast edited by donjames on Fri Dec 21, 2012 4:37 am; edited 1 time in total

----------

## NeddySeagoon

donjames,

Please post some context around line 149.  say +/- 5 lines.

Error checkers are usually pretty good but not always spot on. 

You could always put all of /etc/apache2/httpd.conf on a pastebin

----------

## donjames

Here ya go:

```

LoadModule unique_id_module modules/mod_unique_id.so

<IfDefine USERDIR>

LoadModule userdir_module modules/mod_userdir.so

</IfDefine>

LoadModule usertrack_module modules/mod_usertrack.so

LoadModule vhost_alias_module modules/mod_vhost_alias.so

# If you wish httpd to run as a different user or group, you must run

# httpd as root initially and it will switch.

#

# User/Group: The name (or #number) of the user/group to run httpd as.

# It is usually good practice to create a dedicated user and group for

# running httpd, as with most system services.

User apache

Group apache

# Supplemental configuration

#

# Most of the configuration files in the /etc/apache2/modules.d/ directory can

# be turned on using APACHE2_OPTS in /etc/conf.d/apache2 to add extra features

# or to modify the default configuration of the server.

#

# To know which flag to add to APACHE2_OPTS, look at the first line of the

# the file, which will usually be an <IfDefine OPTION> where OPTION is the

# flag to use.

Include /etc/apache2/modules.d/*.conf

# Virtual-host support

#

```

Thanks,

Don James

----------

## NeddySeagoon

donjames,

I can't believe that you don't have a user and group for apache on your system but do you?

Look in  /etc/groups and /etc/passwd.

----------

## donjames

Here are the contents of /etc/group:

```

 cat group

root::0:root

bin::1:root,bin,daemon

daemon::2:root,bin,daemon

sys::3:root,bin,adm

adm::4:root,adm,daemon

tty::5:

disk::6:root,adm

lp::7:lp

mem::8:

kmem::9:

wheel::10:root

floppy::11:root

news::13:news

uucp::14:uucp

console::17:

audio::18:

cdrom::19:

tape::26:root

video::27:root

cdrw::80:

usb::85:

users::100:games

portage::250:portage

utmp:x:406:

nogroup::65533:

nobody::65534:

man:x:15:

sshd:x:22:

mail:x:12:postfix

postmaster:!:249:

postfix:x:207:

postdrop:x:208:

locate:x:206:

cron:x:16:

crontab:x:205:

ntp:x:123:

messagebus:x:122:

mysql:x:60:

apache:x:81:

polkitd:x:121:

```

What do you think?

Thanks,

Don James

----------

## donjames

Here are the contents of cat /etc/passwd:

```

 cat passwd

root:x:0:0:root:/root:/bin/bash

bin:x:1:1:bin:/bin:/bin/false

daemon:x:2:2:daemon:/sbin:/bin/false

adm:x:3:4:adm:/var/adm:/bin/false

lp:x:4:7:lp:/var/spool/lpd:/bin/false

sync:x:5:0:sync:/sbin:/bin/sync

shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown

halt:x:7:0:halt:/sbin:/sbin/halt

news:x:9:13:news:/var/spool/news:/bin/false

uucp:x:10:14:uucp:/var/spool/uucp:/bin/false

operator:x:11:0:operator:/root:/bin/bash

portage:x:250:250:portage:/var/tmp/portage:/bin/false

nobody:x:65534:65534:nobody:/var/empty:/bin/false

man:x:13:15:added by portage for man-db:/usr/share/man:/sbin/nologin

sshd:x:22:22:added by portage for openssh:/var/empty:/sbin/nologin

mail:x:8:12:added by portage for mailbase:/var/spool/mail:/sbin/nologin

postmaster:x:14:249:added by portage for mailbase:/var/spool/mail:/sbin/nologin

postfix:x:207:207:added by portage for postfix:/var/spool/postfix:/sbin/nologin

cron:x:16:16:added by portage for cronbase:/var/spool/cron:/sbin/nologin

ntp:x:123:123:added by portage for ntp:/dev/null:/sbin/nologin

messagebus:x:101:122:added by portage for dbus:/dev/null:/sbin/nologin

mysql:x:60:60:added by portage for mysql:/dev/null:/sbin/nologin

apache:x:81:81:added by portage for apache:/var/www:/sbin/nologin

polkitd:x:102:121:added by portage for polkit:/var/lib/polkit-1:/sbin/nologin

```

What do you think?

Thanks,

Don James

----------

## tomk

It looks like it's bug 410607 which is fixed in 2.4.3.

----------

## donjames

Hi,

I fixed it.

I had the followint in the /etc/make.conf file:

```

 APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfil

e authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers id

ent imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite seten

vif so speling status unique_id userdir usertrack vhost_alias"

```

I commented out this line and re-installed apache and now it works.

Thanks,

Don James

----------

