Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Assuming your apache server is running and you have shell access:</p> <p>do this: </p> <pre><code>genja ~ # ps aux |grep apache|tail -n1 root 23605 0.0 0.2 248636 10684 ? Ss Jun08 0:06 /usr/sbin/apache2 -D DEFAULT_VHOST -D INFO -D LANGUAGE -D MANUAL -D SSL -D SSL_DEFAULT_VHOST -D PHP5 -D PERL -D PROXY -D SCGI -d /usr/lib64/apache2 -f /etc/apache2/httpd.conf -k start </code></pre> <p>.. that is an apache daemon process. You are looking for "-f /etc/apache2/http.conf". If your apache server was not told (by the distro init scripts) where to get the config file it will look in the default location which could be under: <b>/etc/apache2/</b> or <b>/etc/httpd/</b> (or anywhere else, really, but those two are most common). In that folder you will find a file called <b>apache2.conf</b> or <b>httpd.conf</b><br>just try this: </p> <pre><code>find /etc/ -iname httpd.conf -o -iname apache2.conf </code></pre> <p>Once you have located the configuration file for the apache server, look for the line where they include the modules configurations. On my system it looks like this:</p> <pre><code>Include /etc/apache2/modules.d/*.conf </code></pre> <p>Now you need to figure out where the log file is: </p> <pre><code>genja modules.d # grep CustomLog /etc/apache2/modules.d/* 00_mod_log_config.conf:# a CustomLog directive (see below). 00_mod_log_config.conf:CustomLog /var/log/apache2/access_log common 00_mod_log_config.conf:#CustomLog /var/log/apache2/referer_log referer 00_mod_log_config.conf:#CustomLog /var/log/apache2/agent_logs agent 00_mod_log_config.conf:#CustomLog /var/log/apache2/access_log combined </code></pre> <p>you are looking for: CustomLog /var/log/apache2/access_log common.<br> Note that this CustomLog directive could be in the main apache2.conf file too.<br> Now you have the location of the log file. The most likely thing to be stopping your server from logging now is file permissions. Make sure the directory given under CustomLog exists and that the apache server can write to it:</p> <p>as root:</p> <pre><code>mkdir -p /var/log/apache2 touch /var/log/apache2/access_log chown -R APACHEUSER /var/log/apache2 chmod 755 /var/log/apache2 chmod 644 /var/apache2/access_log </code></pre> <p>where APACHEUSER is likely to be apache or www or even httpd. You can figure that out by running: </p> <pre><code>genja ~ # ps aux |grep apache |awk '{print $1}' apache (...) apache root </code></pre> <p>So the user running the apache server on my system is actually called apache. It is not root. Or at least should not be. </p> <p>restart your server after changing the permission of that file. I dont know how your distro does it. There is a service[s] command on ubuntu I think. But you can always run the init script directly: </p> <p>/etc/init.d/apache restart (ir may be under a different location on your distro) just reboot the whole computer if you cant figure out how to restart the apache server. </p> <p>If the access_log file is empty after you restarted the server change APACHEUSER to root in the above command. </p> <p>after all this just use your favourite pager or text editor to look at the log. Or even tail -f to monitor it in real time. I hope this helps. gl. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload