Skip to main content

Thread: Apache: restart results in "can't open log file" error


i tweaking log file configuration in /etc/apache2/sites-enabled/my.file file. changed things in /etc/apache2/apache2.conf file. (comment out serverroot line)

when attempt restart apache get:

code:
(2)no such file or directory: apache2: not open error log file /etc/apache2/{$apache_log_dir}/error.log.  unable open logs  action 'start' failed.
i've tried everything, can't figure out why apache prepending /etc/apache2 log directory path. (the actual path standard /var/log/apache2 dir)

here's /etc/apache2/envvars file:
code:
# envvars - default environment variables apache2ctl    # won't correct after changing uid  unset home    # supporting multiple apache2 instances  if [ "${apache_confdir##/etc/apache2-}" != "${apache_confdir}" ] ;  	suffix="-${apache_confdir##/etc/apache2-}"  else  	suffix=  fi    # since there no sane way parsed apache2 config in scripts,  # settings defined via environment variables , used in apache2ctl,  # /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.  export apache_run_user=www-data  export apache_run_group=www-data  export apache_pid_file=/etc/apache2/run/apache2$suffix.pid  export apache_run_dir=/etc/apache2/run/apache2$suffix  export apache_lock_dir=/etc/apache2/lock/apache2$suffix  # /var/log/apache2 handled /etc/logrotate.d/apache2.  export apache_log_dir=/var/log/apache2$suffix    ## locale used modules mod_dav  export lang=c  ## uncomment following line use system default locale instead:  #. /etc/default/locale    export lang    ## command status 'apache2ctl status'.  ## packages providing 'www-browser' need '--dump' instead of '-dump'.  #export apache_lynx='www-browser -dump'    here's when try grepping files string '/etc/apache2':  /etc/apache2$ sudo grep -r "\/etc\/apache2" *.*  apache2.conf:#serverroot "/etc/apache2"  apache2.conf:include /etc/apache2/conf.d/*.conf  apache2.conf.bak:# serverroot set "/etc/apache2" interpreted  apache2.conf.bak:# server "/etc/apache2/foo.log".  apache2.conf.bak:#serverroot "/etc/apache2"  apache2.conf.bak:# needs set in /etc/apache2/envvars  apache2.conf.bak:# these need set in /etc/apache2/envvars  ports.conf:# /etc/apache2/sites-enabled/000-default  ports.conf:    # virtualhost statement in /etc/apache2/sites-available/default-ssl
for life of me, can't figure 1 out...any ideas appreciated!

apache2.conf file , <virtualhost> config follow:

