Sachin’s Weblog

September 11, 2007

Optimizing MySQL performance

Filed under: General, LAMP, MySQL, Performance — sachin @ 6:42 pm

Performance of any web application depends on several aspects, some times web server alone can cause a lot of performance diminution if not configured properly but the major concern for any web application performance degradation are the database. Lots of applications are constantly being developed and deployed using the LAMP (Linux, Apache, MySQL, PHP) architecture. Certainly the server administrator has little control over the application itself because it’s written by someone else but they still play a major role for any web application performance. Today i’m going to discuss another major performance issue, MySQL memory bottleneck.

Let’s start with estimating your web site response time, using curl
curl -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total} http://www.google.com/ (more…)

September 6, 2007

Advance Apache Security – mod_proxy,mod_security and mod_evasive

Filed under: Apache, General, HTTP Security, LAMP, Linux, Proxy, Proxy Server, Security, firewall — sachin @ 8:35 pm

Earlier to this post we have talked ’bout apache server installation for best performance and securing the server using tcp wrappers and iptables filrewall, let’s take the whole discussion one step further and talk ’bout application security hosted on your web server.

As more and more attacks are being carried out over the HTTP layer there is a growing need to push the envelope and bring Web security to new levels. Most existing tools work on the TCP/IP level, failing to use the specifics of the HTTP protocol in their operation. The need for increased security has lead to the creation of application gateways, tools that are essentially reverse proxies with the added capability of protocol analysis. Apache web server it self provides solution of the problem to a great extent, provided it’s loaded with some specific modules. (more…)

September 3, 2007

Configure Linux Box as Internet Gateway

Filed under: General, IPtables, Linux, Linux Router, Proxy Server — sachin @ 11:11 am

My last few post were ’bout Linux firewall and Network address translation using iptables. For me iptables is a very dynamic tool to configure things with Linux box, like free Linux firewall, transparent proxy and Linux router to share internet connection. So this post is ’bout configuring Linux box as a secure and safe internet gateway using iptables and squid.

You don’t need a hi-fi machine for the task, any low end machine could do good enough with two Network Interface Card installed on it. I’m always comfortable with fedora core so i used it again however any destro could do but then the steps here might need same changes, anyways i’ve used fedora core 6 i.e. latest kernel with iptables support. Once installed you are ready to configure Linux router on the system. (more…)

August 30, 2007

Linux firewall – iptables filtering

Filed under: General, IPtables, Linux, Security, firewall — sachin @ 12:21 pm

So after few basic steps about server security, let’s come to the real action part of the story, IPTABLES.

Iptables is a generic table structure that defines rules and commands as part of the netfilter framework that facilitates Network Address Translation (NAT), packet filtering, and packet mangling in the Linux 2.4 and later operating systems.

NAT is the process of converting an Internet Protocol address (IP address) into another IP address. Packet filtering is the process of passing or blocking packets at a network interface based on source and destination addresses, ports, or protocols. Packet mangling is the ability to alter or modify packets before and/or after routing. (more…)

August 19, 2007

Apache Log Rotation

Filed under: Apache, General, LAMP, Linux — sachin @ 7:47 am

The Apache access log file typically grows 1 MB or more per 10,000 requests. It will consequently be necessary to periodically rotate the log files by moving or deleting the existing logs. This cannot be done while the server is running, because Apache will continue writing to the old log file as long as it holds the file open. Instead, the server must be restared after the log files are moved or deleted so that it will open new log files. By using a graceful restart, the server can be instructed to open new log files without losing any existing or pending connections from clients. However, in order to accomplish this, the server must continue to write to the old log files while it finishes serving old requests. It is therefore necessary to wait for some time after the restart before doing any processing on the log files. A typical scenario that simply rotates the logs and compresses the old logs to save space is: (more…)

Apache Performance Tuning

Filed under: Apache, General, LAMP, Linux, Performance — sachin @ 7:29 am

After having a word ’bout solving memory leak by apache, let’s digg more ’bout the various apache performance issues. Apache server performance can be improved by adding additional hardware resources such as RAM, faster CPU etc. But most of the time, the same result can be achieved by custom configuration of the server. (more…)

Blog at WordPress.com.