home *** CD-ROM | disk | FTP | other *** search
- <?php
-
- function apache($action) {
-
- if ($action == "start") {
- print("Starting Apache<br>");
- system("c:\apache\Apache -n \"Apache\" -k start &") or die ("<br><a href=\"index.html\">Back to Index</a>");
- print("Apache Service Started<br><a href=\"index.html\">Back to Index</a>");
- }
- elseif ($action == "stop") {
- print("Stopping Apache Service<br>");
- system("c:\apache\apache -n \"Apache\" -k shutdown &") or die ("<br><a href=\"index.html\">Back to Index</a>");
- print("Apache Service Named \"Apache\" Stopped<br><a href=\"index.html\">Back to Index</a>");
- }
- elseif ($action == "restart") {
- print("Stopping Apache Service<br>");
- system("c:\apache\apache -n \"Apache\" -k restart &") or die ("<br><a href=\"index.html\">Back to Index</a>");
- print("Apache Service Named \"Apache\" Restarted<br><a href=\"index.html\">Back to Index</a>");
- }
- elseif ($action == "install") {
- print("Installing Apache as Service<br>");
- system("c:\apache\apache -i -n \"Apache\" &") or die ("<br><a href=\"index.html\">Back to Index</a>");
- print("Apache Service Named \"Apache\" Installed<br><a href=\"index.html\">Back to Index</a>");
- }
- elseif ($action == "uninstall") {
- print("Uninstalling Apache as Service<br>");
- system("c:\apache\apache -u -n \"Apache\" &") or die ("<br><a href=\"index.html\">Back to Index</a>");
- print("Apache Service Named \"Apache\" Uninstalled<br><a href=\"index.html\">Back to Index</a>");
- }elseif ($action == "test") {
- print("Testing Apache Service Settings<br>");
- system("c:\apache\apache -n \"Apache\" -t &") or die ("<br><a href=\"index.html\">Back to Index</a>");
- print("Apache Service Named \"Apache\" Settings<br><a href=\"index.html\">Back to Index</a>");
-
- }elseif ($action == "editconf") {
- print("Opening httpd.conf<br>");
- system("notepad C:\apache\conf\httpd.conf") or die ("<br><a href=\"index.html\">Back to Index</a>");
- print("httpd.conf Opened.<br><a href=\"index.html\">Back to Index</a>");
- }elseif ($action == "showlogs") {
- print("Opening Logs<br>");
- system("notepad C:\apache\logs\error.log") or die ("<br><a href=\"index.html\">Back to Index</a>");
- system("notepad C:\apache\logs\access.log") or die ("<br><a href=\"index.html\">Back to Index</a>");
- print("Logs Opened.<br><a href=\"index.html\">Back to Index</a>");
-
- } else {
- print("No action to perform");
- }
-
- }
-
- apache($action);
- ?>