MAMP Pro: Generate Separate Apache Virtual Host Access Logs (Per Host Logs)
Posted: Wed Jan 20, 2021 3:38 am
In order to create separate Apache access log or error log files per virtual host, you need to create a MAMP Virtual Host Iteration per HTTPD conf file. Follow the steps below.
Create Separate Apache Access Log for MAMP [HTTP] Hosts
1. Go to MAMP Pro -> Edit Template -> Apache-> httpd.conf.
2. In your httpd.conf configuration file, find the line with MAMP_VirtualHost_iteration_begin_MAMP.
3. Now, add a configuration directive for your access log file under the MAMP_VirtualHost_iteration_begin_MAMP. You must name your log file MAMP_VirtualHost_ServerName_MAMP.log In the example below, we use the following CustomLog directive.
4. Save and restart Apache.
Create Separate Apache Access Log for MAMP [HTTPS] Hosts
1. Go to MAMP Pro -> Edit Template -> Apache -> httpd-ssl.conf.
2. In your httpd-ssl.conf configuration file, find the line with MAMP_SSLVirtualHost_iteration_begin_MAMP.
3. Now, add a configuration directive for your access log file under the MAMP_SSLVirtualHost_iteration_begin_MAMP. You must name your log file MAMP_SSLVirtualHost_ServerName_MAMP.log In the example below, we use the following CustomLog directive.
4. Save and restart Apache.
Create Separate Apache Access Log for MAMP [HTTP] Hosts
1. Go to MAMP Pro -> Edit Template -> Apache-> httpd.conf.
2. In your httpd.conf configuration file, find the line with MAMP_VirtualHost_iteration_begin_MAMP.
3. Now, add a configuration directive for your access log file under the MAMP_VirtualHost_iteration_begin_MAMP. You must name your log file MAMP_VirtualHost_ServerName_MAMP.log In the example below, we use the following CustomLog directive.
Code: Select all
CustomLog "/Applications/MAMP/logs/MAMP_VirtualHost_ServerName_MAMP.log" "%t %v %h %l %u \"%r\" %>s %b \"%{User-Agent}i\""
4. Save and restart Apache.
Create Separate Apache Access Log for MAMP [HTTPS] Hosts
1. Go to MAMP Pro -> Edit Template -> Apache -> httpd-ssl.conf.
2. In your httpd-ssl.conf configuration file, find the line with MAMP_SSLVirtualHost_iteration_begin_MAMP.
3. Now, add a configuration directive for your access log file under the MAMP_SSLVirtualHost_iteration_begin_MAMP. You must name your log file MAMP_SSLVirtualHost_ServerName_MAMP.log In the example below, we use the following CustomLog directive.
Code: Select all
CustomLog "/Applications/MAMP/logs/MAMP_SSLVirtualHost_ServerName_MAMP.log" "%t %v %h %l %u \"%r\" %>s %b \"%{User-Agent}i\""