Posted by: mahinctg | January 26, 2012

Reverse Proxy with Apache VirtualHost

This example will show you how to configure Reverse Proxy with Apache Virtual Hosting. This is in addition to my last Reverse Proxy post.

########################

NameVirtualHost *:80

<VirtualHost *:80>
ServerAdmin abc@xyz.com
DocumentRoot /var/www/html/
ServerName abc.xyz.com
</VirtualHost>

<VirtualHost *:80>
ServerAdmin abc@xyz.com
ServerName revprx.xyz.com

<Proxy *>
Order allow,deny
Allow from all
</Proxy>

ProxyPass / http://192.168.105.5/ nocanon
ProxyPassReverse / http://192.168.105.5/

</VirtualHost>

##########

This way you can have any Number of Virtual Host with Local Content and also with Reverse Proxy enabled. Hope this Helps.

If you are using Squid in Transparent mode you can use many features to restrict your users. I’ll tell you about 2 scenarios with example.

1) You want Block some IP’s to restrict access to some specific sites. Please follow this steps to do that :

Add this Lines to your Squid.conf File.

acl block_ip src “/usr/local/src/block_ip”

acl block_ip_site url_regex “/usr/local/src/block_ip_site”

http_access deny block_ip block_ip_site

Now create /usr/local/src/block_ip file with the IP address you want to restrict. Put one IP in each line. Also create /usr/local/src/block_ip_site file with the Site URL you want to restrict. Put one URL in each line. Now Restart Squid service and see the rules working as you configured.

2) You want Allow some IP’s to allow access to some specific sites. Please follow this steps to do that :

Add this Lines to your Squid.conf File.

acl allow_ip src “/usr/local/src/allow_ip”

acl allow_ip_site url_regex “/usr/local/src/block_ip_allow”

http_access allow allow_ip allow_ip_site

Now create /usr/local/src/allow_ip file with the IP address you want to allow. Put one IP in each line. Also create /usr/local/src/allow_ip_site file with the Site URL you want to allow. Put one URL in each line. Now Restart Squid service and see the rules working as you configured.

Posted by: mahinctg | November 26, 2011

Apache Reverse Proxy

A reverse proxy is a gateway for servers, and enables one web server to provide content from another transparently. So if you have Internal Web Applications running on your Intranet but you want to access them from Outside then you can use this. But your Apache Server need to have access of your LAN and also Internet so that it can be reached from outside. In recent Apache Versions this feature is already there. Please make sure that in your Apache configuration this modules are loaded :

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_http_module modules/mod_proxy_http.so

Then you are good to go. Next Step is configuring your Apache for Reverse Proxy. For example www.revproxy.com is your Apache server which is accessible from internet and this server also has access to your local server where your Web application is running like http://192.168.200.2/webapps. Now we will configure Apache so that Users from internet can access the local webapps via http://www.revproxy.com/webapps. Please edit your httpd.conf file and add this lines. You might have to modify as per your requirement.

## Reverse Proxy for WebApps ##
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order allow,deny
Allow from all
</Proxy>

ProxyPass /webapps http://192.168.200.2/webapps
ProxyPassReverse /webapps http://192.168.200.2/webapps

###############################

Now restart HTTP service and browse http://www.revproxy.com/webapps. You will get the webapps from http://192.168.200.2/webapps

Posted by: mahinctg | August 24, 2011

Active Directory Objects Restore

I have accidentally deleted one of my Users Computer from the Active Directory Domain & Computer list. As a result the user was having problem. To me the best solution was to rejoin that user to the Domain again. But I then started looking for alternative solutions and found out that what u remove from Active Directory is not deleted right away rather it’s just Marked as deleted. I found out a cool tool to recover such objects to the active state. U can download the tool from here Quest Object Restore for Active Directory.msi

## Identify the Secondary Name Server
On the primary DNS server, identify an additional name server. To do this, follow these steps:
1. Click Start, point to Administrative Tools, and then click DNS.
2. In the console tree, expand Host name (where Host name is the host name of the DNS server).
3. In the console tree, expand Forward Lookup Zones.
4. Right-click the zone that you want (for example, example.com), and then click Properties.
5. Click the Name Servers tab, and then click Add.
6. In the Server fully qualified domain name (FQDN) box, type the host name of the server that
you want to add.
For example, type namesvr2.example.com.
7. In the IP address box, type the IP address of the name server that you want to add (for
example, 192.168.0.22), and then click Add.
8. Click OK, and then click OK.
9. In the console tree, click Reverse Lookup Zones, right-click the zone that you want, and then
click Properties.
10. Click the Name Servers tab, and then click Add.
11. In the Server name box, type the host name of the server that you want to add.
For example, namesvr2.example.com.
12. In the IP address box, type the IP address of the name server that you want to add (for
example, 192.168.0.22), and then click Add.
13. Click OK two times.

## Install DNS on the Secondary Name Server
To install the DNS service, follow these steps:
1. Log on to the computer as an administrator.
2. Click Start, point to Control Panel, and then click Add or Remove Programs.
3. Click Add\Remove Windows Components.
4. In the Components list, click Networking Services (do not click to select or click to clear thecheck box), and then click Details.
5. Click to select the Domain Name System (DNS) check box, and then click OK.
6. On the Windows Components page, click Next.
7. Insert the Windows 2003 Server CD when you are prompted, and then click OK.
8. On the Completing the Windows Components Wizard page, click Finish.
9. Click Close.
DNS is now installed. To start the DNS snap-in, click Start, point to Administrative Tools, and
then click DNS.

