The specific steps are as follows:
(Related recommendations: apache tutorial)
Find the apache configuration file
netstat -nap | grep 80 # 找到对应端口进程 31114 tcp6 0 0 :::4430 :::* LISTEN 31114/httpd ps auxf | grep 31114 # 找到对应apache的进程命令中的配置文件*.conf的路径,到指定路径修改配置文件,例如 vim httpd.conf
Modify the VirtualHost under the specified port
<VirtualHost 80> ....... CustomLog "/var/prof.log" "[%a]%{%F %T}t id=%{APIIndex}i time=%D(us) url=%U%q" </VirtualHost> 指令: CustomLog "/var/prof.log" "[%a]%{%F %T}t id=%{APIIndex}i time=%D(us) url=%U%q"
%D - Official explanation: Time taken to process the request, in millis, the time taken to process the request, in microseconds
%T - Official Explanation: Time taken to process the request, in seconds, time taken to process the request, in seconds
%{ms}T - Official explanation: Time taken to commit the response, in millis, time taken to submit the response, in milliseconds Restart apache after modifying the unit
, and observe the log output data as follows:
[200.200.222.95]2019-03-04 15:39:32 id=- time=100107(us) url=/apps/secvisual/home/home/on_dev_manage [200.200.222.95]2019-03-04 15:39:38 id=- time=106476(us) url=/apps/secvisual/home/home/on_dev_manage [200.200.222.95]2019-03-04 15:39:43 id=- time=101263(us) url=/apps/secvisual/home/home/on_dev_manage [200.200.222.95]2019-03-04 15:39:48 id=- time=101333(us) url=/apps/secvisual/home/home/on_dev_manage
The above is the detailed content of How to implement apache to record request response time log. For more information, please follow other related articles on the PHP Chinese website!

When the Apache 80 port is occupied, the solution is as follows: find out the process that occupies the port and close it. Check the firewall settings to make sure Apache is not blocked. If the above method does not work, please reconfigure Apache to use a different port. Restart the Apache service.

Apache cannot start because the following reasons may be: Configuration file syntax error. Conflict with other application ports. Permissions issue. Out of memory. Process deadlock. Daemon failure. SELinux permissions issues. Firewall problem. Software conflict.

To set up a CGI directory in Apache, you need to perform the following steps: Create a CGI directory such as "cgi-bin", and grant Apache write permissions. Add the "ScriptAlias" directive block in the Apache configuration file to map the CGI directory to the "/cgi-bin" URL. Restart Apache.

There are 3 ways to view the version on the Apache server: via the command line (apachectl -v or apache2ctl -v), check the server status page (http://<server IP or domain name>/server-status), or view the Apache configuration file (ServerVersion: Apache/<version number>).

To restart the Apache server, follow these steps: Linux/macOS: Run sudo systemctl restart apache2. Windows: Run net stop Apache2.4 and then net start Apache2.4. Run netstat -a | findstr 80 to check the server status.

To delete an extra ServerName directive from Apache, you can take the following steps: Identify and delete the extra ServerName directive. Restart Apache to make the changes take effect. Check the configuration file to verify changes. Test the server to make sure the problem is resolved.

The steps to start Apache are as follows: Install Apache (command: sudo apt-get install apache2 or download it from the official website) Start Apache (Linux: sudo systemctl start apache2; Windows: Right-click the "Apache2.4" service and select "Start") Check whether it has been started (Linux: sudo systemctl status apache2; Windows: Check the status of the "Apache2.4" service in the service manager) Enable boot automatically (optional, Linux: sudo systemctl

Apache connects to a database requires the following steps: Install the database driver. Configure the web.xml file to create a connection pool. Create a JDBC data source and specify the connection settings. Use the JDBC API to access the database from Java code, including getting connections, creating statements, binding parameters, executing queries or updates, and processing results.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 Chinese version
Chinese version, very easy to use

WebStorm Mac version
Useful JavaScript development tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft