-1

I have a VPS (Centos 5) and want to use a file in address like this: www.domain.ir/socket.php but after entering the address I see this error:

Not Found

The requested URL /socket.php was not found on this server.

Apache/2.2.29 (CentOS) Server at domain.ir Port 80

It seems the error is from Apache. How can I sovle it? The socket.php exist on the root.

BE77Y
  • 2,667
  • 3
  • 18
  • 23
Reza Kazemi
  • 1
  • 1
  • 2
  • What do your apache logs say? – EEAA Dec 04 '14 at 15:21
  • How can I take logs? – Reza Kazemi Dec 04 '14 at 15:45
  • I think on CentOS 5 they will be in /var/log/httpd, and the file you are looking for is called error_log. I notice that you are attempting to GET /socket.php, but the response refers to /sot. Is /socket.php attempting to redirect your browser to /sot ? – Adam Thompson Dec 04 '14 at 15:48
  • I made mistake about sot it was socket.php. In the log is written:[Thu Dec 04 03:34:20 2014] [error] [client 188.159.166.126] script '/home/kloxo/httpd/default/socket.php' not found or unabl$ [Thu Dec 04 03:34:45 2014] [error] [client 188.159.166.126] script '/home/kloxo/httpd/default/socket.php' not found or unabl$ – Reza Kazemi Dec 04 '14 at 16:32

1 Answers1

0

Since you mention that socket.php exists within your document root, I suggest that you make sure that your DocumentRoot directive is set correctly for the appropriate domain within your apache configuration; probably within /etc/httpd/conf/httpd.conf or alternatively in a vhosts directive within /etc/httpd/conf.d/

Also make sure that the user apache is running as has read access to the directory and the file in question, and that SElinux is not preventing access to the file (for example by default it prevents access for apache to home directories, etc)

BE77Y
  • 2,667
  • 3
  • 18
  • 23
  • The selinux is disabled. Could you please say How the confuguration of the httpd.conf or conf.d should be? – Reza Kazemi Dec 04 '14 at 17:05
  • Based on a further comment by yourself, I'd presume that your `DocumentRoot`directive should be set to `/home/kloxo/httpd/default` but this is merely a guess - you should really provide more information. – BE77Y Dec 04 '14 at 17:08
  • excuse me this problem made us crazy. which informations should I say. Even I can give you the user name and password if you accept. – Reza Kazemi Dec 05 '14 at 09:58
  • No, I would certainly not accept that (it's a fairly inappropriate request/suggestion I'm afraid). Perhaps a fuller output of your logs, and a better idea of your server configuration would be helpful. – BE77Y Dec 05 '14 at 10:05