|
php edit vhost and restart apache |
Monday, January 29, 2007 |
Code:vhost.php
<FORMMETHOD=POSTACTION=""> <B>Domain</B> <INPUTTYPE="text"NAME="sn"size="12"value="www."><BR> <B>Folder</B> <INPUTTYPE="text"NAME="na"size="12"><BR> <INPUTTYPE="submit"value="add"> </FORM><BR> <AHREF="reset.php">RestartApache</A> <? if($sn==\"\"|$na==\"\"){ echo\"AddDomainByGitem\"; } else{ $path=\"www\"; $pad=\"/WM\"; $userfile=\"/WM/Apache-2.0.52/conf/httpd\"; $fp=fopen($userfile,\"a\"); fputs($fp,\" <VirtualHost*:80> DocumentRoot $pad/$path/$na ServerName $sn <Directory $pad/$path/$na> Options Indexes MultiViews AllowOverride All Orderallow,deny Allowfrom all </Directory> </VirtualHost> \"); fclose($fp); echo\"$sn Compile\"; } ?> |
Code:reset.php
<?php exec(\"gitem.bat\"); ?> |
Code:gitem.bat
net stop apache net start apache |
|
|
|
|
|
Previous Post |
|
Archives |
|
Links |
|
Powered by |
|
|