Windows linux Software Super Tips

All Tips For Os & Software

 
Home
Add to Technorati Favorites

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
 
0 Comments:
Post a Comment
<< Home
 
Search



Previous Post
Archives
Links
    Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online Add to My AOL Add to Technorati Favorites!
Powered by

BLOGGER

© 2005 Windows linux Software Super Tips
eXTReMe Tracker