## Configure the Forward Lookup Zone
To configure the forward lookup zone on the secondary name server, follow these steps:
1. Log on to the secondary name server as an administrator.
2. Click Start, point to Administrative Tools, and then click DNS.
3. In the console tree, under DNS, click Host name (where Host name is the host name of the
DNS server).
4. In the console tree, click Forward Lookup Zones.
5. Right-click Forward Lookup Zones, and then click New Zone.
6. When the New Zone Wizard starts, click Next to continue.
7. Click Secondary Zone, and then click Next.
8. In the Name box, type the name of the zone (for example, example.com), and then click Next.
9. On the Master DNS Servers page, type the IP address of the primary name server for this
zone, click Add, click Next, and then click Finish.

## Configure the Reverse Lookup Zone
To configure the reverse lookup zone on the secondary name server, follow these steps:
1. Click Start, point to Administrative Tools, and then click DNS.
2. In the console tree, click Host name (where Host name is the host name of the DNS server).
3. In the console tree, click Reverse Lookup Zones.
4. Right-click Reverse Lookup Zones, and then click New Zone.
5. When the New Zone Wizard starts, click Next to continue.
6. Click Secondary zone, and then click Next.
7. In the Network ID box, type the network ID (for example, type 192.168.0), and then click
Next.
8. On the Zone File page, click Next, and then click Finish.

Posted by: mahinctg | January 27, 2011

Installing Microsoft Windows XP from USB Drive

For Installing Windows in EEE/Netbooks you need to have an External USB CD/DVD Rom or a Pen Drive with XP Setup on it. You have to follow some steps in order to make a USB Drive Bootable with Windows XP Setup.

It is better if you have a 2GB Pen drive other wise what you can do in Format your Larger Pen Drive with the PEtoUSB program. Else your Pen Drive will not be recognized as a valid boot device. Please Download the Needed Files from Here (Please rename the file from .doc to .zip and then extract). USB MultiBoot

Extract the files and Plugin your Pen Drive in the PC and run USB_MultiBoot_10.cmd from the Extracted files. In the First Option Selection menu Please select  “P) PeToUSB – FAT Format – Max 2 GB”. This will run the PEtoEXE program and Format the Disk and then close the program. Then select  ”1) Give XP Setup Source Path = [I:\]” and browse and locate your Windows XP Setup Folder. Then select “ 2) Give USB-Drive Target, currently []” and browse and select your FAT16 formatted USB Drive. Then select “3) Make MultiBoot and Copy Sources to USB-Drive”. The Program will start Copying XP setup files to the USB Drive and will also make it bootable. Please wait for the Copying process to finish. It might take 10/20 min to copy all the file. When the program finishes it’s work you have a USB Drive which is bootable and Windows XP Setup on it.

Boot your EEE/Netbook using the USB Drive and first select the 1) Text Mode Installation option for the first time. Once after the File Copy your system will reboot and then please select 2-3) GUI Setup mode and continue Windows XP Setup. Please do not Remove the USB Drive untill your Windows XP Setup is fully finished.

Posted by: mahinctg | January 1, 2010

Bangladesh DST Rollback in CentOS/RHEL

You can use this Zone file for the Rollback of DST time from 1st January 2010. This also Comply with Our Latest Govt. Decision of Having DST for 7 month from Now onward which means you dont have to change anything when the DST is again applied on 32st March. Download the Dhaka.doc file and rename it to Dhaka then Copy it to your Linux server in /usr/share/zoneinfo/Asia and Issue this command after that

cp /usr/share/zoneinfo/Asia/Dhaka /etc/localtime

You are good to go….. :) Hope this Helps……

Posted by: mahinctg | December 16, 2009

Web Page Password Protection by htaccess

If you want to protect a WebPage with Password you can do it by htaccess. First edit your http.conf file and add the Directory where the webpage is residing. Example

<Directory “/var/www/html/soft”>
    AllowOverride AuthConfig
    Allow from all
</Directory>

Then go to the dir /var/www/html/soft and make a new file .htaccess with this lines in it.

AuthType Basic
AuthName “Password Required to Access this Page”
AuthUserFile /var/www/html/soft/.htpasswd
require valid-user

Then save the file. Now u need to create the UserID and password and store it in a .htpasswd file in that Dir. For this run this command while in the /var/www/html/soft/ Dir

htpasswd -c .htpasswd username

-c is used to create the .htpasswd file for the first time. After u execute the command it will ask for the password for the username u specified and store it in .htpasswd file. Now restart the http service and try to browse that Page, u will be asked for a password. Thats It………..

Posted by: mahinctg | October 17, 2009

Qmail Double Bounce

If you are using Qmail you have encountered this type of Bounce Messages “I tried to deliver a bounce message to this address, but the bounce bounced!”. You can get rid of such message following this process.

First Make an email id like dblbouncedel@yourdomain.com then make a file /var/qmail/control/doublebounceto with this line in it

dblbouncedel@yourdomain.com

Then make .qmail file in the under the dblbouncedel@yourdomain.com with this line in it :

|exit 0

Think this will solve your Double Bounce Problem.

Older Posts »

Categories

Follow

Get every new post delivered to your Inbox.