Apache2: кодировка сайтов по-умолчанию

Если нужно быстро задать кодировку статики для Apache2, например в Gentoo, cделать это можно в файле /etc/apache2/httpd.conf,  добавив 2 строчки:

IndexOptions Charset=UTF-8
AddDefaultCharset UTF-8
  • Трэкбеки закрыты
  • Комментарии (4)
  1. куда столько оперативки тратится у вас?
    Free: 18.77 MB
    Used: 991.05 MB
    Total: 1009.82 MB

    • Sb0y
    • 22 сентября, 2009


    bagrincev sb0y # ps -aux
    USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
    root 1 0.0 0.0 1728 1032 ? Ss 22:20 0:00 init [3]
    root 2 0.0 0.0 0 0 ? S< 22:20 0:00 [kthreadd]
    root 3 0.0 0.0 0 0 ? S< 22:20 0:00 [migration/0]
    root 4 0.0 0.0 0 0 ? S< 22:20 0:00 [ksoftirqd/0]
    root 5 0.0 0.0 0 0 ? S< 22:20 0:00 [events/0]
    root 6 0.0 0.0 0 0 ? S< 22:20 0:00 [khelper]
    root 10 0.0 0.0 0 0 ? S< 22:20 0:00 [kstop/0]
    root 97 0.0 0.0 0 0 ? S< 22:20 0:00 [kblockd/0]
    root 98 0.0 0.0 0 0 ? S< 22:20 0:00 [kacpid]
    root 99 0.0 0.0 0 0 ? S< 22:20 0:00 [kacpi_notify]
    root 147 0.0 0.0 0 0 ? S< 22:20 0:00 [kseriod]
    root 192 0.0 0.0 0 0 ? S 22:20 0:00 [pdflush]
    root 193 0.0 0.0 0 0 ? S 22:20 0:00 [pdflush]
    root 194 0.2 0.0 0 0 ? S< 22:20 0:01 [kswapd0]
    root 236 0.0 0.0 0 0 ? S< 22:20 0:00 [aio/0]
    root 249 0.0 0.0 0 0 ? S< 22:20 0:00 [nfsiod]
    root 963 0.0 0.0 0 0 ? S< 22:20 0:00 [rpciod/0]
    root 968 0.0 0.0 0 0 ? S< 22:20 0:00 [reiserfs/0]
    root 1080 0.0 0.0 1976 804 ? S 22:20 0:00 /sbin/udevd --daemon
    root 4499 0.0 0.0 5088 920 ? Ss 22:21 0:00 /usr/sbin/pppd unit 0 user andrew22 remotename ppp0 linkname ppp0 noauth defaultroute default
    bin 4670 0.0 0.0 1732 556 ? Ss 22:21 0:00 /sbin/portmap
    nobody 5074 0.0 0.1 1804 1076 ? Ss 22:21 0:00 /sbin/rpc.statd --no-notify
    root 5143 0.0 0.0 1884 92 ? Ss 22:21 0:00 /usr/sbin/rpc.mountd
    root 5145 0.0 0.0 0 0 ? S< 22:21 0:00 [lockd]
    root 5146 0.0 0.0 0 0 ? S< 22:21 0:00 [nfsd]
    root 5147 0.0 0.0 0 0 ? S< 22:21 0:00 [nfsd]
    root 5148 0.0 0.0 0 0 ? S< 22:21 0:00 [nfsd]
    root 5149 0.0 0.0 0 0 ? S< 22:21 0:00 [nfsd]
    root 5150 0.0 0.0 0 0 ? S< 22:21 0:00 [nfsd]
    root 5151 0.0 0.0 0 0 ? S< 22:21 0:00 [nfsd]
    root 5152 0.0 0.0 0 0 ? S< 22:21 0:00 [nfsd]
    root 5153 0.0 0.0 0 0 ? S< 22:21 0:00 [nfsd]
    root 6294 0.0 0.0 2380 956 ? Ss 22:21 0:00 /usr/sbin/syslog-ng
    named 6357 0.0 1.1 48568 12096 ? Ssl 22:21 0:00 /usr/sbin/named -u named -n 1
    root 6431 0.0 0.0 1716 508 ? S 22:21 0:00 /usr/sbin/courierlogger -pid=/var/run/authdaemon.pid -start /usr/lib/courier/courier-authlib/
    root 6432 0.0 0.1 5352 1688 ? S 22:21 0:00 /usr/lib/courier/courier-authlib/authdaemond
    root 6438 0.0 0.1 5396 1412 ? S 22:21 0:00 /usr/lib/courier/courier-authlib/authdaemond
    root 6439 0.0 0.1 5396 1624 ? S 22:21 0:00 /usr/lib/courier/courier-authlib/authdaemond
    root 6440 0.0 0.0 5352 144 ? S 22:21 0:00 /usr/lib/courier/courier-authlib/authdaemond
    root 6441 0.0 0.0 5352 144 ? S 22:21 0:00 /usr/lib/courier/courier-authlib/authdaemond
    root 6442 0.0 0.1 5396 1876 ? S 22:21 0:00 /usr/lib/courier/courier-authlib/authdaemond
    root 6504 0.0 0.0 1796 844 ? S 22:21 0:00 /usr/lib/courier-imap/couriertcpd -address=0 -stderrlogger=/usr/lib/courier-imap/courierlogge
    root 6506 0.0 0.0 1600 548 ? S 22:21 0:00 /usr/lib/courier-imap/courierlogger imapd
    root 6624 0.0 0.0 1808 924 ? S 22:21 0:00 /usr/lib/courier-imap/couriertcpd -address=0 -stderrlogger=/usr/lib/courier-imap/courierlogge
    root 6626 0.0 0.0 1672 932 ? S 22:21 0:00 /usr/lib/courier-imap/courierlogger pop3d
    jabber 6744 0.0 0.0 1916 224 ? S 22:21 0:00 /usr/lib/erlang/erts-5.6.5/bin/epmd -daemon
    jabber 6746 0.9 5.1 73388 53592 ? Sl 22:21 0:07 /usr/lib/erlang/erts-5.6.5/bin/beam -- -root /usr/lib/erlang -progname erl -- -home /var/run/
    p2p 6813 0.3 0.9 25184 10196 ? SNsl 22:21 0:02 /usr/bin/mlnet
    mysql 6997 0.5 3.6 143392 37488 ? Ssl 22:21 0:03 /usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf --basedir=/usr --datadir=/var/lib/mysql --
    root 7123 0.0 0.1 7464 1708 ? Ss 22:22 0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
    ftp 7124 0.0 0.4 8152 4304 ? S< 22:22 0:00 nginx: worker process
    ftp 7129 0.0 0.4 8152 4276 ? S< 22:22 0:00 nginx: worker process
    root 7403 0.0 0.0 2140 492 ? Ss 22:22 0:00 /usr/sbin/saslauthd -a pam
    root 7505 0.0 0.0 2140 68 ? S 22:22 0:00 /usr/sbin/saslauthd -a pam
    root 7508 0.0 0.0 2140 60 ? S 22:22 0:00 /usr/sbin/saslauthd -a pam
    root 7510 0.0 0.0 2140 60 ? S 22:22 0:00 /usr/sbin/saslauthd -a pam
    root 7511 0.0 0.0 2140 60 ? S 22:22 0:00 /usr/sbin/saslauthd -a pam
    sqlgrey 7571 0.0 0.2 14084 2408 ? Ss 22:22 0:00 /usr/bin/perl -w /usr/sbin/sqlgrey -d
    root 7677 0.0 0.2 7184 2468 ? Ss 22:22 0:00 /usr/lib/postfix/master
    postfix 7689 0.0 0.2 7220 2340 ? S 22:22 0:00 pickup -l -t fifo -u
    postfix 7690 0.0 0.2 7260 2448 ? S 22:22 0:00 qmgr -l -t fifo -u
    jabber 7738 0.1 0.8 26012 8976 ? S 22:22 0:00 /usr/bin/python /usr/lib/python2.5/site-packages/pyicq-t/pyicq-t.py -b -c /etc/jabber/pyicq-t
    jabber 7810 0.2 1.0 21276 10892 ? Sl 22:22 0:01 python /usr/lib/python2.5/site-packages/mrim/src/mrim.py -c /etc/jabber/mrim.conf
    jabber 7864 0.0 0.0 1896 760 ? Ss 22:22 0:00 inet_gethost 4
    jabber 7865 0.0 0.1 2048 1296 ? S 22:22 0:00 inet_gethost 4
    jabber 7866 0.0 0.1 2048 1312 ? S 22:22 0:00 inet_gethost 4
    jabber 7868 0.0 1.0 15804 11184 ? S 22:22 0:00 /usr/bin/python /usr/lib/python2.5/site-packages/pymsn-t/pymsn-t.py -b -c /etc/jabber/pymsn-t
    jabber 7872 0.0 0.1 2048 1312 ? S 22:22 0:00 inet_gethost 4
    root 7931 0.0 0.2 8040 2256 ? Ss 22:22 0:00 /usr/sbin/smbd -D
    root 7940 0.0 0.1 5280 1520 ? Ss 22:22 0:00 /usr/sbin/nmbd -D
    root 7957 0.0 0.0 8040 608 ? S 22:22 0:00 /usr/sbin/smbd -D
    root 8004 0.0 0.1 8440 1732 ? Ss 22:22 0:00 /usr/sbin/squid -DYC
    squid 8006 0.0 0.8 12020 8372 ? S 22:22 0:00 (squid) -DYC
    squid 8008 0.0 0.0 2960 1020 ? S 22:22 0:00 (unlinkd)
    root 8065 0.0 0.1 4356 1164 ? Ss 22:22 0:00 /usr/sbin/sshd
    root 8128 0.5 1.3 14616 13508 ? S 22:22 0:03 /usr/bin/tor --runasdaemon 1 --PidFile /var/run/tor/tor.pid
    root 8189 0.0 0.1 3256 1268 ? Ss 22:22 0:00 /usr/sbin/cron
    root 8253 0.0 0.1 3628 1764 ? Ss 22:22 0:00 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
    root 8325 0.0 0.1 1852 1424 tty1 Ss+ 22:22 0:00 /sbin/agetty 38400 tty1 linux
    root 8326 0.0 0.1 1856 1420 tty2 Ss+ 22:22 0:00 /sbin/agetty 38400 tty2 linux
    root 8327 0.0 0.1 1864 1420 tty3 Ss+ 22:22 0:00 /sbin/agetty 38400 tty3 linux
    root 8328 0.0 0.1 1836 1420 tty4 Ss+ 22:22 0:00 /sbin/agetty 38400 tty4 linux
    root 8329 0.0 0.1 1844 1420 tty5 Ss+ 22:22 0:00 /sbin/agetty 38400 tty5 linux
    root 8330 0.0 0.1 1892 1424 tty6 Ss+ 22:22 0:00 /sbin/agetty 38400 tty6 linux
    jabber 8424 0.0 0.1 2048 1288 ? S 22:25 0:00 inet_gethost 4
    root 8610 0.0 0.4 7300 4336 ? Ss 22:31 0:00 sshd: sb0y [priv]
    sb0y 8615 0.0 0.1 7440 1992 ? S 22:31 0:00 sshd: sb0y@pts/0
    sb0y 8617 0.0 0.3 4504 3160 pts/0 Ss 22:31 0:00 -bash
    root 8622 0.0 0.2 3964 2344 pts/0 S 22:31 0:00 su
    root 8623 0.0 0.3 4376 3220 pts/0 R 22:31 0:00 bash
    root 8804 0.0 0.5 41608 6176 ? Ss 22:32 0:00 /usr/bin/php-cgi --fpm
    ftp 8805 2.0 3.3 52276 34592 ? S 22:32 0:01 /usr/bin/php-cgi --fpm
    ftp 8808 0.5 2.1 44704 21740 ? S 22:32 0:00 /usr/bin/php-cgi --fpm
    ftp 8809 2.2 2.5 47476 26216 ? S 22:32 0:01 /usr/bin/php-cgi --fpm
    ftp 8810 0.0 0.8 41272 8920 ? S 22:32 0:00 /usr/bin/php-cgi --fpm
    ftp 8811 0.0 0.8 41256 8888 ? S 22:32 0:00 /usr/bin/php-cgi --fpm
    ftp 8812 0.1 0.9 41956 9752 ? S 22:32 0:00 /usr/bin/php-cgi --fpm
    ftp 8813 1.0 2.4 46396 25768 ? S 22:32 0:00 /usr/bin/php-cgi --fpm
    ftp 8815 0.6 2.2 45004 22924 ? S 22:32 0:00 /usr/bin/php-cgi --fpm
    ftp 8816 0.0 0.4 40328 4296 ? S 22:32 0:00 /usr/bin/php-cgi --fpm
    ftp 8817 0.0 0.4 40328 4296 ? S 22:32 0:00 /usr/bin/php-cgi --fpm

    Это php-fpm шалит. Если много файлов, то всё начинает тормозить из-за системных блокировок жёсткого диска.

    Для этого много процессов приходиться делать, который и жрут память, но сейчас осваиваю файловый AIO nginx, и PM-стиль php-fpm, вроде полегчало :)

  2. Это из-за хостящихся сайтов, или чего то другого?