Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I read httpd.conf from php ?

Status
Not open for further replies.

Janoh

Programmer
Jul 20, 2000
34
RO
Is there a function or can I find somehow the httpd.conf file's location from php ? And can I read it, modify it and replace it from php ? I use an NT box and didn't find that the access is restricted.

I found only the HTTP_SERVER_VARS["DOCUMENT_ROOT"] variable that will give me the doc root but I can find the path only if the docs are installed in the default location and I need a general solution.

Thanks in advance.
 
Hi,

Firstly, do you know how big a security hole this will be?? If someone else gets access to this then they have full control over your server, not to mention the rest of the machine that the server is on..

If you really want to do this, the best bet would be to create your conf directory as an alias..

You have been warned!!

Hope this helps Wullie

 
Yes, I am aware of security, I mean those php pages will be accessed only by authorized users and I'm trying to do a remote configurator of some sort but I guess I have to run some server side app that will interact with my pages in php somehow.
Thanks anyway.

Janoh
 
Hi,

If you want to run this remotely, you would also need to restart Apache every time that you made a change so you would need to run another instance of Apache on another port.

Why not set that instance with access to the httpd.conf??

What is it you actually want to change in the httpd? There are some things that you can get round other ways..

Hope this helps Wullie

 
Hi all :)

Starting and stopping of windows services is as easy as 1-2-3 with Perl.

Have a look at . The Section "Services" is folloed by two links, the first poiting to a small documentation file and the second to the script download. Documentation and script are written in English.

cu, Sascha cu, Sascha
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top