Showing posts with label debian. Show all posts
Showing posts with label debian. Show all posts

Tuesday, May 22, 2012

mod_rpaf install in debian

Its a module for Apache2 which takes the last IP from the 'X-Forwarded-For' header.
rpaf is short for reverse proxy add forward.
It changes the remote address of the client visible to other Apache modules when two conditions are satisfied. First condition is that the remote client is actually a proxy that is defined in httpd.conf. Secondly if there is an incoming X-Forwarded-For header and the proxy is in its list of known proxies it takes the last IP from the incoming X-Forwarded-For header and changes the remote address of the client in the request structure.
Module configuration is pretty simple, there are only two directives to set; RPAFenable and RPAFproxy_ips. With the later you can define which IP's are your frontend proxies that sends the correct X-Forwarded-For headers. If you do not use the RPAFproxy_ips directive then the module will not change the remote address of the incoming connection at any time. RPAFsethostname will, when enabled, take the incoming X-Host header and update the virtualhost settings accordingly.
# apt-get install libapache2-mod-rpafor
# aptitude install libapache2-mod-rpaf

After installing the above package please enable it:

# a2enmod rpaf# apache2ctl -t
# apache2ctl restart

The configuration file will be automatically be created at this location.
/etc/apache2/mods-available/rpaf.conf

Now, mod_rpaf will grab IP from X_FORWARDED_FOR header and place it in REMOTE_ADDR server variable.

Saturday, January 7, 2012

Configure Network Debian

Those who work in redhat flavour will find setting network in debian a bit tricky. Here is the simple and correct way of doing it.

Open the file: /etc/network/interfaces. This is the file where we can add single or muliple ips. I will show examples of how to do both and also to set via DHCP.

Setup interface to dhcp
auto eth0
iface eth0 inet dhcp

To add single IP
auto eth0
iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
gateway 192.168.1.254

To add multiple ips
auto eth0 eth0:1 eth0:2 eth0:3 eth0:4
iface eth0 inet static
    address 74.120.246.194
        netmask 255.255.255.192
        gateway 74.120.246.193
iface eth0:1 inet static
        address 74.120.246.195
        netmask 255.255.255.192
        gateway 74.120.246.193
iface eth0:2 inet static
        address 74.120.246.196
        netmask 255.255.255.192
        gateway 74.120.246.193
iface eth0:3 inet static
        address 74.120.246.197
        netmask 255.255.255.192
        gateway 74.120.246.193
iface eth0:4 inet static
        address 74.120.246.198
        netmask 255.255.255.192
        gateway 74.120.246.193




Friday, September 17, 2010

List top 10 Files or Directories Size Wise

Type the command below to see the files listed size wise from higher size files to lower size files.

-----------------
for X in $(du -s * | sort -nr | cut -f 2); do du -hs $X ; done
-----------------

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews