Posts

Showing posts from December, 2010

Forwarding apache requests to Tomcat servlet container

Image
Most web applications todays are using favorite Apache web server for its proven architecture and free apache license. Tomcat is same as a very famous servlet container or java application server.  Although tomcat itself can be access as a simple web server, for production environments it may lack some features like load-balancing, redundancy, etc. So the best way to use is to integrate those two application, and finally its a great combination for enterprise applications for excess performance and ease of maintenance. The theory behind is to use a middle tier connector called mod_jk.so module which communicate using AJP(Apache JSer Protocol ) version 1.3, best of currently available stable version.See the following figure for graphical view. Here in this small steps guide i configure an Apache2 to a single instance of Tomcat6.Any comments and improvements are welcome at the end. installations: install apache2;Web server who list...

Enable Packet forwarding on for Internet Connection Sharing on Linux

Enable NATting for internet connection: ppp0-internet connected port add on startup or to /etc/init.d/rc.local sudo iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE Enable Packet accep for incoming requests: Edit following file and change/uncomment following line to enable packet forwarding for incoming request packets. /etc/sysctl.conf: net.ipv4.ip_forward = 1 to get control over the packet forwarding, we can forward all NATed packets to a local proxy server to disable direct packet forwarding, change /etc/sysctl.conf: net.ipv4.ip_forward = 0 then add an additional route; i don't know whether the sequence of following will affect, just check you guys ans let me know.... :-) iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128 iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

Approach to Multi Threaded Socket Communication

On this article i will introduce with socket connection on single server multiple clients,Single client multiple messages(transaction based continuous connection),Multiple client multiple transaction (per connection). I will proceed with two methods of threading (extend Thread and implement Runnable). Also at the requirement, i'll explain the use of synchronized shared objects and serialized data objects. This article is the extend of  basic-socket-programming   article on  www.chandpriyankara.tk / www.estudents.lk single server multiple clients This scenario is the most widely used socket communication in general.For example web servers.Many clients connects to the server requesting some data.The 3way TCP/IP handshake will initiate and identifies the two parties.Here, as regular, client who needs data wants to start the connection.Server or the data source must be up and running, waiting for a connection request form a client for a particular local ...

Basic Socket Programming

Image
Socket programming a is data exchange method used in electrical systems, specially within two or more(even itself) systems within a network reachability. Inter networked computers are widely using this method to transfer various data and information with remote systems.Socket programming, just up on the TCP layer, provides a mean of interprocess communication. In order to successful completion of the socket communication, all TCP/IP and lower layers need to be fully and correctly in functional. As this articel involved in explaining simple simple data transfer implementation we will limit the limit our scope into computer application programming with its simplest form. In order to exchange data within systems, there need to be at least two parties, who  Requires  some data to transfer to a  Listener  party. Who request to send data, or the one who initiate to connect is called the client. Who is ready to listen, and waiting for some one else to initiate a request...