vi /etc/motd
_ ______ ________
| | / __ \ \ / / ____|
| | | | | \ \ / /| |__
| | | | | |\ \/ / | __|
| |___| |__| | \ / | |____
|______\____/ \/ |______|
_ ______ ________
| | / __ \ \ / / ____|
| | | | | \ \ / /| |__
| | | | | |\ \/ / | __|
| |___| |__| | \ / | |____
|______\____/ \/ |______|
# /etc/logrotate.conf/var/log/apache/error_log (полный путь для лог-файла)(в CentOS это /var/log/httpd/error_log){rotate 5 (кол-во хранимых сжатых фрагментов)size=10M (максимальный размер несжатого файла (в мегабайтах).Пока размер текущего файла журнала не превысит данный порог,файл не будет "ротирован")missingok (отсутствие файла не является ошибкой)nocopytruncate (не сбрасывать файл журнала после копирования)nocreate (не создавать пустой журнал)nodelaycompress (не откладывать сжатие файла на следующий цикл)nomail (не отправлять содержимое удаляемых журналов по почте)notifempty (не обрабатывать пустые файлы)noolddir (держать все файлы в одном и том же каталоге)compress (сжимать ротируемые фыйлы)postrotate/usr/bin/killall -HUP httpdendscript (между postrotate и endscript расположены командыинтерпретатора исполняемые непосредственно после ротации.В данном случае сюда помещена команда killall,перезапускающая httpd-сервер.Это необходимо для нормальной процедуры ротации лог-файлов)}/var/log/apache/access_log (полный путь для лог-файла)(в CentOS это /var/log/httpd/access_log){rotate 4weekly (производить ротацию регулярно, раз в неделю)missingoknocopytruncatenocreatenodelaycompress nomailnotifemptynoolddircompresspostrotate/usr/bin/killall -HUP httpdendscript}# /usr/sbin/logrotate –s /var/log/logrotate.state /etc/logrotate.conf* 22 * * * /usr/sbin/logrotate –s /var/log/logrotate.state /etc/logrotate.conf/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
ethtool -p eth0 15 |
free.-g она выведет информацию об использовании памяти в гигабайтахfree -g total used free shared buffers cached Mem: 3 3 0 0 0 3 -/+ buffers/cache: 0 3 Swap: 16 0 16
-m – в мегабайтахfree -m total used free shared buffers cached Mem: 4047 3996 51 0 254 3099 -/+ buffers/cache: 642 3405 Swap: 16386 0 16386
echo 3 > /proc/sys/vm/drop_caches
1.vi /var/www/html/info.php1.<?php2.phpinfo();3.?>1.yum remove php-eaccelerator1.yum remove php-pecl-apc1./etc/init.d/httpd restart1.yum install php-devel2.yum groupinstall 'Development Tools'3.yum groupinstall 'Development Libraries'1.cd /tmp2.wget http://xcache.lighttpd.net/pub/Releases/1.3.0/xcache-1.3.0.tar.gz3.tar xvfz xcache-1.3.0.tar.gz1.cd xcache-1.3.01.phpize2../configure --enable-xcache3.make4.make install1.cp xcache.ini /etc/php.d01.[xcache-common]02.;; install as zend extension (recommended), normally "$extension_dir/xcache.so"03.;zend_extension = /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so04.; zend_extension_ts = /usr/local/lib/php/extensions/non-debug-zts-xxx/xcache.so05.;; For windows users, replace xcache.so with php_xcache.dll06.;zend_extension_ts = c:/php/extensions/php_xcache.dll07.;; or install as extension, make sure your extension_dir setting is correct08.extension = xcache.so09.;; or win32:10.; extension = php_xcache.dll11.[...]12.xcache.size = 60M13.[...]1./etc/init.d/httpd restart1.rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
1.yum install memcached php-pecl-memcache memcached-selinux1.Loaded plugins: downloadonly, rhnplugin, security, verify Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package memcached.x86_64 0:1.2.8-1.el5 set to be updated --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================== Package Arch Version Repository Size ======================================================================================================== Installing: memcached x86_64 1.2.8-1.el5 epel 60 k Transaction Summary ======================================================================================================== Install 1 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 60 k Is this ok [y/N]: y Downloading Packages: memcached-1.2.8-1.el5.x86_64.rpm | 60 kB 00:00 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : memcached 1/1 Installed: memcached.x86_64 0:1.2.8-1.el5 Complete!1.vi /etc/sysconfig/memcached1.PORT="11211" USER="memcached" # max connection 2048 MAXCONN="2048" # set ram size to 2048 - 2GiB CACHESIZE="4096" # listen to loopback ip 127.0.0.1, for network connection use real ip e.g., 10.0.0.4 OPTIONS="-l 127.0.0.1"1.chkconfig memcached on2.service memcached start2.service memcached restart1.memcached-tool IP_ADDRESS:Port2.memcached-tool IP_ADDRESS:Port display3.memcached-tool 127.0.0.1:1121101.# Item_Size Max_age 1MB_pages Count Full02.1 104 B 5134 s 1 10 no03.2 136 B 5135 s 1 40 no04.3 176 B 0 s 1 0 no05.4 224 B 2648 s 1 7 no06.8 552 B 1810 s 1 12 no07.9 696 B 1810 s 1 6 no08.10 872 B 2935 s 1 8 no09.11 1.1 kB 4262 s 1 18 no10.12 1.3 kB 2990 s 1 23 no11.13 1.7 kB 2434 s 1 22 no12.14 2.1 kB 3489 s 1 11 no13.15 2.6 kB 2964 s 1 16 no14.16 3.3 kB 2861 s 1 14 no15.17 4.1 kB 2076 s 1 5 no16.18 5.2 kB 2981 s 1 5 no17.20 8.1 kB 64 s 1 1 no18.21 10.1 kB 1865 s 1 3 no19.29 60.2 kB 1550 s 1 2 no1.memcached-tool IP_Address:Port stats2.memcached-tool 127.0.0.1:11211 stats01.#127.0.0.1:11211 Field Value02. accepting_conns 103. bytes 39939504. bytes_read 50479705. bytes_written 1731365806. cmd_flush 007. cmd_get 114108. cmd_set 24809. connection_structures 910. curr_connections 511. curr_items 20512. evictions 013. get_hits 89814. get_misses 24315. limit_maxbytes 107374182416. listen_disabled_num 017. pid 4015918. pointer_size 6419. rusage_system 0.22796520. rusage_user 0.03499421. threads 522. time 125580354723. total_connections 34424. total_items 25925. uptime 582926. version 1.2.8