Showing posts with label apache. Show all posts
Showing posts with label apache. Show all posts
Tuesday, November 10, 2009
Friday, August 14, 2009
slowloris ddos aversion
use Nginx and openBSD/pf to protect Apache.
http://nginx.net/
here's some configuration help.
https://calomel.org/nginx.html
http://nginx.net/
here's some configuration help.
https://calomel.org/nginx.html
Labels:
apache,
openbsd,
security,
slowloris,
system hardening
Tuesday, August 11, 2009
Slowloris DDOS prevention
#!/bin/sh
LIMIT=100
COMMAND='netstat -n | egrep '\''tcp.*[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*:(80|443)[ ]*[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*:[0-9]*[ ]*ESTABLISHED
'\'' | awk -F'\''[ \t:]+'\'' '\''{ print $6 }'\'''
eval $COMMAND | sort | uniq -c | while read numconn ip
do
if [ $numconn -gt $LIMIT ]
then
echo "Check ASAP and renable this cron." | mail -s "IP $ip - ($numconn) went over $LIMIT connections on `hostname`" me@someemailaddress.com
sed -i 's/\(^\*.*this_script.sh*\)/#\1/g' /etc/crontab
# /sbin/iptables -I INPUT -s $ip -j DROP
fi
done
LIMIT=100
COMMAND='netstat -n | egrep '\''tcp.*[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*:(80|443)[ ]*[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*:[0-9]*[ ]*ESTABLISHED
'\'' | awk -F'\''[ \t:]+'\'' '\''{ print $6 }'\'''
eval $COMMAND | sort | uniq -c | while read numconn ip
do
if [ $numconn -gt $LIMIT ]
then
echo "Check ASAP and renable this cron." | mail -s "IP $ip - ($numconn) went over $LIMIT connections on `hostname`" me@someemailaddress.com
sed -i 's/\(^\*.*this_script.sh*\)/#\1/g' /etc/crontab
# /sbin/iptables -I INPUT -s $ip -j DROP
fi
done
Friday, December 5, 2008
Apache Worker vs. Prefork
This is a good post.
http://www.camelrichard.org/apache-prefork-vs-worker
Good Hints:
Worker is superior in 2+ cpu applications
Compile PHP5 after installing Apache
http://www.camelrichard.org/apache-prefork-vs-worker
Good Hints:
Worker is superior in 2+ cpu applications
Compile PHP5 after installing Apache
Labels:
apache,
operations,
system administration,
web servers
Monday, November 17, 2008
How to set up Apache, MySQL and PHP on FreeBSD
# cd /usr/ports/www/apache13-modssl
# make install
# echo 'apache_enable ="YES"' >> /etc/rc.conf
# echo 'apache_flags ="-DSSL"' >> /etc/rc.conf
# echo 'mysql_enable ="YES"' >> /etc/rc.conf
# /usr/local/etc/rc.d/mysql-server start
# mysqladmin -u root password newpassword
# cd /usr/ports/www/mod_php4
# make install clean
# cd /usr/ports/lang/php4-extensions
# make install clean
# vi /usr/local/etc/apache/httpd.conf
AddType application/x- httpd-php . php
AddType application/x- httpd-php-source . phps
# /usr/local/etc/rc.d/apache.sh start
# whoami
root
# cd ~
# openssl genrsa -des3 -out server.key 1024
# openssl req -new -key server.key -out server.csr
# openssl x509 -req -days 365 \
-in /root/server.csr \
-signkey /root/server.key \
-out /root/server.crt
# cp ~/ ./server.key /usr/local/etc/apache/ssl.key/
# cp ~/ ./server.crt /usr/local/etc/apache/ssl.crt/
Labels:
apache,
freebsd,
mysql,
php,
system administration
Subscribe to:
Posts (Atom)