Tag: Apache

Apache Access Logs to MySQL Database

Apache Access Logs

Centralising Apache logs can be useful in many scenarios. Let’s get the basics 1st. So Apache logs can be defined as

In order to effectively manage a web server, it is necessary to get feedback about the activity and performance of the server as well as any problems that may be occuring. The Apache HTTP Server provides very comprehensive and flexible logging capabilities.
Today we’ll setup Apache to log each access request to MySQL database rather than storing it in a flat file. Unlike logging to a flat text file, a SQL-based log exhibits tremendous flexibility and power of data extraction. Let’s dive in.

and Apache access logs can be defined as

The server access log records all requests processed by the server. The location and content of the access log are controlled by the CustomLog directive.

Today let’s see how to setup Apache to use MySQL to store the all the logs. Apache access logs will be sent to MySQL database through the Apache log module.

Apache Access Logs to MySQL

Apache Access Logs to MySQL

– Read More –

Apache with mod_proxy as a reverse proxy

So mod_proxy

This module implements a proxy/gateway for Apache. It implements proxying capability for AJP13 (Apache JServe Protocol version 1.3), FTP, CONNECT (for SSL), HTTP/0.9, HTTP/1.0, and HTTP/1.1. The module can be configured to connect to other proxy modules for these and other protocols.

This post also can be named as “How to setup a proxy passer(ProxyPass, ProxyPassReverse) in Apache2” because today we are going to look at is how to setup mod_proxy as a reserve proxy in your linux environment. You might be wondering what’s the difference between a forward proxy server and a reverse proxy server? the answer is here. There could be many situation where you want to set up a reserver proxy, couple of them are mentioned below.

  • Front an application server as tomcat or JBoss with Apache
  • Application running on a different port other than 80 or 443(we usually only expose 80 or 443 to the public)
  • Mask the underlying server/Stop direct access to the underlying server

If you are more info on why Apache should be used in front of JBoss/Glassfish/Tomcat? Check this link out. Below image depicts what we are going to do today.

Reserve proxy

Reserve proxy example, Image courtesy : stackoverflow.com

– Read More –

monit

What? How? Why? When? Monit

What Monit?

Let me explain about the utility. It has the ability to start a process if it is not running, restart a process if not responding and stop a process if uses high resources. In simple words it’s a helpful program that automatically monitors and manages server programs/resources to ensure that they stay online 24/7 while maintaining the correct file size, checksum and permissions. It’s important system monitoring tool anyone would like to have in their mission critical systems. With the web interface given you could see what’s going on with your system. In this article I’ll be covering end-to-end and providing you value links to be bookmarked in your browser(tongue-out-face).
– Read More –

Hardening & Securing Apache HTTP Server

How’s it going people? Everyone wants 100% secure applications but the problem is do 100% applications exist in the world? Answer is ‘Nope’. That’s bad but you can secure your application up to a certain extend by applying security. Hope you have read my last two articles on PHP Security. Article 1 & Article 2 where you can apply security at the application level. it’s time for you to read them before proceeding.

Today we are going to look at how to secure your Apache web server by adding security to it. Once you apply these configuration in your Apache web server you will be able to live safely. Let’s make the world a better place.

Note : Once make changes to your Apache configuration file(/etc/apache/apache2.conf) you should restart Apache web server using below command. 

– Read More –

Apache Load Balacing with HAProxy

As I said earlier loading balancing is a hot topic when it comes to High Availability(HA). So here goes the 2nd post on HAProxy. Let’s distribute the workload among server using our favorite load balancer HAProxy. If you didn’t read the 1st post on MySQL load balancing with HAProxy it’s time now or never. Today we are going to take a look at Apache(Application server) loading balancing with HAProxy.

What’s HAProxy

HAProxy is a free, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. It is particularly suited for very high traffic web sites and
powers quite a number of the world’s most visited ones.

Server Setup

Server 1 – Node 1
Hostname: apache-1
IP: 192.ABC.X.31

Server 2 – Node 2
Hostname: apache-2
IP: 192.ABC.Y.32

Server 3 – Load Balancer
Hostname: haproxy
IP: 192.ABC.Z.30

Apache load balancing with HAProxy

Apache load balancing with HAProxy

– Read More –

Older Posts