Computer House Home PageList of products and servicesDrivers, Utilities, Info and More!Learn more about Computer House

 How do I reset logs for a Virtual Host?

 
Answer
 
Once you have created the cgi-bin, some of your client may prefer to take care of their log files.
  1. You will need to save the three files below to your system.

    Note: On some browsers you may need to hold your left shift key when clicking.
    vhreset.html
    vhresetlogs.pl
    CGI.pl

  2. Open vhreset.html in a dostext editor (notepad works fine).
    Find the line:
    <form action="/virtualcgi/vhresetlogs.pl" method="POST">

    Change virtualcgi to the cgi-bin ScriptAlias you gave your virtual host in the srm.conf file, or when you setup the cgi-bin for your Virtual Host from the cpanel.


  3. Save file.


  4. Open the vhresetlogs.pl in a dostext editor (notepad or vi works fine).

    Find these lines:

    open(LOG,">/usr/local/etc/httpd/logs/virtualhost.com-error_log");

    open(LOG,">/usr/local/etc/httpd/logs/virtualhost.com-access_log");


  5. Change virtualhost.com to the domain name.


  6. The name of the log files must match the names you gave them in your httpd.conf file.


  7. Save the file.


  8. Open the CGI.pl in a dostext editor (notepad or vi works fine).


  9. Find these lines:

    $mydomain = "vhhostname";
    $myaccount = "vhname";


  10. Change vhhostname to the domain name.


  11. Change vhname to the username you have given your virtual host.


  12. Save file.


  13. Upload the vhreset.html to the same directory as your virtual host wwwstat.html.


  14. Upload vhresetlogs.pl and CGI.pl to your virtual host cgi-bin.


  15. Set permissions for vhresetlogs.pl and CGI.pl to executable. (755)


  16. Now your virtual host should be able to go to vhreset.html and reset their server logs.
Back to Index

The Computer House Technology Center, Inc.
740 South Sixth Avenue
Galloway, New Jersey 08205
(800) 372-6834 --- FAX: (609) 748-9776

Copyright © 2001 Computer House, Inc. All Rights Reserved.