Hallo.
Ich möchte gerne meinen vServer optimieren. Er ist zwar super schnell, keine Probleme und super Apache-Werte, aber er verbraucht zuviel RAM.
Ausgabe von top:
Apache2.conf
My.cnf
Serverdaten:
2 GB RAM
20 GB HDD
Intel I7 920
Habe den Server von einem Freund übernommen, nur ist mir aufgefallen das ständig Prozesse wegen RAM Mangels ausgehen.
Tuning-Primer-Script lief bereits, es scheint ja auch eher am apachen zu liegen.
Was kann ich machen?
Gruß,
Rene
Ich möchte gerne meinen vServer optimieren. Er ist zwar super schnell, keine Probleme und super Apache-Werte, aber er verbraucht zuviel RAM.
Ausgabe von top:
Ausgabe von ps aux:[H[2J[m(Btop - 20:04:34 up 23:22, 1 user, load average: 0.00, 0.07, 0.08[m(B[39;49m[K
Tasks:[m(B[39;49m[m(B 103 [m(B[39;49mtotal,[m(B[39;49m[m(B 2 [m(B[39;49mrunning,[m(B[39;49m[m(B 101 [m(B[39;49msleeping,[m(B[39;49m[m(B 0 [m(B[39;49mstopped,[m(B[39;49m[m(B 0 [m(B[39;49mzombie[m(B[39;49m[K
Cpu(s):[m(B[39;49m[m(B 2.7%[m(B[39;49mus,[m(B[39;49m[m(B 2.6%[m(B[39;49msy,[m(B[39;49m[m(B 0.0%[m(B[39;49mni,[m(B[39;49m[m(B 94.3%[m(B[39;49mid,[m(B[39;49m[m(B 0.3%[m(B[39;49mwa,[m(B[39;49m[m(B 0.0%[m(B[39;49mhi,[m(B[39;49m[m(B 0.0%[m(B[39;49msi,[m(B[39;49m[m(B 0.0%[m(B[39;49mst[m(B[39;49m[K
Mem: [m(B[39;49m[m(B 2097152k [m(B[39;49mtotal,[m(B[39;49m[m(B 1636352k [m(B[39;49mused,[m(B[39;49m[m(B 460800k [m(B[39;49mfree,[m(B[39;49m[m(B 0k [m(B[39;49mbuffers[m(B[39;49m[K
Swap:[m(B[39;49m[m(B 0k [m(B[39;49mtotal,[m(B[39;49m[m(B 0k [m(B[39;49mused,[m(B[39;49m[m(B 0k [m(B[39;49mfree,[m(B[39;49m[m(B 0k [m(B[39;49mcached[m(B[39;49m[K
[6;1H
[7m PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND [m(B[39;49m[K
[m(B 1 root 15 0 10304 740 616 S 0.0 0.0 0:00.40 init [m(B[39;49m
[m(B 3194 nobody 18 0 78708 5252 636 S 0.0 0.3 0:00.00 proftpd [m(B[39;49m
[m(B 3373 vu2010 18 0 220m 12m 5292 S 0.0 0.6 0:00.13 php5-cgi [m(B[39;49m
[m(B 3374 vu2010 18 0 219m 10m 4256 S 0.0 0.5 0:00.10 php5-cgi [m(B[39;49m
[m(B 3898 root 16 0 54376 2924 2336 S 0.0 0.1 0:00.03 sshd [m(B[39;49m
[m(B 3901 root 16 0 17260 1376 1136 S 0.0 0.1 0:00.00 bash [m(B[39;49m
[m(B 3955 postfix 15 0 38888 2288 1808 S 0.0 0.1 0:00.02 pickup [m(B[39;49m
[m(B 5525 root 15 0 53644 2956 2356 S 0.0 0.1 0:00.04 sshd [m(B[39;49m
[m(B 5535 root 15 0 17516 1776 1248 S 0.0 0.1 0:00.00 bash [m(B[39;49m
[m(B 6116 root 18 0 61872 14m 2512 S 0.0 0.7 0:00.15 ispcp-apache-lo [m(B[39;49m
[m(B 6117 root 18 0 61872 14m 2512 S 0.0 0.7 0:00.17 ispcp-apache-lo [m(B[39;49m
[m(B 6119 www-data 18 0 256m 96m 596 S 0.0 4.7 0:00.01 apache2 [m(B[39;49m
[m(B 7190 vu2012 18 0 232m 37m 18m S 0.0 1.9 0:00.43 php5-cgi [m(B[39;49m
[m(B 7192 vu2012 18 0 226m 27m 12m S 0.0 1.3 0:00.21 php5-cgi [m(B[39;49m
[m(B 7534 vu2010 18 0 221m 16m 8076 S 0.0 0.8 0:00.18 php5-cgi [m(B[39;49m
[m(B 7535 vu2010 20 0 217m 5676 360 S 0.0 0.3 0:00.00 php5-cgi [m(B[39;49m
[m(B 8170 vu2010 18 0 220m 18m 10m S 0.0 0.9 0:00.13 php5-cgi [m(B[39;49m
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 10304 740 ? Ss Apr21 0:00 init [2]
vu2010 3373 0.0 0.6 225428 13232 ? S 18:15 0:00 /usr/bin/php5-cgi
vu2010 3374 0.0 0.5 224636 11060 ? S 18:15 0:00 /usr/bin/php5-cgi
root 3898 0.0 0.1 54376 2924 ? Ss 19:50 0:00 sshd: root@notty
root 3901 0.0 0.0 17260 1376 ? Ss 19:50 0:00 -bash
postfix 3955 0.0 0.1 38888 2288 ? S 18:54 0:00 pickup -l -t fifo -u -c
root 5525 0.0 0.1 53484 2948 ? Ss 19:51 0:00 sshd: root@pts/0
root 5535 0.0 0.0 17516 1776 pts/0 Ss 19:51 0:00 -bash
vu2012 7190 0.0 1.8 237740 38812 ? S 07:40 0:00 /usr/bin/php5-cgi
vu2012 7192 0.0 1.3 232216 27716 ? S 07:40 0:00 /usr/bin/php5-cgi
root 7228 0.1 0.7 61872 14872 ? S 19:52 0:00 /usr/bin/perl /var/www/ispcp/engine/ispcp-apache-logger -e
root 7229 0.1 0.7 61872 14904 ? S 19:52 0:00 /usr/bin/perl /var/www/ispcp/engine/ispcp-apache-logger
www-data 7230 0.0 4.6 260132 96500 ? S 19:52 0:00 /usr/sbin/apache2 -k graceful
www-data 7233 0.0 4.8 408444 101472 ? S 19:52 0:00 /usr/sbin/apache2 -k graceful
vu2000 7234 0.0 0.6 223200 13916 ? Ss 19:52 0:00 /usr/bin/php5-cgi
vu2000 7235 0.1 0.7 225948 16208 ? S 19:52 0:00 /usr/bin/php5-cgi
vu2000 7236 0.0 0.6 225644 13964 ? S 19:52 0:00 /usr/bin/php5-cgi
www-data 7239 0.0 4.8 408864 101804 ? S 19:52 0:00 /usr/sbin/apache2 -k graceful
www-data 7241 0.0 4.8 408444 101472 ? S 19:52 0:00 /usr/sbin/apache2 -k graceful
vu2010 7243 0.0 0.6 223200 13920 ? Ss 19:52 0:00 /usr/bin/php5-cgi
vu2010 7245 0.0 0.6 225436 13248 ? S 19:52 0:00 /usr/bin/php5-cgi
vu2010 7255 0.0 0.5 224640 11000 ? S 19:52 0:00 /usr/bin/php5-cgi
www-data 7259 0.0 4.8 408444 101468 ? S 19:52 0:00 /usr/sbin/apache2 -k graceful
www-data 7280 0.0 4.8 408444 101476 ? S 19:52 0:00 /usr/sbin/apache2 -k graceful
vu2010 7534 0.0 0.8 226460 17028 ? S 04:32 0:00 /usr/bin/php5-cgi
vu2010 7535 0.0 0.2 223200 5676 ? S 04:32 0:00 /usr/bin/php5-cgi
vu2010 8170 0.0 0.9 226160 19216 ? S 13:50 0:00 /usr/bin/php5-cgi
vu2010 8171 0.0 1.5 234696 33412 ? S 13:50 0:00 /usr/bin/php5-cgi
vu2013 9230 0.8 0.6 223200 13916 ? Ss 19:54 0:00 /usr/bin/php5-cgi
vu2013 9291 3.8 0.9 228808 20472 ? S 19:54 0:00 /usr/bin/php5-cgi
vu2013 9332 0.0 0.2 223200 5672 ? S 19:54 0:00 /usr/bin/php5-cgi
www-data 9529 0.0 4.7 408308 100616 ? S 19:54 0:00 /usr/sbin/apache2 -k graceful
www-data 9530 0.0 4.7 408308 100612 ? S 19:54 0:00 /usr/sbin/apache2 -k graceful
root 9536 0.0 0.0 14720 972 pts/0 R+ 19:54 0:00 ps aux
bind 11323 0.0 0.5 119336 10768 ? Ssl 19:50 0:00 /usr/sbin/named -u bind
vu2010 11608 0.0 0.6 225432 13244 ? S 18:45 0:00 /usr/bin/php5-cgi
vu2010 11609 0.0 0.5 224640 11064 ? S 18:45 0:00 /usr/bin/php5-cgi
vu2010 15366 0.0 1.4 232716 29784 ? S 08:35 0:00 /usr/bin/php5-cgi
vu2010 15367 0.0 1.1 229160 23736 ? S 08:35 0:00 /usr/bin/php5-cgi
vu2016 15372 0.0 1.6 239448 34884 ? S 15:21 0:00 /usr/bin/php5-cgi
vu2016 15373 0.0 1.3 237416 27892 ? S 15:21 0:00 /usr/bin/php5-cgi
vu2010 15380 0.0 1.4 231964 29888 ? S 15:21 0:00 /usr/bin/php5-cgi
vu2010 15381 0.0 1.0 228912 22952 ? S 15:21 0:00 /usr/bin/php5-cgi
vu2010 15674 0.0 1.2 228072 27100 ? S 00:55 0:00 /usr/bin/php5-cgi
vu2010 15675 0.0 1.5 235532 33056 ? S 00:55 0:00 /usr/bin/php5-cgi
vu2010 15743 0.0 1.3 232488 28280 ? S 00:55 0:00 /usr/bin/php5-cgi
vu2010 15744 0.0 1.5 236292 32708 ? S 00:55 0:00 /usr/bin/php5-cgi
vu2010 16026 0.0 0.6 225428 13232 ? S 17:25 0:00 /usr/bin/php5-cgi
vu2010 16027 0.0 0.5 224636 11044 ? S 17:25 0:00 /usr/bin/php5-cgi
vu2012 16297 0.0 1.9 239340 39880 ? S 00:56 0:00 /usr/bin/php5-cgi
vu2012 16298 0.0 0.2 223200 5672 ? S 00:56 0:00 /usr/bin/php5-cgi
nobody 17858 0.0 0.2 78708 5248 ? Ss 19:50 0:00 proftpd: (accepting connections)
vu2010 20015 0.0 1.2 231940 25540 ? S 07:01 0:00 /usr/bin/php5-cgi
vu2010 20017 0.0 1.1 227648 23540 ? S 07:01 0:00 /usr/bin/php5-cgi
vu2010 22108 0.0 1.4 232480 30312 ? S 04:40 0:00 /usr/bin/php5-cgi
vu2012 22166 0.0 2.1 242424 45100 ? S 08:00 0:00 /usr/bin/php5-cgi
vu2012 22168 0.0 1.2 230976 25320 ? S 08:00 0:00 /usr/bin/php5-cgi
vu2010 22171 0.0 0.2 223200 5676 ? S 04:40 0:00 /usr/bin/php5-cgi
vu2010 24200 0.0 0.9 225720 20572 ? S 19:30 0:00 /usr/bin/php5-cgi
vu2010 24201 0.0 0.5 224640 11072 ? S 19:30 0:00 /usr/bin/php5-cgi
vu2010 24308 0.0 1.3 234032 27656 ? S 13:17 0:00 /usr/bin/php5-cgi
vu2010 24310 0.0 1.1 227628 23704 ? S 13:17 0:00 /usr/bin/php5-cgi
vu2010 24551 0.0 0.6 225436 13244 ? S 18:50 0:00 /usr/bin/php5-cgi
vu2010 24552 0.0 0.5 224644 11048 ? S 18:50 0:00 /usr/bin/php5-cgi
root 24556 0.0 5.1 407520 108968 ? Ss 13:50 0:14 /usr/sbin/apache2 -k graceful
vu2010 28151 0.0 1.3 233284 29308 ? S 06:43 0:00 /usr/bin/php5-cgi
vu2010 28153 0.0 0.2 223200 5676 ? S 06:43 0:00 /usr/bin/php5-cgi
root 29840 0.0 0.1 20996 2484 ? Ss Apr21 0:01 /usr/sbin/syslog-ng -p /var/run/syslog-ng.pid
root 29871 0.0 0.0 48856 1196 ? Ss Apr21 0:00 /usr/sbin/sshd
amavis 29917 0.0 1.8 124052 37940 ? Ss Apr21 0:00 amavisd (master)
root 29945 0.0 0.0 17312 1448 ? S Apr21 0:00 /bin/sh /usr/bin/mysqld_safe
amavis 29955 0.0 1.7 125252 37400 ? S Apr21 0:00 amavisd (virgin child)
amavis 29958 0.0 1.7 125252 37384 ? S Apr21 0:00 amavisd (virgin child)
mysql 30019 0.0 1.3 156960 29160 ? Sl Apr21 0:09 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
root 30020 0.0 0.0 3772 588 ? S Apr21 0:00 logger -p daemon.err -t mysqld_safe -i -t mysqld
nobody 30145 0.0 1.2 90604 26716 ? S Apr21 0:00 perl assp.pl
vu2010 30253 0.0 1.1 227800 24276 ? S 17:30 0:00 /usr/bin/php5-cgi
vu2010 30255 0.0 1.5 234052 32976 ? S 17:30 0:00 /usr/bin/php5-cgi
vu2010 30582 0.0 1.3 232200 27764 ? S 14:05 0:00 /usr/bin/php5-cgi
vu2010 30583 0.0 1.1 228440 24692 ? S 14:05 0:00 /usr/bin/php5-cgi
clamav 30613 0.0 6.4 163420 134624 ? Ssl Apr21 0:11 /usr/sbin/clamd
vu2012 31793 0.0 2.1 243664 44872 ? S 17:28 0:00 /usr/bin/php5-cgi
vu2012 31794 0.0 0.2 223200 5672 ? S 17:28 0:00 /usr/bin/php5-cgi
clamav 31829 0.0 0.0 25756 1412 ? Ss Apr21 0:00 /usr/bin/freshclam -d --quiet
root 31833 0.0 0.0 6052 460 ? S Apr21 0:00 /usr/sbin/courierlogger -pid=/var/run/courier/authdaemon/pid -start /usr/lib/courier/courier-authlib/authdaemond
root 31835 0.0 0.0 21624 728 ? S Apr21 0:00 /usr/lib/courier/courier-authlib/authdaemond
root 31843 0.0 0.0 6052 460 ? S Apr21 0:00 /usr/sbin/courierlogger -pid=/var/run/courier/imapd.pid -start -name=imapd /usr/sbin/couriertcpd -address=0 -maxprocs=40 -maxperip=20 -nodnslookup -noidentlookup 143 /usr/lib/courier/courier/imaplogin /usr/bin/imapd Maildir
root 31844 0.0 0.0 9228 684 ? S Apr21 0:00 /usr/sbin/couriertcpd -address=0 -maxprocs=40 -maxperip=20 -nodnslookup -noidentlookup 143 /usr/lib/courier/courier/imaplogin /usr/bin/imapd Maildir
root 31847 0.0 0.0 21628 624 ? S Apr21 0:00 /usr/lib/courier/courier-authlib/authdaemond
root 31874 0.0 0.0 6052 460 ? S Apr21 0:00 /usr/sbin/courierlogger -pid=/var/run/courier/pop3d.pid -start -name=pop3d /usr/sbin/couriertcpd -maxprocs=40 -maxperip=4 -nodnslookup -noidentlookup -address=0 110 /usr/lib/courier/courier/courierpop3login /usr/lib/courier/courier/courierpop3d Maildir
root 31875 0.0 0.0 9228 684 ? S Apr21 0:00 /usr/sbin/couriertcpd -maxprocs=40 -maxperip=4 -nodnslookup -noidentlookup -address=0 110 /usr/lib/courier/courier/courierpop3login /usr/lib/courier/courier/courierpop3d Maildir
root 31893 0.0 0.0 6052 460 ? S Apr21 0:00 /usr/sbin/courierlogger -pid=/var/run/courier/pop3d-ssl.pid -start -name=pop3d-ssl /usr/sbin/couriertcpd -address=0 -maxprocs=40 -maxperip=4 -nodnslookup -noidentlookup 995 /usr/bin/couriertls -server -tcpd /usr/lib/courier/courier/courierpop3login /usr/lib/courier/courier/courierpop3d Maildir
root 31894 0.0 0.0 9228 680 ? S Apr21 0:00 /usr/sbin/couriertcpd -address=0 -maxprocs=40 -maxperip=4 -nodnslookup -noidentlookup 995 /usr/bin/couriertls -server -tcpd /usr/lib/courier/courier/courierpop3login /usr/lib/courier/courier/courierpop3d Maildir
root 31899 0.0 0.0 21628 624 ? S Apr21 0:00 /usr/lib/courier/courier-authlib/authdaemond
root 31900 0.0 0.0 21628 624 ? S Apr21 0:00 /usr/lib/courier/courier-authlib/authdaemond
root 31901 0.0 0.0 21628 624 ? S Apr21 0:00 /usr/lib/courier/courier-authlib/authdaemond
root 31902 0.0 0.0 21628 624 ? S Apr21 0:00 /usr/lib/courier/courier-authlib/authdaemond
root 31995 0.0 0.4 74612 8956 ? S Apr21 0:41 python /usr/sbin/denyhosts --daemon --purge --config=/etc/denyhosts.conf --config=/etc/denyhosts.conf
root 32012 0.0 0.0 10124 668 ? Ss Apr21 0:00 /usr/sbin/inetd
root 32348 0.0 0.1 36832 2336 ? Ss Apr21 0:00 /usr/lib/postfix/master
postfix 32356 0.0 0.1 38936 2388 ? S Apr21 0:00 qmgr -l -t fifo -u
root 32368 0.0 0.1 53640 2956 ? Ss 19:49 0:00 sshd: root@notty
root 32373 0.0 0.0 17260 1380 ? Ss 19:49 0:00 -bash
root 32382 0.0 0.1 27092 3344 ? Ss Apr21 0:00 /usr/bin/perl /usr/local/bin/proplay_resdaemon.pl
112 32575 0.0 0.0 76252 1992 ? SNl Apr21 0:01 /usr/lib/teamspeak-server/teamspeak-server.real -ini=/etc/teamspeak-server/server.ini -log=/var/log/teamspeak-server.log -db=/var/lib/teamspeak-server/sqlite.db -sql=/usr/share/teamspeak-server/sql/sqlite/ -badnames=/var/lib/teamspeak-server/badnames -httpdocs=/usr/share/teamspeak-server/httpdocs/ -tcpquerydocs=/usr/share/teamspeak-server/tcpquerydocs/ -pid=/var/run/teamspeak-server.pid
ntp 32620 0.0 0.0 22372 1412 ? Ss Apr21 0:00 /usr/sbin/ntpd -p /var/run/ntpd.pid -u 102:104 -g
root 32647 0.0 0.0 18540 940 ? Ss Apr21 0:00 /usr/sbin/cron
root 32680 0.0 0.0 3772 456 ? S Apr21 0:00 /var/www/ispcp/daemon/ispcp_daemon -p /var/run/ispcp_daemon.pid
Apache2.conf
### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE! If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation (available
# at <URL:http://httpd.apache.org/docs-2.1/mod/mpm_common.html#lockfile>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
ServerRoot "/etc/apache2"
#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
#<IfModule !mpm_winnt.c>
#<IfModule !mpm_netware.c>
LockFile /var/lock/apache2/accept.lock
#</IfModule>
#</IfModule>
#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300
#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive no
#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 50
#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 2
##
## Server-Pool Size Regulation (MPM specific)
##
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
StartServers 1
MinSpareServers 4
MaxSpareServers 4
ServerLimit 30
MaxClients 30
MaxRequestsPerChild 0
</IfModule>
# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
StartServers 1
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>
# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
#
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value. If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain
#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog /var/log/apache2/error.log
#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn
# Include module configuration:
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf
# Include all the user configurations:
Include /etc/apache2/httpd.conf
# Include ports listing
Include /etc/apache2/ports.conf
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
#
# Define an access log for VirtualHosts that don't define their own logfile
CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined
#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#
#
# Putting this all together, we can internationalize error responses.
#
# We use Alias to redirect any /error/HTTP_<error>.html.var response to
# our collection of by-error message multi-language collections. We use
# includes to substitute the appropriate text.
#
# You can modify the messages' appearance without changing any of the
# default HTTP_<error>.html.var files by adding the line:
#
# Alias /error/include/ "/your/include/path/"
#
# which allows you to create your own set of files by starting with the
# /usr/share/apache2/error/include/ files and copying them to /your/include/path/,
# even on a per-VirtualHost basis. The default include files will display
# your Apache version number and your ServerAdmin email address regardless
# of the setting of ServerSignature.
#
# The internationalized error documents require mod_alias, mod_include
# and mod_negotiation. To activate them, uncomment the following 30 lines.
# Alias /error/ "/usr/share/apache2/error/"
#
# <Directory "/usr/share/apache2/error">
# AllowOverride None
# Options IncludesNoExec
# AddOutputFilter Includes html
# AddHandler type-map var
# Order allow,deny
# Allow from all
# LanguagePriority en cs de es fr it nl sv pt-br ro
# ForceLanguagePriority Prefer Fallback
# </Directory>
#
# ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
# ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
# ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
# ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
# ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
# ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
# ErrorDocument 410 /error/HTTP_GONE.html.var
# ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
# ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
# ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
# ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
# ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
# ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
# ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
# ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
# ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
# ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.
# Include generic snippets of statements
Include /etc/apache2/conf.d/
# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/
<IfModule mod_evasive.c>
#DOSHashTableSize gibt die Größe der Hashtabelle in Bytes an
DOSHashTableSize 3097
#DOSPageCount gibt die Anzahl der Seitenaufrufe eines Clients pro DOSPageInterval-Zeitintervall
DOSPageCount 100
#DOSSiteCount gibt die Anzahl der Seitenaufrufe auf einen Child-Prozess pro DOSSiteInterval-Zeitintervall
DOSSiteCount 100
#DOSPageIntervall und DOSSiteInterval werden in Sekunden angegeben
DOSPageInterval 15
DOSSiteInterval 15
#DOSBlockingPeriod gibt die Sperrzeit in Sekunden an
DOSBlockingPeriod 6000
#DOSEmailNotify gibts die eMail Adresse an, an welche eine Warnmail geschickt wird
DOSEmailNotify #############
#DOSSystemCommand führt bei einem Angriff weitere Programme/Scripte aus wenn gewünscht
#DOSSystemCommand "su - someuser -c '/sbin/... %s ...'"
#DOSLogDir gibt das Verzeichnis an in dem das Modul seine Lock-Datei schreibt
#Achtung: der Ordner sollte nur f�r root erreichbar sein
DOSLogDir "/var/lock/mod_evasive"
#DOSWhitelist beinhaltet eine Aufzählung aller IP-Adressen für die mod_evasive NICHT gilt
#DOSWhitelist 127.0.0.1
</IfModule>
# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
StartServers 1
MinSpareServers 2
MaxSpareServers 4
ServerLimit 30
MaxClients 30
MaxRequestsPerChild 800
</IfModule>
My.cnf
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#
# * Fine Tuning
#
key_buffer = 2M
net_buffer_length = 4K
sort_buffer_size = 16K
myisam_sort_buffer_size = 16K
read_buffer_size = 8K
read_rnd_buffer_size = 16K
join_buffer_size = 256K
query_cache_size = 1M
thread_cache = 20
table_cache = 256
max_allowed_packet = 128K
max_connections = 30
low_priority_updates = 1
long_query_time = 2
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
#log = /var/log/mysql/mysql.log
#
# Error logging goes to syslog. This is a Debian improvement
#
# Here you can see queries with especially long duration
log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
#server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 3
max_binlog_size = 20M
binlog_do_db = include_database_name
binlog_ignore_db = include_database_name
#
# * BerkeleyDB
#
# Using BerkeleyDB is now discouraged as its support will cease in 5.1.12.
skip-bdb
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
# You might want to disable InnoDB to shrink the mysqld process by circa 100MB.
#skip-innodb
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem
[mysqldump]
quick
quote-names
max_allowed_packet = 8M
[mysql]
no-auto-rehash # faster start of mysql but no tab completition
[isamchk]
key_buffer = 8M
#
# * NDB Cluster
#
# See /usr/share/doc/mysql-server-*/README.Debian for more information.
#
# The following configuration is read by the NDB Data Nodes (ndbd processes)
# not from the NDB Management Nodes (ndb_mgmd processes).
#
# [MYSQL_CLUSTER]
# ndb-connectstring=127.0.0.1
#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
Serverdaten:
2 GB RAM
20 GB HDD
Intel I7 920
Habe den Server von einem Freund übernommen, nur ist mir aufgefallen das ständig Prozesse wegen RAM Mangels ausgehen.
Tuning-Primer-Script lief bereits, es scheint ja auch eher am apachen zu liegen.
Was kann ich machen?
Gruß,
Rene
Last edited by a moderator: