2008年6月27日 星期五

Reverse proxy


A reverse proxy dispatches in-bound network traffic to a set of servers, presenting a single interface to the caller.


mod_proxy.c for Apache Ver 2.2
Forward Proxy
ProxyRequests On
ProxyVia On
<Proxy *>
Order deny,allow
Deny from all
Allow from internal.example.com
</Proxy>

Reverse Proxy
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /foo http://foo.example.com/bar
ProxyPassReverse /foo http://foo.example.com/bar

There are several reasons for installing reverse proxy servers:


  • Security: the proxy server may provide an additional layer of defense by separating or masquerading the type of server that is behind the reverse proxy. This configuration may protect the servers further up the chain - mainly through obfuscation.
    Encryption / SSL acceleration: when secure websites are created, the SSL encryption is sometimes not done by the Web server itself, but by a reverse proxy that is equipped with SSL acceleration hardware.

  • Load distribution: the reverse proxy can distribute the load to several servers, each server serving its own application area. In the case of reverse proxying in the neighborhood of Web servers, the reverse proxy may have to rewrite the URLs in each webpage (translation from externally known URLs to the internal locations).

  • Caching static content: A reverse proxy can offload the Web servers by caching static content, such as images. Proxy caches of this sort can often satisfy a considerable amount of website requests, greatly reducing the load on the central web server. Sometimes referred to as a Web accelerator.

  • Compression: the proxy server can optimize and compress the content to speed up the load time.

  • Spoon feeding: a dynamically generated page can be produced all at once and served to the reverse-proxy, which can then return it to the client a little bit at a time. The program that generates the page is not forced to remain open and tying up server resources during the possibly extended time the client requires to complete the transfer.

2008年6月18日 星期三

Using NFS - (Solaris)

The first thing to ensure is that the proper daemons for running NFS are started. If unsure, I will typically just run them when I cannot determine whether or not they are running:

$ su -
$ cd /usr/lib/nfs
$ ./mountd
$ ./nfsd


Sharing A File System
The following example will share a file system /software so that others may be able to mount it:
# share /software
If I want to check all file systems being shared from my system:
# share
- /software rw ""


How to NFS A File System
Now, from another machine, I want to NFS the file system that is being shared above:
# mount -F nfs alex:/software /mnt/software

How to Unmount an NFS File System
Finally, let's unmount the previously mounted file system:
# umount /mnt/software

nfs mount: mount: /sharepoint: Not owner

When trying to mount a share from a Linux server (RHEL5) Solaris (10) issues this very useful message:
bash-3.00# mount server:/nfsshare /sharepoint
nfs mount: mount: /sharepoint: Not owner

This appears to be an issue with NFS v4 on Linux and Solaris 10. To fix this edit:
/etc/default/nfs
and change
#NFS_CLIENT_VERSMAX=4
to
NFS_CLIENT_VERSMAX=3

Or of one time mounts simply add the following to the command line
mount -o vers=3 server:/nfsshare /sharepoint