here's /etc/apache2/apache2.conf file:
code:
#  # main apache server configuration file.  contains  # configuration directives give server instructions.  # see <url:http://httpd.apache.org/docs/2.2/> detailed information.  # in particular, see  # <url:http://httpd.apache.org/docs/2.2/mod/directives.html>  # discussion of each configuration directive.  #  #  # not read instructions in here without understanding  # do.  they're here hints or reminders.  if unsure  # consult online docs. have been warned.    #  # configuration directives grouped 3 basic sections:  #  1. directives control operation of apache server process  #     whole (the 'global environment').  #  2. directives define parameters of 'main' or 'default' server,  #     responds requests aren't handled virtual host.  #     these directives provide default values settings  #     of virtual hosts.  #  3. settings virtual hosts, allow web requests sent  #     different ip addresses or hostnames , have them handled  #     same apache server process.  #  # configuration , logfile names: if filenames specify many  # of server's control files begin "/" (or "drive:/" win32),  # server use explicit path.  if filenames *not* begin  # "/", value of serverroot prepended -- "logs/foo.log"  # serverroot set "/etc/httpd" interpreted  # server "/etc/httpd/logs/foo.log".  #    ### section 1: global environment  #  # directives in section affect overall operation of apache,  # such number of concurrent requests can handle or  # can find configuration files.  #    #  # don't give away information subcomponents  # running.  comment out line if don't mind remote sites  # finding out major optional modules running  servertokens os    #  # serverroot: top of directory tree under server's  # configuration, error, , log files kept.  #  # note!  if intend place on nfs (or otherwise network)  # mounted filesystem please read lockfile documentation  # (available @ <url:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);  # save lot of trouble.  #  # not add slash @ end of directory path.  #  #serverroot "/etc/apache2"    #  # pidfile: file in server should record process  # identification number when starts.  #  pidfile run/httpd.pid    #  # timeout: number of seconds before receives , sends time out.  #  timeout 120    #  # keepalive: whether or not allow persistent connections (more  # 1 request per connection). set "off" deactivate.  #  keepalive off    #  # maxkeepaliverequests: maximum number of requests allow  # during persistent connection. set 0 allow unlimited amount.  # recommend leave number high, maximum performance.  #  maxkeepaliverequests 100    #  # keepalivetimeout: number of seconds wait next request  # same client on same connection.  #  keepalivetimeout 15    ##  ## server-pool size regulation (mpm specific)  ##     # prefork mpm  # startservers: number of server processes start  # minspareservers: minimum number of server processes kept spare  # maxspareservers: maximum number of server processes kept spare  # serverlimit: maximum value maxclients lifetime of server  # maxclients: maximum number of server processes allowed start  # maxrequestsperchild: maximum number of requests server process serves  <ifmodule prefork.c>  startservers       8  minspareservers    5  maxspareservers   20  serverlimit      256  maxclients       256  maxrequestsperchild  4000  </ifmodule>    # worker mpm  # startservers: initial number of server processes start  # maxclients: maximum number of simultaneous client connections  # minsparethreads: minimum number of worker threads kept spare  # maxsparethreads: maximum number of worker threads kept spare  # threadsperchild: constant number of worker threads in each server process  # maxrequestsperchild: maximum number of requests server process serves  <ifmodule worker.c>  startservers         2  maxclients         150  minsparethreads     25  maxsparethreads     75   threadsperchild     25  maxrequestsperchild  0  </ifmodule>    #  # listen: allows bind apache specific ip addresses and/or  # ports, in addition default. see <virtualhost>  # directive.  #  # change listen on specific ip addresses shown below   # prevent apache glomming onto bound ip addresses (0.0.0.0)  #  #listen 12.34.56.78:80  listen 80    #  # dynamic shared object (dso) support  #  # able use functionality of module built dso  # have place corresponding `loadmodule' lines @ location  # directives contained in available _before_ used.  # statically compiled modules (those listed `httpd -l') not need  # loaded here.  #  # example:  # loadmodule foo_module /usr/lib/apache2/modules/mod_foo.so  #  loadmodule auth_basic_module /usr/lib/apache2/modules/mod_auth_basic.so  loadmodule auth_digest_module /usr/lib/apache2/modules/mod_auth_digest.so  loadmodule authn_file_module /usr/lib/apache2/modules/mod_authn_file.so  loadmodule authn_alias_module /usr/lib/apache2/modules/mod_authn_alias.so  loadmodule authn_anon_module /usr/lib/apache2/modules/mod_authn_anon.so  loadmodule authn_dbm_module /usr/lib/apache2/modules/mod_authn_dbm.so  loadmodule authn_default_module /usr/lib/apache2/modules/mod_authn_default.so  loadmodule authz_host_module /usr/lib/apache2/modules/mod_authz_host.so  loadmodule authz_user_module /usr/lib/apache2/modules/mod_authz_user.so  loadmodule authz_owner_module /usr/lib/apache2/modules/mod_authz_owner.so  loadmodule authz_groupfile_module /usr/lib/apache2/modules/mod_authz_groupfile.so  loadmodule authz_dbm_module /usr/lib/apache2/modules/mod_authz_dbm.so  loadmodule authz_default_module /usr/lib/apache2/modules/mod_authz_default.so  loadmodule ldap_module /usr/lib/apache2/modules/mod_ldap.so  loadmodule authnz_ldap_module /usr/lib/apache2/modules/mod_authnz_ldap.so  loadmodule include_module /usr/lib/apache2/modules/mod_include.so  loadmodule env_module /usr/lib/apache2/modules/mod_env.so  loadmodule ext_filter_module /usr/lib/apache2/modules/mod_ext_filter.so  loadmodule mime_magic_module /usr/lib/apache2/modules/mod_mime_magic.so  loadmodule expires_module /usr/lib/apache2/modules/mod_expires.so  loadmodule deflate_module /usr/lib/apache2/modules/mod_deflate.so  loadmodule headers_module /usr/lib/apache2/modules/mod_headers.so  loadmodule usertrack_module /usr/lib/apache2/modules/mod_usertrack.so  loadmodule setenvif_module /usr/lib/apache2/modules/mod_setenvif.so  loadmodule mime_module /usr/lib/apache2/modules/mod_mime.so  loadmodule dav_module /usr/lib/apache2/modules/mod_dav.so  loadmodule status_module /usr/lib/apache2/modules/mod_status.so  loadmodule autoindex_module /usr/lib/apache2/modules/mod_autoindex.so  loadmodule info_module /usr/lib/apache2/modules/mod_info.so  loadmodule dav_fs_module /usr/lib/apache2/modules/mod_dav_fs.so  loadmodule vhost_alias_module /usr/lib/apache2/modules/mod_vhost_alias.so  loadmodule negotiation_module /usr/lib/apache2/modules/mod_negotiation.so  loadmodule dir_module /usr/lib/apache2/modules/mod_dir.so  loadmodule actions_module /usr/lib/apache2/modules/mod_actions.so  loadmodule speling_module /usr/lib/apache2/modules/mod_speling.so  loadmodule userdir_module /usr/lib/apache2/modules/mod_userdir.so  loadmodule alias_module /usr/lib/apache2/modules/mod_alias.so  loadmodule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so  loadmodule proxy_module /usr/lib/apache2/modules/mod_proxy.so  loadmodule proxy_balancer_module /usr/lib/apache2/modules/mod_proxy_balancer.so  loadmodule proxy_ftp_module /usr/lib/apache2/modules/mod_proxy_ftp.so  loadmodule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so  loadmodule proxy_connect_module /usr/lib/apache2/modules/mod_proxy_connect.so  loadmodule cache_module /usr/lib/apache2/modules/mod_cache.so  loadmodule suexec_module /usr/lib/apache2/modules/mod_suexec.so  loadmodule disk_cache_module /usr/lib/apache2/modules/mod_disk_cache.so  loadmodule file_cache_module /usr/lib/apache2/modules/mod_file_cache.so  loadmodule mem_cache_module /usr/lib/apache2/modules/mod_mem_cache.so  loadmodule cgi_module /usr/lib/apache2/modules/mod_cgi.so    #  # following modules not loaded default:  #  #loadmodule cern_meta_module /usr/lib/apache2/modules/mod_cern_meta.so  #loadmodule asis_module /usr/lib/apache2/modules/mod_asis.so    #  # load config files config directory "/etc/httpd/conf.d".  #  include /etc/apache2/conf.d/*.conf    #  # extendedstatus controls whether apache generate "full" status  # information (extendedstatus on) or basic information (extendedstatus  # off) when "server-status" handler called. default off.  #  #extendedstatus on    #  # if wish httpd run different user or group, must run  # httpd root , switch.    #  # user/group: name (or #number) of user/group run httpd as.  #  . on sco (odt 3) use "user nouser" , "group nogroup".  #  . on hpux may not able use shared memory nobody, ,  #    suggested workaround create user www , use user.  #  note kernels refuse setgid(group) or semctl(ipc_set)  #  when value of (unsigned)group above 60000;   #  don't use group #-1 on these systems!  #  user apache  group apache    ### section 2: 'main' server configuration  #  # directives in section set values used 'main'  # server, responds requests aren't handled  # <virtualhost> definition.  these values provide defaults  # <virtualhost> containers may define later in file.  #  # of these directives may appear inside <virtualhost> containers,  # in case these default settings overridden  # virtual host being defined.  #    #  # serveradmin: address, problems server should  # e-mailed.  address appears on server-generated pages, such  # error documents.  e.g. admin@your-domain.com  #  serveradmin root@localhost    #  # servername gives name , port server uses identify itself.  # can determined automatically, recommend specify  # explicitly prevent problems during startup.  #  # if not set valid dns name host, server-generated  # redirections not work.  see usecanonicalname directive.  #  # if host doesn't have registered dns name, enter ip address here.  # have access address anyway, , make   # redirections work in sensible way.  #  #servername www.example.com:80    #  # usecanonicalname: determines how apache constructs self-referencing   # urls , server_name , server_port variables.  # when set "off", apache use hostname , port supplied  # client.  when set "on", apache use value of  # servername directive.  #  usecanonicalname on    #  # documentroot: directory out of serve  # documents. default, requests taken directory,  # symbolic links , aliases may used point other locations.  #  documentroot "/var/www/html"    #  # each directory apache has access can configured respect  # services , features allowed and/or disabled in  # directory (and subdirectories).   #  # first, configure "default" restrictive set of   # features.    #  <directory />      options followsymlinks      allowoverride none  </directory>    #  # note point forward must allow  # particular features enabled - if something's not working  # might expect, make sure have enabled  # below.  #    #  # should changed whatever set documentroot to.  #  <directory "/var/www/html">    #  # possible values options directive "none", "all",  # or combination of:  #   indexes includes followsymlinks symlinksifownermatch execcgi multiviews  #  # note "multiviews" must named *explicitly* --- "options all"  # doesn't give you.  #  # options directive both complicated , important.  please see  # http://httpd.apache.org/docs/2.2/mod/core.html#options  # more information.  #      options indexes followsymlinks    #  # allowoverride controls directives may placed in .htaccess files.  # can "all", "none", or combination of keywords:  #   options fileinfo authconfig limit  #      allowoverride none    #  # controls can stuff server.  #      order allow,deny      allow    </directory>    #  # userdir: name of directory appended onto user's home  # directory if ~user request received.  #  # path end user account 'public_html' directory must  # accessible webserver userid.  means ~userid  # must have permissions of 711, ~userid/public_html must have permissions  # of 755, , documents contained therein must world-readable.  # otherwise, client receive "403 forbidden" message.  #  # see also: http://httpd.apache.org/docs/misc/faq.html#forbidden  #  <ifmodule mod_userdir.c>      #      # userdir disabled default since can confirm presence      # of username on system (depending on home directory      # permissions).      #      userdir disable        #      # enable requests /~user/ serve user's public_html      # directory, remove "userdir disable" line above, , uncomment      # following line instead:      #       #userdir public_html    </ifmodule>    #  # control access userdir directories.  following example  # site these directories restricted read-only.  #  #<directory /home/*/public_html>  #    allowoverride fileinfo authconfig limit  #    options multiviews indexes symlinksifownermatch includesnoexec  #    <limit post options>  #        order allow,deny  #        allow  #    </limit>  #    <limitexcept post options>  #        order deny,allow  #        deny  #    </limitexcept>  #</directory>    #  # directoryindex: sets file apache serve if directory  # requested.  #  # index.html.var file (a type-map) used deliver content-  # negotiated documents.  multiviews option can used   # same purpose, slower.  #  directoryindex index.html index.html.var    #  # accessfilename: name of file in each directory  # additional configuration directives.  see allowoverride  # directive.  #  accessfilename .htaccess    #  # following lines prevent .htaccess , .htpasswd files being   # viewed web clients.   #  <files ~ "^\.ht">      order allow,deny      deny  </files>    #  # typesconfig describes mime.types file (or equivalent)  # found.  #  typesconfig /etc/mime.types    #  # defaulttype default mime type server use document  # if cannot otherwise determine one, such filename extensions.  # if server contains text or html documents, "text/plain"  # value.  if of content binary, such applications  # or images, may want use "application/octet-stream" instead  # keep browsers trying display binary files though  # text.  #  defaulttype text/plain    #  # mod_mime_magic module allows server use various hints  # contents of file determine type.  mimemagicfile  # directive tells module hint definitions located.  #  <ifmodule mod_mime_magic.c>  #   mimemagicfile /usr/share/magic.mime      mimemagicfile conf/magic  </ifmodule>    #  # hostnamelookups: log names of clients or ip addresses  # e.g., www.apache.org (on) or 204.62.129.132 (off).  # default off because it'd overall better net if people  # had knowingly turn feature on, since enabling means  # each client request result in @ least 1 lookup request  # nameserver.  #  hostnamelookups off    #  # enablemmap: control whether memory-mapping used deliver  # files (assuming underlying os supports it).  # default on; turn off if serve nfs-mounted   # filesystems.  on systems, turning off (regardless of  # filesystem) can improve performance; details, please see  # http://httpd.apache.org/docs/2.2/mod/core.html#enablemmap  #  #enablemmap off    #  # enablesendfile: control whether sendfile kernel support   # used deliver files (assuming os supports it).   # default on; turn off if serve nfs-mounted   # filesystems.  please see  # http://httpd.apache.org/docs/2.2/mod/core.html#enablesendfile  #  #enablesendfile off    #  # errorlog: location of error log file.  # if not specify errorlog directive within <virtualhost>  # container, error messages relating virtual host  # logged here.  if *do* define error logfile <virtualhost>  # container, host's errors logged there , not here.  #  errorlog {$apache_log_dir}/error.log    #  # loglevel: control number of messages logged error_log.  # possible values include: debug, info, notice, warn, error, crit,  # alert, emerg.  #  loglevel warn    #  # following directives define format nicknames use  # customlog directive (see below).  #  logformat "%h %l %u %t \"%r\" %>s %b \"%{referer}i\" \"%{user-agent}i\"" combined  logformat "%h %l %u %t \"%r\" %>s %b" common  logformat "%{referer}i -> %u" referer  logformat "%{user-agent}i" agent    # "combinedio" includes actual counts of actual bytes received (%i) , sent (%o);  # requires mod_logio module loaded.  #logformat "%h %l %u %t \"%r\" %>s %b \"%{referer}i\" \"%{user-agent}i\" %i %o" combinedio    #  # location , format of access logfile (common logfile format).  # if not define access logfiles within <virtualhost>  # container, logged here.  contrariwise, if *do*  # define per-<virtualhost> access logfiles, transactions  # logged therein , *not* in file.  #  #customlog logs/access_log common    #  # if have separate agent , referer logfiles, uncomment  # following directives.  #  #customlog logs/referer_log referer  #customlog logs/agent_log agent    #  # single logfile access, agent, , referer information  # (combined logfile format), use following directive:  #  #customlog /var/log/httpd/example.com/access_log combined    #  # optionally add line containing server version , virtual host  # name server-generated pages (internal error documents, ftp directory  # listings, mod_status , mod_info output etc., not cgi generated  # documents or custom error documents).  # set "email" include mailto: link serveradmin.  # set 1 of:  on | off | email  #  serversignature on    #  # aliases: add here many aliases need (with no limit). format   # alias fakename realname  #  # note if include trailing / on fakename server  # require present in url.  "/icons" isn't aliased in  # example, "/icons/".  if fakename slash-terminated,   # realname must slash terminated, , if fakename omits   # trailing slash, realname must omit it.  #  # include /icons/ alias fancyindexed directory listings.  if  # not use fancyindexing, may comment out.  #  alias /icons/ "/var/www/icons/"    <directory "/var/www/icons">      options indexes multiviews followsymlinks      allowoverride none      order allow,deny      allow  </directory>    #  # webdav module configuration section.  #   <ifmodule mod_dav_fs.c>      # location of webdav lock database.      davlockdb /var/lib/dav/lockdb  </ifmodule>    #  # scriptalias: controls directories contain server scripts.  # scriptaliases same aliases, except  # documents in realname directory treated applications ,  # run server when requested rather documents sent client.  # same rules trailing "/" apply scriptalias directives  # alias.  #  scriptalias /cgi-bin/ "/var/www/cgi-bin/"    #  # "/var/www/cgi-bin" should changed whatever scriptaliased  # cgi directory exists, if have configured.  #  <directory "/var/www/cgi-bin">      allowoverride none      options none      order allow,deny      allow  </directory>    #  # redirect allows tell clients documents used exist in  # server's namespace, not anymore. allows tell  # clients relocated document.  # example:  # redirect permanent /foo http://www.example.com/bar    #  # directives controlling display of server-generated directory listings.  #    #  # indexoptions: controls appearance of server-generated directory  # listings.  #  indexoptions fancyindexing versionsort namewidth=* htmltable    #  # addicon* directives tell server icon show different  # files or filename extensions.  these displayed  # fancyindexed directories.  #  addiconbyencoding (cmp,/icons/compressed.gif) x-compress x-gzip    addiconbytype (txt,/icons/text.gif) text/*  addiconbytype (img,/icons/image2.gif) image/*  addiconbytype (snd,/icons/sound2.gif) audio/*  addiconbytype (vid,/icons/movie.gif) video/*    addicon /icons/binary.gif .bin .exe  addicon /icons/binhex.gif .hqx  addicon /icons/tar.gif .tar  addicon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv  addicon /icons/compressed.gif .z .z .tgz .gz .zip  addicon /icons/a.gif .ps .ai .eps  addicon /icons/layout.gif .html .shtml .htm .pdf  addicon /icons/text.gif .txt  addicon /icons/c.gif .c  addicon /icons/p.gif .pl .py  addicon /icons/f.gif .for  addicon /icons/dvi.gif .dvi  addicon /icons/uuencoded.gif .uu  addicon /icons/script.gif .conf .sh .shar .csh .ksh .tcl  addicon /icons/tex.gif .tex  addicon /icons/bomb.gif core    addicon /icons/back.gif ..  addicon /icons/hand.right.gif readme  addicon /icons/folder.gif ^^directory^^  addicon /icons/blank.gif ^^blankicon^^    #  # defaulticon icon show files not have icon  # explicitly set.  #  defaulticon /icons/unknown.gif    #  # adddescription allows place short description after file in  # server-generated indexes.  these displayed fancyindexed  # directories.  # format: adddescription "description" filename  #  #adddescription "gzip compressed document" .gz  #adddescription "tar archive" .tar  #adddescription "gzip compressed tar archive" .tgz    #  # readmename name of readme file server  # default, , append directory listings.  #  # headername name of file should prepended  # directory indexes.   readmename readme.html  headername header.html    #  # indexignore set of filenames directory indexing should ignore  # , not include in listing.  shell-style wildcarding permitted.  #  indexignore .??* *~ *# header* readme* rcs cvs *,v *,t    #  # defaultlanguage , addlanguage allows specify language of   # document. can use content negotiation give browser   # file in language user can understand.  #  # specify default language. means data  # going out without specific language tag (see below)   # marked one. not want set  # unless sure correct cases.  #  # * better not mark page   # * being language marking wrong  # * language!  #  # defaultlanguage nl  #  # note 1: suffix not have same language  # keyword --- documents in polish (whose net-standard  # language code pl) may wish use "addlanguage pl .po"  # avoid ambiguity common suffix perl scripts.  #  # note 2: example entries below illustrate in cases   # 2 character 'language' abbreviation not identical   # 2 character 'country' code country,  # e.g. 'danmark/dk' versus 'danish/da'.  #  # note 3: in case of 'ltz' violate rfc using 3 char  # specifier. there 'work in progress' fix ,  # reference data rfc1766 cleaned up.  #  # catalan (ca) - croatian (hr) - czech (cs) - danish (da) - dutch (nl)  # english (en) - esperanto (eo) - estonian (et) - french (fr) - german (de)  # greek-modern (el) - hebrew (he) - italian (it) - japanese (ja)  # korean (ko) - luxembourgeois* (ltz) - norwegian nynorsk (nn)  # norwegian (no) - polish (pl) - portugese (pt)  # brazilian portuguese (pt-br) - russian (ru) - swedish (sv)  # simplified chinese (zh-cn) - spanish (es) - traditional chinese (zh-tw)  #  addlanguage ca .ca  addlanguage cs .cz .cs  addlanguage da .dk  addlanguage de .de  addlanguage el .el  addlanguage en .en  addlanguage eo .eo  addlanguage es .es  addlanguage et .et  addlanguage fr .fr  addlanguage .he  addlanguage hr .hr  addlanguage .it  addlanguage ja .ja  addlanguage ko .ko  addlanguage ltz .ltz  addlanguage nl .nl  addlanguage nn .nn  addlanguage no .no  addlanguage pl .po  addlanguage pt .pt  addlanguage pt-br .pt-br  addlanguage ru .ru  addlanguage sv .sv  addlanguage zh-cn .zh-cn  addlanguage zh-tw .zh-tw    #  # languagepriority allows give precedence languages  # in case of tie during content negotiation.  #  # list languages in decreasing order of preference. have  # more or less alphabetized them here. want change this.  #  languagepriority en ca cs da de el eo es et fr hr ja ko ltz nl nn no pl pt pt-br ru sv zh-cn zh-tw    #  # forcelanguagepriority allows serve result page rather  # multiple choices (prefer) [in case of tie] or not acceptable (fallback)  # [in case no accepted languages matched available variants]  #  forcelanguagepriority prefer fallback    #  # specify default charset content served; enables  # interpretation of content utf-8 default.  use   # default browser choice (iso-8859-1), or allow meta tags  # in html content override choice, comment out  # directive:  #  adddefaultcharset utf-8    #  # addtype allows add or override mime configuration  # file mime.types specific file types.  #  #addtype application/x-tar .tgz    #  # addencoding allows have browsers uncompress  # information on fly. note: not browsers support this.  # despite name similarity, following add* directives have nothing  # fancyindexing customization directives above.  #  #addencoding x-compress .z  #addencoding x-gzip .gz .tgz    # if addencoding directives above commented-out,  # should define extensions indicate media types:  #  addtype application/x-compress .z  addtype application/x-gzip .gz .tgz    #  # addhandler allows map file extensions "handlers":  # actions unrelated filetype. these can either built server  # or added action directive (see below)  #  # use cgi scripts outside of scriptaliased directories:  # (you need add "execcgi" "options" directive.)  #  #addhandler cgi-script .cgi    #  # files include own http headers:  #  #addhandler send-as-is asis    #  # type maps (negotiated resources):  # (this enabled default allow apache "it worked" page  #  distributed in multiple languages.)  #  addhandler type-map var    #  # filters allow process content before sent client.  #  # parse .shtml files server-side includes (ssi):  # (you need add "includes" "options" directive.)  #  addtype text/html .shtml  addoutputfilter includes .shtml    #  # action lets define media types execute script whenever  # matching file called. eliminates need repeated url  # pathnames oft-used cgi file processors.  # format: action media/type /cgi-script/location  # format: action handler-name /cgi-script/location  #    #  # customizable error responses come in 3 flavors:  # 1) plain text 2) local redirects 3) external redirects  #  # examples:  #errordocument 500 "the server made boo boo."  #errordocument 404 /missing.html  #errordocument 404 "/cgi-bin/missing_handler.pl"  #errordocument 402 http://www.example.com/subscription_info.html  #    #  # putting together, can internationalize error responses.  #  # use alias redirect /error/http_<error>.html.var response  # our collection of by-error message multi-language collections.  use   # includes substitute appropriate text.  #  # can modify messages' appearance without changing of  # default http_<error>.html.var files adding line:  #  #   alias /error/include/ "/your/include/path/"  #  # allows create own set of files starting  # /var/www/error/include/ files ,  # copying them /your/include/path/, on per-virtualhost basis.  #    alias /error/ "/var/www/error/"    <ifmodule mod_negotiation.c>  <ifmodule mod_include.c>      <directory "/var/www/error">          allowoverride none          options includesnoexec          addoutputfilter includes html          addhandler type-map var          order allow,deny          allow          languagepriority en es de fr          forcelanguagepriority prefer fallback      </directory>    #    errordocument 400 /error/http_bad_request.html.var  #    errordocument 401 /error/http_unauthorized.html.var  #    errordocument 403 /error/http_forbidden.html.var  #    errordocument 404 /error/http_not_found.html.var  #    errordocument 405 /error/http_method_not_allowed.html.var  #    errordocument 408 /error/http_request_time_out.html.var  #    errordocument 410 /error/http_gone.html.var  #    errordocument 411 /error/http_length_required.html.var  #    errordocument 412 /error/http_precondition_failed.html.var  #    errordocument 413 /error/http_request_entity_too_large.html.var  #    errordocument 414 /error/http_request_uri_too_large.html.var  #    errordocument 415 /error/http_unsupported_media_type.html.var  #    errordocument 500 /error/http_internal_server_error.html.var  #    errordocument 501 /error/http_not_implemented.html.var  #    errordocument 502 /error/http_bad_gateway.html.var  #    errordocument 503 /error/http_service_unavailable.html.var  #    errordocument 506 /error/http_variant_also_varies.html.var    </ifmodule>  </ifmodule>    #  # following directives modify normal http response behavior  # handle known problems browser implementations.  #  browsermatch "mozilla/2" nokeepalive  browsermatch "msie 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0  browsermatch "realplayer 4\.0" force-response-1.0  browsermatch "java/1\.0" force-response-1.0  browsermatch "jdk/1\.0" force-response-1.0    #  # following directive disables redirects on non-get requests  # directory not include trailing slash.  fixes   # problem microsoft webfolders not appropriately handle   # redirects folders dav methods.  # same deal apple's dav filesystem , gnome vfs support dav.  #  browsermatch "microsoft data access internet publishing provider" redirect-carefully  browsermatch "ms frontpage" redirect-carefully  browsermatch "^webdrive" redirect-carefully  browsermatch "^webdavfs/1.[0123]" redirect-carefully  browsermatch "^gnome-vfs/1.0" redirect-carefully  browsermatch "^xml spy" redirect-carefully  browsermatch "^dreamweaver-webdav-scm1" redirect-carefully    #  # allow server status reports generated mod_status,  # url of http://servername/server-status  # change ".example.com" match domain enable.  #  #<location /server-status>  #    sethandler server-status  #    order deny,allow  #    deny  #    allow .example.com  #</location>    #  # allow remote server configuration reports, url of  #  http://servername/server-info (requires mod_info.c loaded).  # change ".example.com" match domain enable.  #  #<location /server-info>  #    sethandler server-info  #    order deny,allow  #    deny  #    allow .example.com  #</location>    #  # proxy server directives. uncomment following lines  # enable proxy server:  #  #<ifmodule mod_proxy.c>  #proxyrequests on  #  #<proxy *>  #    order deny,allow  #    deny  #    allow .example.com  #</proxy>    #  # enable/disable handling of http/1.1 "via:" headers.  # ("full" adds server version; "block" removes outgoing via: headers)  # set 1 of: off | on | full | block  #  #proxyvia on    #  # enable cache of proxied content, uncomment following lines.  # see http://httpd.apache.org/docs/2.2/mod/mod_cache.html more details.  #  #<ifmodule mod_disk_cache.c>  #   cacheenable disk /  #   cacheroot "/var/cache/mod_proxy"  #</ifmodule>  #    #</ifmodule>  # end of proxy directives.    ### section 3: virtual hosts  #  # virtualhost: if want maintain multiple domains/hostnames on  # machine can setup virtualhost containers them. configurations  # use name-based virtual hosts server doesn't need worry  # ip addresses. indicated asterisks in directives below.  #  # please see documentation @   # <url:http://httpd.apache.org/docs/2.2/vhosts/>  # further details before try setup virtual hosts.  #  # may use command line option '-s' verify virtual host  # configuration.    #  # use name-based virtual hosting.  #  #namevirtualhost *:80  #  # note: namevirtualhost cannot used without port specifier   # (e.g. :80) if mod_ssl being used, due nature of  # ssl protocol.  #    #  # virtualhost example:  # apache directive may go virtualhost container.  # first virtualhost section used requests without known  # server name.  #  #<virtualhost *:80>  #    serveradmin webmaster@dummy-host.example.com  #    documentroot /www/docs/dummy-host.example.com  #    servername dummy-host.example.com  #    errorlog logs/dummy-host.example.com-error_log  #    customlog logs/dummy-host.example.com-access_log common  #</virtualhost>
/etc/apache2/sites-enabled/mysite:

