Accessing directories in root of server

Discussion in 'Web Design and Development' started by londonweb, Dec 2, 2006.

  1. londonweb macrumors 6502

    londonweb

    Joined:
    Sep 14, 2005
    Location:
    london
    #1
    Can anyone help me- I need to be able to acess certain folders in the root of this directory. It's not a server that I've set up myself so I don't have proper access to the admin panel. Here is a screen shot of the directory structure - I need to be able to access the php folder from an html file in the public/www folder and run the scripts there. At least, I think that's what I need to do - I've tried running scripts from public/www/php but I get an error message from the server (which appears to be running Apache 1.3.3), like this:

    Proxy Error

    The proxy server received an invalid response from an upstream server.
    The proxy server could not handle the request GET /dev/php/login.php.

    Reason: Could not connect to remote machine: Connection refused

    So perhaps php isn't installed?

    [​IMG]
     
  2. Grover macrumors member

    Joined:
    May 14, 2004
    #2
    I think the solution will depend on how you need to access them. From looking at the directory structure I'd assume that the site root is the www directory. So when you access the site like: http://www.yoursite.com/ - www is mapped to / (although it's hard to know, it might also be mapped to public so that the stats are accessible from the web.) You will not be able to access anything in the php directory using a URL like http://www.yoursite.com/dev/php/login.php because those files are actually in /conf/php.

    Now, if the server's security is poor you might be able to request them like http://www.yoursite.com/../../conf/php/login.php but that's not a good idea for a number of reasons.

    What I would think about trying is to make a symlink to the /conf/php directory in your www directory. If Apache is set up to follow symlinks that may work for you. I'd guess that this what the arrow icon next to awstats in the public directory is telling you - that it's a symlink to /conf/awstats.

    Failing that, I would try to modify the httpd.conf to create another mount point for those files to which you can redirect the user.

    You might also be able to include the files from another PHP files that you place in the www directory - maybe there's a way to wrap the functionality like that.

    If you're able to you could try creating a .htaccess file in the www directory. I forget how you do it but you can set a custom php value using the "php_value" keyword - it's possible you can create a pointer to the directory. The same is also true of the global settings in php.ini. Even if you succeed with this, you'd probably still have to reference these pages from another page so it's not really a solution - I've mentioned it in case it sparks an idea from someone else.

    These things all assume that the web server's account has access to these files and/or that you have permissions to modify httpd.conf or php.ini if you intend to try either of those.

    If you want to find out if PHP is installed on the web server you can use Netcraft's (http://www.netcraft.com/) server profile - if the server reports details on itself. Alternately, you can create a simple PHP page that looks like:

    Code:
    <?php
    
    echo phpinfo();
    
    ?>
    
    Put a file with that code in it and a .php extension in the www directory and try hitting it with a browser. If PHP is installed, you should get a lot of PHP configuration information.
     
  3. londonweb thread starter macrumors 6502

    londonweb

    Joined:
    Sep 14, 2005
    Location:
    london
    #3
    Hi Grover, thanks for all your advice. I've tried running php_info but I get the proxy error message - should I assume this means php isn't installed?

    The other stuff like htaccess etc sounds like what I need to do but I'm really sketchy on how to do it - you don't know any good tutorials on that stuff do you?

    thanks again
     
  4. Grover macrumors member

    Joined:
    May 14, 2004
    #4
    I haven't ever seen exactly that error but I'd assume it's either not installed or not configured/incorrectly configured in the Apache configuration files. If you have ssh or telnet access to the system you could poke around to see if you can find either the php installation or the Apache configuration files to look for evidence of a PHP install. If you don't have command line access, then this will be a lot more difficult to do although you might be able to modify some of these files using FTP, permissions allowing.

    If you're willing to dig a little, the official PHP manual is at: http://us3.php.net/manual/en/index.php. You can probably find examples of modifying php.ini or adding values to a .htaccess file there - a lot of the comments are very useful. The .htaccess files actually belong to Apache - you can find the documentation for them at: http://httpd.apache.org/docs/2.0/howto/htaccess.html. (The link is to Apache 2.0 documentation but if you scout around a little on their site, you should be able to find 1.3 documentation, as well.)
     
  5. londonweb thread starter macrumors 6502

    londonweb

    Joined:
    Sep 14, 2005
    Location:
    london
    #5
    thanks for your help, I'll have a go with the manual
     

Share This Page