Centos : Proxy server to handle multiple sub-domains

Proxy server to handle multiple sub-domains with http and https protocol

1. Edit host in proxy server (10.12.1.100)

    vi /etc/host and add the following sub-domains and IPs

    10.12.1.110               site1.myserver.com
    10.12.1.111               site2.myserver.com
    10.12.1.112               site3.myserver.com

2. Create a foo.conf file in the conf.d of your apache directory with following content.

    NameVirtualHost *: 80
    NameVirtualHost *: 443


# Proxy for http in site1.myserver.com
    ServerName site1.myserver.com
    ProxyPreserveHost on
    ProxyPass / http://site1.myserver.com/
    ProxyPassReverse / http://site1.myserver.com/
 
# Proxy for https in site1.myserver.com
    ServerName site1.myserver.com
    SSLEngine on
    SSLProxyEngine on
# ca.crt and ca.key generated in site1.myserver.com and copied to proxy server.
# In my case, i've stored it in /etc/pki/tls/site1/
    SSlCertificateFile /etc/pki/tls/site1/ca.crt
    SSlCertificateKeyFile /etc/pki/tls/site1/ca.key
    ProxyPreserveHost on
    ProxyPass / https://site1.myserver.com /
    ProxyPassReverse / https://site1.myserver.com/
     
# Proxy for http in site2.myserver.com
    ServerName site2.myserver.com
    ProxyPreserveHost on
    ProxyPass / http://site2.myserver.com/
    ProxyPassReverse / http://site2.myserver.com/   

# Proxy for https in site2.myserver.com
    ServerName site2.myserver.com
    SSLEngine on
    SSLProxyEngine on
# ca.crt and ca.key generated in site2.myserver.com and copied to proxy server.
# In my case, i've stored it in /etc/pki/tls/site2/
    SSlCertificateFile /etc/pki/tls/site2/ca.crt
    SSlCertificateKeyFile /etc/pki/tls/site2/ca.key
    ProxyPreserveHost on
    ProxyPass / https://site2.myserver.com/
    ProxyPassReverse / https://site2.myserver.com/ 

# Proxy for http in site3.myserver.com
    ServerName site3.myserver.com
    ProxyPreserveHost on
    ProxyPass / http://site3.myserver.com/
    ProxyPassReverse / http://site3.myserver.com/   
    

# Proxy for https in site3.myserver.com
    ServerName site3.myserver.com
    SSLEngine on
    SSLProxyEngine on
# ca.crt and ca.key generated in site3.myserver.com and copied to proxy server.
# In my case, i've stored it in /etc/pki/tls/site3/
    SSlCertificateFile /etc/pki/tls/site3/ca.crt
    SSlCertificateKeyFile /etc/pki/tls/site3/ca.key
    ProxyPreserveHost on
    ProxyPass / https://site3.myserver.com/
    ProxyPassReverse / https://site3.myserver.com/
  

3. Restart apache service and test the URL on your browser.   
   

Setting up SSL in CentOS

1. Getting the required software
yum install mod_ssl openssl  

2. Generate a self-signed certificate 

Generate private key 
openssl genrsa -out ca.key 1024 

Generate CSR (Fill up the prompt info accordingly) 
openssl req -new -key ca.key -out ca.csr 

Generate Self Signed Key 
openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt 

3. Move the generated files to correct locations 

mv ca.crt /etc/pki/tls/certs 
mv ca.key /etc/pki/tls/private/ca.key 
mv ca.csr /etc/pki/tls/private/ca.csr 

4. Update the Apache SSL config file 

vi +/SSLCertificateFile /etc/httpd/conf.d/ssl.conf 

and set Certificate Key and Key File stored location 
  
SSLCertificateFile /etc/pki/tls/certs/ca.crt 
SSLCertificateKeyFile /etc/pki/tls/private/ca.key

5. Restart your apache service 

service httpd restart 

If apache service failed with the following error,

Stopping httpd: [FAILED] 
Starting httpd: Syntax error on line 112 of /etc/httpd/conf.d/ssl.conf: SSLCertificateFile: file '/etc/pki/tls/certs/ca.crt' does not exist or is empty [FAILED] 

Run the following commands to fix it.

chcon --reference=/etc/pki/tls/certs/ca-bundle.crt /etc/pki/tls/certs/ca.crt 
chcon --reference=/etc/pki/tls/private/localhost.key /etc/pki/tls/private/ca.key 

6. Restart your apache service and you should be ok to proceed.

Zindus - Zimbra contact sync for Thunderbird

Zindus is used to sync contacts from thunderbird and google mail.

How to install Zindus in Thunderbird


1. Download Zindus add-on here
2. In thunderbird, open tools > addon and click install
3. Locate the add-on installer and click ok. Restart the thunderbird once installation completed

How to configure Zindus

1. Go to tools > zindus
2. It will open up the Zindus Configuration Settings
3. Click on add and select the zimbra as the sync option
4. Complete the login details such as mail server url , username and password
5. Test the connection and once its successful click ok and you will be re-directed to the previous screen
6. Click sync now

How to enable sound recorder in Ubuntu 10.04

I'm using Skype in Ubuntu 10.04 and unable to communicate via video call as i cant enable sound recording. So, i've installed GNOME Alsa Mixer and changed some settings and it WORKS now !!!

Just few steps and sound recording works.

1) sudo apt-get install gnome-alsamixer
2) Go to Application > Sound & Video > GNOME ALSO Mixer
3) It will open a control panel




















4) Just check the Rec checkbox and control the volume for capture
5) Done

Huawei E1762 connection in Ubuntu 9.10

Here are few simple steps to enjoy your Huawei E1762 broadband in Ubuntu 9.10

1) Edit /etc/usb_modeswitch

Change your settings as per below....

##########################################################
Huawei E220 (aka "Vodafone EasyBox II", aka "T-Mobile wnw Box Micro")

# Huawei E270
# Huawei E870
# and probably most other Huawei devices (just adapt product ID)
#
# Two options: 1. removal of "usb-storage" 2. the special control
# message found by Miroslav Bobovsky
#
# Contributor: Hans Kurent, Denis Sutter

DefaultVendor= 0x12d1
;DefaultProduct= 0x1003
DefaultProduct= 0x1446

TargetVendor=0x12d1
TargetProduct=0x140c

# choose one of these:
;DetachStorageOnly=1
;HuaweiMode=1

MessageEndpoint=0x01
MessageContent="55534243000000000000000000000011060000000000000000000000000000"

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


2) If you are connected to the Broadband but unable to browse internet, then you guys have to add the following DNS in your mobile broadband settings;
a) IPV4 Settings method should be Automatic (PPP) Addresses Only
b) DNS Servers : 58.71.136.10, 58.71.132.10

3) Reboot your machine to enjoy your broadband.

Source : (Forum on www.draisberghof.de)