code:
<virtualhost *:80>          servername www.example.com          serveralias example.com *.example.com    	serveradmin webmaster@localhost    	documentroot /var/www  	<directory />  		options followsymlinks  		allowoverride none  	</directory>  	<directory /var/www/>  		options indexes followsymlinks multiviews  		allowoverride none  		order allow,deny  		allow  	</directory>    	scriptalias /cgi-bin/ /usr/lib/cgi-bin/  	<directory "/usr/lib/cgi-bin">  		allowoverride none  		options +execcgi -multiviews +symlinksifownermatch  		order allow,deny  		allow  	</directory>    	errorlog ${apache_log_dir}/error.log    	# possible values include: debug, info, notice, warn, error, crit,  	# alert, emerg.  	loglevel debug    	customlog ${apache_log_dir}/access.log combined        alias /doc/ "/usr/share/doc/"      <directory "/usr/share/doc/">          options indexes multiviews followsymlinks          allowoverride none          order deny,allow          deny          allow 127.0.0.0/255.0.0.0 ::1/128      </directory>    </virtualhost>

i resolved this. turns out colleague had applied overlapping errorlog settings in /etc/apache2/mysite.conf. unfortunately, prefixed path '/etc/apache2' wasn't part of being set in mysite.conf grep didn't detect relevant settings in file.


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [SOLVED] Apache: restart results in "can't open log file" error


Ubuntu

Comments

Popular posts from this blog

Thread: Can not create raid array: mdadm: no raid-devices specified.

Thread: HOW TO: Package and theme GTK+ / Gtkmm apps in Linux for Windows

Thread: Twinview issues