نمایش نتایج: از شماره 1 تا 1 , از مجموع 1

موضوع: How to rotate your Apache Log Files?

  1. #1
    مدیر کل Vahid آواتار ها
    تاریخ عضویت
    Aug 2008
    نوشته ها
    2,724
    تشکر تشکر کرده 
    435
    تشکر تشکر شده 
    6,976
    تشکر شده در
    2,085 پست

    پیش فرض How to rotate your Apache Log Files?

    Cpanel does a good job with rotating Apache log files for the different domains on a cpanel/WHM server, but they are still not doing anything good to rotate the main Apache log files. To prevent problems on your server you need to setup log file rotation yourself. This should be done on every Apache web server and not just on a Cpanel server. Here is an easy way to do it.



    Log into your server via SSH and switch to the root user. Now create a file for Apache log file rotation:



    # vi /etc/logrotate.d/httpd



    VI comes up with the new file open. Now add the following content to the new file:



    /var/log/httpd/*log {
    missingok
    notifempty
    sharedscripts
    postrotate
    /bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
    endscript
    }




    Save the file and you are all done. But hold on. What if you wanted to go a little more sophisticated? Consider the following to extend your logging and to keep log files around for a while.



    /var/log/httpd/*log {

    weekly

    rotate 52

    compress
    missingok
    notifempty
    sharedscripts
    postrotate
    /bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
    endscript
    }



    Save it and you are done. What does this actually do? Here are all options explained for you:



    The log files are now rotated on a weekly base. The "52" is equal to 52 weeks before log files are overwritten. To save on disk space the log files are compressed accordingly. "missingok" tells the rotation job to continue to the next file if a log file is missing and not to trigger an error. If a log file is empty it will not be rotated (notifempty). The last two options are not really critical to know for now. All we really care about are the options specified.
    برای پیش رفت در علم آسانسوری وجود ندارد پله ها را باید پیاده رفت /./ همیشه این یادتان باشد که دست بالای دست بسیار است.
    يادمان باشد براي يك بار ايستادن صد ها بار افتاده ايم /./ بک آپ مهمترین رمز موفقیت هاستینگ /./ امنیت مطلق نیست.
    ارتباط مستقیم با من :
    Admin -{(@)}- WebHostingTalk . ir

  2. تعداد تشکر ها از Vahid به دلیل پست مفید


  3. # ADS




     

اطلاعات موضوع

کاربرانی که در حال مشاهده این موضوع هستند

در حال حاضر 1 کاربر در حال مشاهده این موضوع است. (0 کاربران و 1 مهمان ها)

موضوعات مشابه

  1. Files in hidden subdirectories
    توسط mha1368 در انجمن سی پنل CPanel
    پاسخ ها: 1
    آخرين نوشته: May 15th, 2016, 14:39
  2. هک شدن فیسبوک و شل در files.fb.com
    توسط IrIsT در انجمن مباحث دیگر
    پاسخ ها: 0
    آخرين نوشته: April 23rd, 2016, 09:54
  3. ارور وب سایت پنل : Error getting files list
    توسط samiraabd در انجمن ساير کنترل پنل ها
    پاسخ ها: 4
    آخرين نوشته: June 26th, 2015, 19:58
  4. cannot open c:/program files/wing ftp server//webadmin/run.lua: Too many open files
    توسط Black_Team در انجمن سوالات و مشکلات
    پاسخ ها: 3
    آخرين نوشته: August 2nd, 2013, 01:06
  5. Split Large Files
    توسط TukaNet در انجمن ردهت,فدورا,سنت-او-اس Redhat,Fedora,CentOS
    پاسخ ها: 0
    آخرين نوشته: December 19th, 2009, 02:54

مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •