Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by duncanb7
at 2024-06-30 06:46:53
Point:500 Replies:10 POST_ID:828583USER_ID:11059
Topic:
PHP Scripting Language;Linux;Apache Web Server
Just want to know how web counter or awstats program ability to check all
visiting site information.
From netstat -nputw command on Linux I know , we can check who is visting to my website.
The result of the command will show you foreign or Local address and Protocol something
like that, but why it won't show which file is being visited by the visitors ?
for example for my wish, at least show me the visitor is visiting www.mysite.com/data/php/math.html file
From the local address is just IP address of my site and Port 80 only, no information about which or what html or php file is being visited, Why ?
Please advise, any Linux command can check that for me , what is exact path and the file that visitor is or was visiting ?
And I check at /var/log/httpd/access_log , there is nothing inside of the file,Why ?
I believe my linux system will record that information for user, but where if any ?
Thanks
Duncan
visiting site information.
From netstat -nputw command on Linux I know , we can check who is visting to my website.
The result of the command will show you foreign or Local address and Protocol something
like that, but why it won't show which file is being visited by the visitors ?
for example for my wish, at least show me the visitor is visiting www.mysite.com/data/php/math.html file
From the local address is just IP address of my site and Port 80 only, no information about which or what html or php file is being visited, Why ?
Please advise, any Linux command can check that for me , what is exact path and the file that visitor is or was visiting ?
And I check at /var/log/httpd/access_log , there is nothing inside of the file,Why ?
I believe my linux system will record that information for user, but where if any ?
Thanks
Duncan
Author: duncanb7 replied at 2024-07-09 00:40:32
The final access log is found at /usr/local/apache/domlogs/mydomain.com and at
/usr/local/apache/logs/access_logs.
after reading those two files, the first one, mydomain.com file is exactly record who
is accessing my domain website.
Why the second file of access_logs is just reporting like this as follows
127.0.0.1 ---[9/July/2013:222:05:01+3000] "Get /whm-server-status HTTP/1.0" 200 3984
....
....
ANd I could not find who is accessing my website information on second file.
Anyway, now at least I could find who is accessing my website on first file of mydomain.com
Please advise and thanks for your final soltuon
Duncan
/usr/local/apache/logs/access_logs.
after reading those two files, the first one, mydomain.com file is exactly record who
is accessing my domain website.
Why the second file of access_logs is just reporting like this as follows
127.0.0.1 ---[9/July/2013:222:05:01+3000] "Get /whm-server-status HTTP/1.0" 200 3984
....
....
ANd I could not find who is accessing my website information on second file.
Anyway, now at least I could find who is accessing my website on first file of mydomain.com
Please advise and thanks for your final soltuon
Duncan
Accepted Solution
Expert: hielo replied at 2024-07-01 07:46:48
500 points EXCELLENT
>>SO I log into my root SSH shell and go to /var/log/httpd/access_log
You need to look at your apache configuration for the CustomLog setting.
FYI:
If the site in question is a virtual host, first check to see if the virtual host definition defines a different CustomLog location from that of the main server CustomLog location.
You need to look at your apache configuration for the CustomLog setting.
FYI:
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
# with ServerRoot set to "/usr/local/apache" will be interpreted by the
# server as "/usr/local/apache/logs/foo.log".
#
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
# with ServerRoot set to "/usr/local/apache" will be interpreted by the
# server as "/usr/local/apache/logs/foo.log".
#
If the site in question is a virtual host, first check to see if the virtual host definition defines a different CustomLog location from that of the main server CustomLog location.
Author: duncanb7 replied at 2024-07-01 06:32:52
Be reminded Now I do not allow to use Cpanel on VPS server since I nerver pay it on VPS server
Author: duncanb7 replied at 2024-07-01 06:31:45
Dear
I am using hosting company VSP server, normally I am using Cpanel and awstat to
keep track of the visitor access to my visit.Now I gave up to use it since I need to pay
for using Cpanel . Now I want to know how to
do php programming or other linux command to perform the same function of aswtat or
web counter .
I tried to tcpdump on my SSH shell it works finally and it will report out
the visitor IP and full path of the access file.
As I remember there should be one place to store all coming internet traffic to my website. SO I log into my root SSH shell and go to /var/log/httpd/access_log but
there is no any file. Do you know where is the access-log file for internet traffic on Linux ?
OR what other way to do the same as I just mentioned
thanks
DUncan
I am using hosting company VSP server, normally I am using Cpanel and awstat to
keep track of the visitor access to my visit.Now I gave up to use it since I need to pay
for using Cpanel . Now I want to know how to
do php programming or other linux command to perform the same function of aswtat or
web counter .
I tried to tcpdump on my SSH shell it works finally and it will report out
the visitor IP and full path of the access file.
As I remember there should be one place to store all coming internet traffic to my website. SO I log into my root SSH shell and go to /var/log/httpd/access_log but
there is no any file. Do you know where is the access-log file for internet traffic on Linux ?
OR what other way to do the same as I just mentioned
thanks
DUncan
Expert: julianH replied at 2024-07-01 01:06:52
To answer I need to know what it is you are trying to achieve.
From your original post it sounds like you want to see when a page is being accessed. What is not clear is how you want to use this information.
Do you need to know when the page is being accessed in real time - as it is being accessed or are you only interested from a statistics perspective.
It would also be helpful to know a little bit more about your website and how it is constructed - pure HTML / php / ASPX etc
You mentioned you looked in the access logs and found nothing - this is strange because you should see logs of all requests to your site.
Are you self hosting? Is your server setup your responsibility or are you using an ISP?
From your original post it sounds like you want to see when a page is being accessed. What is not clear is how you want to use this information.
Do you need to know when the page is being accessed in real time - as it is being accessed or are you only interested from a statistics perspective.
It would also be helpful to know a little bit more about your website and how it is constructed - pure HTML / php / ASPX etc
You mentioned you looked in the access logs and found nothing - this is strange because you should see logs of all requests to your site.
Are you self hosting? Is your server setup your responsibility or are you using an ISP?
Author: duncanb7 replied at 2024-07-01 00:43:57
Dear JulianH,
you are right $_SERVER is not working, what is your other suggestion to solve my asking
besides using tcpdump
you are right $_SERVER is not working, what is your other suggestion to solve my asking
besides using tcpdump
Expert: Ray Paseur replied at 2024-06-30 09:45:26
In PHP variables are case-sensitive. $_Server != $_SERVER
Expert: julianH replied at 2024-06-30 09:38:00
$_SERVER is for getting information about who is visiting from within your PHP script.
If you are asking how to monitor what files are being accessed on your system you need to look at your logs - they should contain all the information concerning GET's to the server - time, source IP file etc.
Is this what you were asking? If so then $_SERVER is not going to help you.
If you are asking how to monitor what files are being accessed on your system you need to look at your logs - they should contain all the information concerning GET's to the server - time, source IP file etc.
Is this what you were asking? If so then $_SERVER is not going to help you.
Author: duncanb7 replied at 2024-06-30 08:54:38
I used tcpdump -A port 80 to solve the problem , the command will output the
request header which include the exact path of request html/php filename
now I will try your suggestion
from $_Server
request header which include the exact path of request html/php filename
now I will try your suggestion
from $_Server
Expert: Ray Paseur replied at 2024-06-30 08:46:53
PHP answers:
URL of the current script is available in $_SERVER['REQUEST_URI']
IP address of the current visitor is available in $_SERVER['REMOTE_ADDR']
Browser information is available in $_SERVER["HTTP_USER_AGENT"]
Request method (GET, POST) is available in $_SERVER["REQUEST_METHOD"]
These values are not guaranteed, but are usually present in most PHP installations.
URL of the current script is available in $_SERVER['REQUEST_URI']
IP address of the current visitor is available in $_SERVER['REMOTE_ADDR']
Browser information is available in $_SERVER["HTTP_USER_AGENT"]
Request method (GET, POST) is available in $_SERVER["REQUEST_METHOD"]
These values are not guaranteed, but are usually present in most PHP installations.