1. open the file:/etc/httpd/conf/httd. conf. 2. Find "CustomLog" in the file and find the following configuration block: Check that the currently used LogFormat is "combined" (if other log formats are enabled, replace the corresponding format definition ).
#
# For a single logfile with access, agent, and referer information
# (Combined Logfile Format), use the following directive:
#
CustomLog logs/access_log combined3. Search for "LogFormat" in the file and find the following configuration block (defined in combined format ): logFormat "% h % l % u % t \" % r \ "%> s % B \" % {Referer} I \ "\" % {User-Agent} I \ "" combined: logFormat "% h % l % u % t \" % r \ "%> s % B \" % {Referer} I \ "\" % {User-Agent} I \ "\" % {X-Forwarded-For} I \ "" combined 4. Save and close the file/etc/httpd/conf/httd. conf. 5. Restart the Apache service. Note that the variables in braces in the third article must correspond to the server. If you do not know, you can get the variables in phpinfo or similar information!