Why aren't my Windows Apache log messages being written to the ErrorLog location specified in my VirtualHost? - windows

I'm attempting to override the ErrorLog location in my httpd.conf file by specifying it in my .vhost, but it's creating the file only and still writing to the .conf one.
I have the following in my httpd.conf file:
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog "logs/error.log"
# Virtual hosts
Include conf/vhosts/xyz_apache.vhost
Then I have this in my xyz_apache.vhost file (on one line):
ErrorLog "C:/Program Files (x86)/Apache Software Foundation/
Apache2.2/logs/xyzerrors.log"
If I start up apache and look in my logs directory to see what was created, I see a blank xyzerrors.log and an error.log file with startup messages in it ("Starting thread to listen on port 80, etc.).
Any idea why this might be happening, or advice as to how I can fix it? The xyzerrors.log file was clearly created, so it seems my file paths and spelling of "ErrorLog" and my vhost configuration and all the obvious parts should be correct. But it's writing to the file specified in my httpd.conf, which, if I understand correctly, should only be the backup location, should there not be one specified in the .vhost. I wondered if permissions might be an issue somehow (maybe it didn't have write access to the xyzerror.log it created so it wrote to error.log instead?), but both files are in the same directory. Is there another configuration piece I missed?
I verified what was happening by renaming the .conf ErrorLog and deleting the .vhost ErrorLog, and again saw the .vhost log created and the .conf log created and written to. I have similar setups running in Linux with no problems.
Update: Here's another piece. I was fixing an issue with lxml (I got an error, installed a newer version of it, then restarted apache), and noticed that a couple of messages appeared in my xyzerror.log. Here's what it looks like:
error.log
[Wed Oct 09 09:14:52 2013] [notice] Child 42900: Starting thread to listen on port 80.
[Wed Oct 09 09:48:11 2013] [error] ERROR:django.request:Internal Server Error: /admin/
[Wed Oct 09 09:48:11 2013] [error] Traceback (most recent call last):
[Wed Oct 09 09:48:11 2013] [error] ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed. (Rest of traceback omitted)
[Wed Oct 09 09:54:50 2013] [notice] Parent: Received shutdown signal -- Shutting down the server.
Apache server interrupted...
Apache server interrupted...
Apache server interrupted...
Apache server interrupted...
Apache server interrupted...
Released the start mutex
[Wed Oct 09 09:54:52 2013] [notice] Child 42900: All worker threads have exited.
[Wed Oct 09 09:54:52 2013] [notice] Child 42900: Child process is exiting
[Wed Oct 09 09:54:52 2013] [notice] Parent: Child process exited successfully.
[Wed Oct 09 09:54:53 2013] [warn] mod_wsgi: Compiled for Python/2.7.
[Wed Oct 09 09:54:53 2013] [warn] mod_wsgi: Runtime using Python/2.7.2.
[Wed Oct 09 09:54:53 2013] [notice] Apache/2.2.22 (Win32) mod_wsgi/3.3 Python/2.7.2 configured -- resuming normal operations
[Wed Oct 09 09:54:53 2013] [notice] Server built: Jan 28 2012 11:16:39
[Wed Oct 09 09:54:53 2013] [notice] Parent: Created child process 40284
[Wed Oct 09 09:54:53 2013] [warn] mod_wsgi: Compiled for Python/2.7.
[Wed Oct 09 09:54:53 2013] [warn] mod_wsgi: Runtime using Python/2.7.2.
[Wed Oct 09 09:54:53 2013] [notice] Child 40284: Child process is running
[Wed Oct 09 09:54:53 2013] [notice] Child 40284: Acquired the start mutex.
[Wed Oct 09 09:54:53 2013] [notice] Child 40284: Starting 64 worker threads.
[Wed Oct 09 09:54:53 2013] [notice] Child 40284: Starting thread to listen on port 80.
xyzerror.log
[Wed Oct 09 09:47:54 2013] [info] [client 127.0.0.1] mod_wsgi (pid=42900, process='', application='XYZ.sysname.mydomain.local|'): Loading WSGI script 'C:/Users/etc/etc/XYZ_wsgi.py'.
[Wed Oct 09 09:48:11 2013] [error] [client 127.0.0.1] client denied by server configuration: C:/Users/etc/etc/site_media
So maybe these aren't ErrorLog messages and I need to investigate my CustomLog settings? I'm seeing similar behavior with those (an xyzaccess.log file is being written but my access.log in my .conf is being written to), but I didn't include it here for simplicity.
Update 2:
If I continue to browse my site and watch the log files, I see that logs are eventually getting written to the xyzerror.log (and the xyzaccess.log) in my vhost location. Only the initial startup messages ("listening on port..", etc.) and one site-related error were in the conf location.
Can anyone explain or suggest a solution?
Apache 2.2/Windows 7/Django 1.5/Python 2.7

