# apache error log location

## carpman

Hello, just updating to new apache2 layout but find on restarting i get error about log location.

```
/etc/init.d/apache2 restart

 * Starting apache2 ...

(2)No such file or directory: apache2: could not open error log file /usr/lib/apache2/logs/error_log.

Unable to open logs 
```

I have checked all the config files in /etc/apache2 but could not find this path? I have path to be /var/log/apache2

any ideas?

cheers

----------

## magic919

Hard to say.

I presume you went from 2.0.58-ish to 2.2.8 but perhaps you could say.  Also post emerge --info.

----------

## rmcknt

Having the same problem here

```

# emerge apache -pv

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

Calculating dependencies... done!

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

Total: 1 package (1 reinstall), Size of downloads: 4,745 kB

```

```

# emerge --info

Portage 2.1.4.4 (default-linux/x86/2007.0/server, gcc-4.1.2, glibc-2.6.1-r0, 2.6.22-gentoo-r9-hdt i686)

=================================================================

System uname: 2.6.22-gentoo-r9-hdt i686 AMD Athlon(tm) XP 2400+

Timestamp of tree: Unknown

ccache version 2.4 [enabled]

app-shells/bash:     3.2_p33

dev-lang/python:     2.4.4-r9

dev-python/pycrypto: 2.0.1-r6

dev-util/ccache:     2.4-r7

sys-apps/baselayout: 1.12.11.1

sys-apps/sandbox:    1.2.18.1-r2

sys-devel/autoconf:  2.61-r1

sys-devel/automake:  1.4_p6, 1.7.9-r1, 1.10

sys-devel/binutils:  2.18-r1

sys-devel/gcc-config: 1.4.0-r4

sys-devel/libtool:   1.5.26

virtual/os-headers:  2.6.24

ACCEPT_KEYWORDS="x86"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /var/bind"

CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"

CXXFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"

DISTDIR="/usr/portage/distfiles"

FEATURES="ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"

GENTOO_MIRRORS="        http://gentoo.intergenia.de/    http://ftp.uni-erlangen.de/pub/mirrors/gentoo/  http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/    http://gentoo.oregonstate.edu/  http://www.ibiblio.org/pub/Linux/distributions/gentoo"

LANG="en_US.UTF-8"

LC_ALL="en_US.UTF-8"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync_excludes --delete-excluded --stats --progress"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="3dnow apache2 bash-completion cli cracklib crypt cups dri gd hardened iconv isdnlog mailwrapper midi mmx mysql ncurses nls nptl nptlonly openmp pam pcre perl pppd python readline reflection session snmp spl sse ssl tcpd threads unicode utf8 x86 xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dbd deflate dir disk_cache ext_filter file_cache filter headers include info log_config mem_cache mime mime_magic rewrite setenvif so status suexec unique_id vhost_alias" APACHE2_MPMS="worker" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 i810 imstt mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTDIR_OVERLAY

```

I did not specify "/usr/lib/apache2/logs/error_log" anywhere in my apache config, but still this logfile is been used.

----------

## e-ffi

I have the following line in /etc/apache/modules.d/00_default_settings.conf

```
ErrorLog /var/log/apache2/error_log
```

Can you grep your apache folder for ErrorLog? That is the directive to tell apache where to put the error log. 

Without that line it will end up in /usr/lib

----------

## richard.scott

I fixed this error on my system as I had a typo in /etc/conf.d/apache2

I'd got APACHE_OPTS rather than APACHE2_OPTS!

This then meant that the "-D DEFAULT_VHOST" stuff wasn't being loaded.

If your not using the DEFAULT_VHOST stuff you need to remember (from what I can tell) to include "Listen 80" at least once in a virtual config file else Apache won't know what port to listen.

----------

