Wednesday, February 13, 2013

IMAP on Oracle Linux 6

Hi there,

To enable IMAP on Oracle Linux 6, the steps are pretty simple.
  • Configure postfix. Edit /etc/postfix/main.cf
uncomment home_mailbox = Maildir/
add to the end of the main.cf file :
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
  •  restart service
#service postfix restart
  • Install dovecot
# yum install dovecot
  • enable the imap service
# vi /etc/dovecot/dovecot.conf
change from:
#protocols = imap pop3 lmtp 
to:
protocols = imap
  • edit /etc/dovecot/10-mail.conf
#vi /etc/dovecot/10-mail.conf
add
mail_location = maildir:~/Maildir
  • edit /etc/dovecot/conf.d/10-master.conf
change from:
unix_listener auth-userdb {
#mode = 0600
#user =
#group =
}
to
unix_listener /var/spool/postfix/private/auth {
mode = 0666
user = postfix
group = postfix
}
  •  edit /etc/dovecot/conf.d/10-auth.conf
# vi /etc/dovecot/conf.d/10-auth.conf 
disable_plaintext_auth = no 
auth_mechanisms = plain login 
  • check the status of the sevice
 [root@ol6 ~]# chkconfig --list dovecot
dovecot         0:off 1:off 2:off 3:off 4:off 5:off 6:off
  • enable it in case it was off
 [root@ol6 ~]# chkconfig dovecot on
  • start the service 
 [root@ol6 ~]# service dovecot start
Starting Dovecot Imap:                                     [  OK  ]
  • check the service is listening on imap port.. tcp 143 for imap, tcp 993 for imaps
[root@ol6 ~]# netstat -anp | egrep ':143|:993'
tcp        0      0 0.0.0.0:993                 0.0.0.0:*                   LISTEN      26394/dovecot    
tcp        0      0 0.0.0.0:143                 0.0.0.0:*                   LISTEN      26394/dovecot    
tcp        0      0 :::993                      :::*                        LISTEN      26394/dovecot    
tcp        0      0 :::143                      :::*                        LISTEN      26394/dovecot    
  • configure the firewall to allow incoming connections to 143 and 993 tcp if you have iptables running
  • done!
Now, let's test the system is running.

Dovecot will use a combination of user and password, so will check access for oracle user
  • send a test email to our user
# echo test | mail -s test oracle
  • install mutt mail client
#yum install mutt
  • set a password to a user, in order to test if you don't have a password yet
#passwd oracle
  • test dovecot imap
#mutt -f imap://server/user
  •  accept the certificate
(r)eject, accept (o)nce, (a)ccept always 

Done. 
Ok, not so simple, but pretty straightforward.

Dedicated to my friends on tcs india.

Alvaro.



acfs with uek2 kernel



  • get the latest OPatch. p6880880_112000_Linux-x86-64.zip
  • get oct 2012 cpu/psu patch p14275572_112030_Linux-x86-64.zip
  • get the acfs patch p12983005_112034_Linux-x86-64.zip
  • apply the OPatch on Grid Home
  • create a ocm.rsp file 
  • apply both patches first oct2012, then the acfs enabler as root (yes root)
become root
source your GRID
. oraenv
+ASM
apply the patches
#112034 Oct2012
$ORACLE_HOME/OPatch/opatch auto /u01/patch/14275572 -oh $ORACLE_HOME -ocmrf /u01/rsp/ocm.rsp
#acfs with uek2 on 112034
$ORACLE_HOME/OPatch/opatch auto /u01/patch/12983005 -oh $ORACLE_HOME -ocmrf /u01/rsp/ocm.rsp
  • create an acfsload service file
vi /etc/init.d/acfsload
#!/bin/sh
# chkconfig: 2345 30 21
# description: Load Oracle ACFS drivers at system boot
ORACLE_HOME=/u01/app/11.2.0.3/grid
$ORACLE_HOME/bin/acfsload start -s
  • enable and start the acfsload service
chkconfig --add acfsload
service acfsload start
now, become grid, and execute asmca

Tuesday, February 12, 2013

OSX Server https with password page

Hi there,

I did got OSX Server for my mac mini, so I wanted to create a folder password protected with a user that exists on my mac, plus forward to https because the password.

After some search, just found ninja tricks to enable auth modifying the files, plus some htaccess examples that caused double auth, or some loops.

After some test, I have came with a simple solution.

On the folder you want to protect, just create a .htaccess file with :

Is totally local, doesn't require modify the httpd.conf file, nor restart the service.

The trick is on the Error 403, that will happen if the connection came from http.

Just replace with your server/path and voila.

[ update Feb 16 ] in order to get .htaccess to work, please be sure you get the same enabled on the console




Thursday, February 7, 2013

public-yum-downloader.sh

Hello,

My very first post here.

for those looking to grab a local copy of public-yum.oracle.com, I have created a script that will automate the process.


You can download the script from github public-yum-downloader.sh


examples:
if you want to download 6.latest (or keep updated) DocumentRoot for the webserver is /var/www/html url will be http://mirandaa00 proxy is http://proxy:3128
public-yum-downloader.sh -P /var/www/html -p http://proxy:3128 -R 6.latest -a x86_64 --url http://mirandaa00
At the end of the run, will create a package /var/ww/html/local-yum-ol6.repo available as http://mirandaa00/local-yum-ol6.repo
if you want to download latest UEK (or keep updated) DocumentRoot for the webserver is /var/www/html url will be http://mirandaa00 proxy is http://proxy:3128
public-yum-downloader.sh -P /var/www/html -p http://proxy:3128 -R 6.UEK -a x86_64 --url http://mirandaa00