if I understand correctly, should only be the backup location, should there not be one specified in the .vhost
Not at all !
This is normal behaviour, because the ErrorLog directive can either apply globally, or to the VirtualHost it is declared in.
Think about it. When an error is reported to the error log for apache internal events, such as startup events or module loading failure, how can it use a specific virtual host's error log, since virtual host resolution is not even possible yet ?
Apache knows which Virtual Host to use only when a client makes a request and the request is identified to refer to a specific virtual host, either via IP resolution or Hostname resolution.
Therefore, only those errors will appear in your vhost-specific error log, such as PHP errors pertaining to that vhost, or HTTP errors such as 401 or 404 codes.

Related

xampp apache is not starting after php update from 7.2 to 7.4

I tried to update PHP7.2 to PHP7.4 for my XAMPP Apache on Windows 10. Now Apache is not starting.
The log error is:
[Fri Jul 23 10:47:04.645093 2021] [mpm_winnt:notice] [pid 15604:tid 764] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Fri Jul 23 10:47:07.981978 2021] [mpm_winnt:notice] [pid 5588:tid 704] AH00364: Child: All worker threads have exited.
[Fri Jul 23 10:47:10.535573 2021] [mpm_winnt:notice] [pid 15604:tid 764] AH00430: Parent: Child process 5588 exited successfully.
The error message from apache is:
10:47:39 AM [Apache] Error: Apache shutdown unexpectedly.
10:47:39 AM [Apache] This may be due to a blocked port, missing dependencies,
10:47:39 AM [Apache] improper privileges, a crash, or a shutdown by another method.
10:47:39 AM [Apache] Press the Logs button to view error logs and check
10:47:39 AM [Apache] the Windows Event Viewer for more clues
10:47:39 AM [Apache] If you need more help, copy and post this
10:47:39 AM [Apache] entire log window on the forums
I followed this tutorial:
https://medium.com/oceanize-geeks/how-to-upgrade-lower-version-to-latest-php-version-in-xampp-on-windows-f7be9a70bbb0
PHP configuration
# # PHP-Module setup
#
LoadFile "C:/xampp/php/php7ts.dll"
LoadFile "C:/xampp/php/libpq.dll"
LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"
<IfModule php7_module>
PHPINIDir "C:/xampp/php"
</IfModule>

xampp control new install

Everytime I install XAMPP on my new laptop I get this popup when closing:
enter error when i close xampp control panel
and this in the error log and I have no clue why
AH00558: httpd.exe: Could not reliably determine the server's fully qualified domain name, using fe80::798c:c498:a91e:b3f0. Set the 'ServerName' directive globally to suppress this message
[Fri May 29 22:49:30.682665 2020] [core:warn] [pid 9748:tid 836] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Fri May 29 22:49:30.694634 2020] [ssl:warn] [pid 9748:tid 836] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
PHP Warning: 'vcruntime140.dll' 14.0 is not compatible with this PHP build linked with 14.16 in Unknown on line 0
[Fri May 29 22:49:30.696594 2020] [:emerg] [pid 9748:tid 836] AH00020: Configuration Failed, exiting```

Local environment, User Level Root setup

I'm setting up this OSX Mavericks following this guide but I cannot get http://localhost/~giulio to work ('giulio' is this mac username).
Looks like it doesn't find the /users/giulio.conf
This is what's inside the /private/var/log/apache2/error_log
[Thu Feb 27 13:54:41 2014] [notice] caught SIGTERM, shutting down
[Thu Feb 27 13:54:48 2014] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
httpd: Could not reliably determine the server's fully qualified domain name, using iMac-di-Giulio.local for ServerName
[Thu Feb 27 13:54:48 2014] [notice] Digest: generating secret for digest authentication ...
[Thu Feb 27 13:54:48 2014] [notice] Digest: done
[Thu Feb 27 13:54:48 2014] [notice] Apache/2.2.24 (Unix) DAV/2 PHP/5.4.17 mod_ssl/2.2.24 OpenSSL/0.9.8y configured -- resuming normal operations
[Thu Feb 27 13:54:55 2014] [error] [client ::1] File does not exist: /Library/WebServer/Documents/index-maintenance.html
Solved redoing the whole process and adding Servername Localhost
and adding the follwing code into giulio.conf file into users folder.
<Directory "/Users/giulio/Sites/">
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>

Joomla 2.5 : Error 500 : Internal Server Error

I have website already and wanted to do many changes in website. So I took the akeeba backup and created site locally.
When I created website, I got error as Internal Server Error. To solve that error I removed whatever was there in .htaccess file. Now website is working locally, however administrator is not working.
I followed the answer of same question, however it is not working.
Can anyone point, where I am going wrong? I need this to be done anyhow.
Edit 1
Below is what I have in apache_error.log
[Thu Nov 29 10:22:34 2012] [notice] Digest: generating secret for digest authentication ...
[Thu Nov 29 10:22:34 2012] [notice] Digest: done
[Thu Nov 29 10:22:34 2012] [notice] Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r DAV/2 PHP/5.3.6 configured -- resuming normal operations
[Thu Nov 29 10:23:29 2012] [error] [client ::1] (2)No such file or directory: Could not open password file: /home5/smartkwc/public_html/administrator/.htpasswd
[Thu Nov 29 11:02:33 2012] [error] [client ::1] (2)No such file or directory: Could not open password file: /home5/smartkwc/public_html/administrator/.htpasswd
[Thu Nov 29 11:03:28 2012] [error] [client ::1] (2)No such file or directory: Could not open password file: /home5/smartkwc/public_html/administrator/.htpasswd
I solved the problem!!!
Earlier I had removed content of .htaccess from root folder only. Now when I removed everything from .htaccess from administrator folder, all is working perfectly. :) :) :)
Yipeee!!!

Can't connect to a local apache installation under XAMPP on Win XP 64-bit. Help!

I'm using XAMPP v1.7 on an Win XP-64 bit machine, my Symantec AV is turned off as is my Windows Firewall, and I can't connect to localhost from a browser.
I originally had these errors:
[Wed Jan 07 16:24:55 2009] [error] (OS 10038)An operation was attempted on something that is not a socket. : Child 2716: Encountered too many errors accepting client connections. Possible causes: dynamic address renewal, or incompatible VPN or firewall software. Try using the Win32DisableAcceptEx directive
These errors went away after I added the Win32DisableAcceptEx directive to httpd.conf, but the net result remains the same: no joy.
Now, I get these errors:
[Wed Jan 07 16:40:15 2009] [notice] Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i mod_autoindex_color PHP/5.2.8 configured -- resuming normal operations
[Wed Jan 07 16:40:15 2009] [notice] Server built: Dec 10 2008 00:10:06
[Wed Jan 07 16:40:15 2009] [notice] Parent: Created child process 5916
[Wed Jan 07 16:40:15 2009] [notice] Disabled use of AcceptEx() WinSock2 API
[Wed Jan 07 16:40:15 2009] [notice] Digest: generating secret for digest authentication ...
[Wed Jan 07 16:40:15 2009] [notice] Digest: done
[Wed Jan 07 16:40:15 2009] [notice] Child 5916: Child process is running
[Wed Jan 07 16:40:15 2009] [notice] Child 5916: Acquired the start mutex.
[Wed Jan 07 16:40:15 2009] [notice] Child 5916: Starting 250 worker threads.
[Wed Jan 07 16:40:15 2009] [notice] Child 5916: Listening on port 443.
[Wed Jan 07 16:40:15 2009] [notice] Child 5916: Listening on port 80.
[Wed Jan 07 16:40:15 2009] [error] (OS 10038)An operation was attempted on something that is not a socket. : Too many errors in select loop. Child process exiting.
[Wed Jan 07 16:40:15 2009] [notice] Child 5916: Exit event signaled. Child process is ending.
[Wed Jan 07 16:40:16 2009] [notice] Child 5916: Released the start mutex
[Wed Jan 07 16:40:17 2009] [notice] Child 5916: All worker threads have exited.
[Wed Jan 07 16:40:17 2009] [notice] Child 5916: Child process is exiting
[Wed Jan 07 16:40:17 2009] [notice] Parent: child process exited with status 0 -- Restarting.
[Wed Jan 07 16:40:17 2009] [notice] Digest: generating secret for digest authentication ...
[Wed Jan 07 16:40:17 2009] [notice] Digest: done
And, apache seems to be crashing (Windows tells me so, and I can see the crash in the system events.)
I'm a n00b to apache, but need to get this running. Ideas?
Marcus
If anyone comes across this, try running
netsh winsock RESET
from the command line. It worked for me.

Resources