[SWLUG] Restart Apache from php

Toby Maxwell-Lyte Toby.Maxwell-Lyte at eazyweb.net
Fri Jan 21 08:40:49 UTC 2005


Hi All,

I have written a script that will add a virtual host to my httpd.conf
include directory. I would like to be able to envoke this script from 
php
so that I can quickly and eazily set up new subdomains. Having done 
this I
would then like to automatically issue a "apachectl graceful" so that
apache rereads httpd.conf. I am aware that I can use the php exec()
function but want to be sure that I don't cause any security 
loopholes. 

httpd.conf contains a line that includes the subdir virtual/*.conf
My script creates a .conf file in the /etc/httpd/conf/virtual 
directory
with the relevant docroot, logfile location etc. It takes the domain 
name
and docroot as parameters. 

I've had a good google around but haven't turned up anything useful. 

Any suggestions would be much appreciated, 

cheers
Toby


--
Toby Maxwell-Lyte    Project Manager

--/--/--/--   e a z y w e b  --/--/--/--
M u l t i m e d i a  &  W e b  D e s i g n
info at eazyweb.net    http://www.eazyweb.net
         http://www.eazycms.com  
Tel: +44 (0)29 20344006   Fax: +44 (0)29 20344008

   For all your digital design needs...

This E-mail may contain confidential and/or privileged
information. It is only intended for the use of the
Addressee. If you are not the addressee, the disclosure,
copying or delivering of this to any one else is strictly
prohibited and may be unlawful. If you have received this
E-mail in error, please delete immediately.




More information about the Swlug mailing list