Showing posts with label CentOS. Show all posts
Showing posts with label CentOS. Show all posts

Tuesday, May 14, 2013

How to install Canon LBP-2900 on Linux (Centos 6.2)

For Local Printer

Get Driver for your Canon LBP-2900 driver on http://support-in.canon-asia.com

Download CAPT Printer Driver for Linux Version 2.50
# wget http://gdlp01.c-wss.com/gds/6/0100004596/01/Linux_CAPT_PrinterDriver_V250_uk_EN.tar.gz
Extract it

# tar -zxvf Linux_CAPT_PrinterDriver_V250_uk_EN.tar.gz 
Linux_CAPT_PrinterDriver_V250_uk_EN/
Linux_CAPT_PrinterDriver_V250_uk_EN/32-bit_Driver/
Linux_CAPT_PrinterDriver_V250_uk_EN/32-bit_Driver/Debian/
Linux_CAPT_PrinterDriver_V250_uk_EN/32-bit_Driver/Debian/cndrvcups-capt_2.50-1_i386.deb
Linux_CAPT_PrinterDriver_V250_uk_EN/32-bit_Driver/Debian/cndrvcups-common_2.50-1_i386.deb
Linux_CAPT_PrinterDriver_V250_uk_EN/32-bit_Driver/RPM/
Linux_CAPT_PrinterDriver_V250_uk_EN/32-bit_Driver/RPM/cndrvcups-capt-2.50-1.i386.rpm
Linux_CAPT_PrinterDriver_V250_uk_EN/32-bit_Driver/RPM/cndrvcups-common-2.50-1.i386.rpm
Linux_CAPT_PrinterDriver_V250_uk_EN/64-bit_Driver/
Linux_CAPT_PrinterDriver_V250_uk_EN/64-bit_Driver/RPM/
Linux_CAPT_PrinterDriver_V250_uk_EN/64-bit_Driver/RPM/cndrvcups-capt-2.50-1.x86_64.rpm
Linux_CAPT_PrinterDriver_V250_uk_EN/64-bit_Driver/RPM/cndrvcups-common-2.50-1.x86_64.rpm
Linux_CAPT_PrinterDriver_V250_uk_EN/Doc/
Linux_CAPT_PrinterDriver_V250_uk_EN/Doc/guide-capt-2.5xUK.tar.gz
Linux_CAPT_PrinterDriver_V250_uk_EN/Doc/LICENSE-captdrv-2.50E.txt
Linux_CAPT_PrinterDriver_V250_uk_EN/Doc/README-capt-2.5xUK.txt
Linux_CAPT_PrinterDriver_V250_uk_EN/Src/
Linux_CAPT_PrinterDriver_V250_uk_EN/Src/cndrvcups-capt-2.50-1.tar.gz
Linux_CAPT_PrinterDriver_V250_uk_EN/Src/cndrvcups-common-2.50-1.tar.gz


Install only 2 files
# rpm -Uvh Linux_CAPT_PrinterDriver_V250_uk_EN/32-bit_Driver/RPM/cndrvcups-common-2.50-1.i386.rpm 

# rpm -Uvh Linux_CAPT_PrinterDriver_V250_uk_EN/32-bit_Driver/RPM/cndrvcups-capt-2.50-1.i386.rpm

Restart the cups

/etc/init.d/cups restart

Now run this command


# /usr/sbin/lpadmin -p LBP2900 -m CNCUPSLBP2900CAPTK.ppd -v ccp:/var/ccpd/fifo0 -E
# /usr/sbin/ccpdadmin -p LBP2900 -o /dev/usb/lp0


Start ccpd service

/etc/init.d/ccpd start

To see printer status

# captstatusui -P LBP2900

For Network Printer

Simple, just add printer using smb connection and CAPT driver from canon which you can find on /usr/share/cups/model/ and for Canon LBP-2900 you can using /usr/share/cups/model/CNCUPSLBP2900CAPTK.ppd And Here is my printers.conf


Info Canon LBP2900 CAPT English
Location Titan
MakeModel Canon LBP2900 CAPT ver.1.5
DeviceURI smb://username:password@192.168.110.249/Canon%20LBP2900
State Idle
StateTime 1367827711
Type 8392836
Filter application/vnd.cups-raw 0 -
Filter application/vnd.cups-postscript 0 pstocapt
Filter application/vnd.cups-command 0 commandtops
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy stop-printer
 
MyPrinter (GTK View)

MyPrinter (WebView)

pdf2svg on Centos 6.2 (powerfull toy)

To understand about pdf2svg, please visit author site on cityinthesky.co.uk and download the latest source code to compile, in my case it is pdf2svg-0.2.1.tar.gz And follow instruction there to compile the source code,
Extract it
tar -zxvf pdf2svg-0.2.1.tar.gz
Go to extracted directory
cd pdf2svg-0.2.1
Do configure
./configure --prefix=/usr/local
And make
make
in this step im not so successful, there is warning like this
pdf2svg.c:152: warning: incompatible implicit declaration of built-in function ‘free’
BUT i ignore it, just try my luck :D Final step is
make install
And check
which pdf2svg
giving me result
/usr/local/bin/pdf2svg
How to use Simple enough, just follow author website example (again)
pdf2svg pdf_testpage.pdf pdf_testpage.svg
now you can open pdf_testpage.svg on inkscape with all converted fonts (Yes !!! converted) and save it as eps file to open using Adobe Illustrator.

Monday, January 14, 2013

Postfix + Dovecot on Centos 6.2 Final Release

Postfix Instalation and Configuration Install postfix package
$ yum install postfix
Edit your main.cf
$ mcedit /etc/postfix/main.cf
and add this basic configuration (change nebula.anekarupatera.lan with your FQDN machine name.
Before editing main.cf we should generate key for ssl/tls certificate, and add the result to main.cf
$ genkey --days 365 nebula.anekarupatera.lan
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
relay_domains =
home_mailbox = Maildir/

inet_interfaces = all
inet_protocols = all

myhostname = nebula.anekarupatera.lan
mydomain = anekarupatera.lan
myorigin = $mydomain
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 192.168.110.0/24, 127.0.0.0/8

unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
debugger_command =
         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
         ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory
#
# Configuring SSL/TLS in postfix
#
broken_sasl_auth_clients = yes
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
#
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
#
tls_random_source = dev:/dev/urandom
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_tls_key_file = /etc/pki/tls/private/nebula.anekarupatera.lan.key
smtpd_tls_cert_file = /etc/pki/tls/certs/nebula.anekarupatera.lan.cert
Start your postfix service
$ /etc/init.d/postfix start
Dovecot Instalation and Configuration
$ yum install dovecot
Edit your dovecot.conf
$mcedit /etc/dovecot/dovecot.conf
And change the following line from
protocols = imap pop3 lmtp
to
protocols = imap pop3
Start your Dovecot service
$ /etc/init.d/dovecot start

iRedMail on CentOS release 6.2 (Final)

DOwnload the latest release of iRedMail here
wget https://bitbucket.org/zhb/iredmail/downloads/iRedMail-0.8.3.tar.bz2
Extract download result using command below
tar -jxvf iRedMail-0.8.3.tar.bz2
After extract finished, go to extract result directory
cd iRedMail-0.8.3
Run iRedMail-0.8.3.sh script
$ sh iRedMail.sh 
< INFO > Checking new version of iRedMail ...
< INFO > Clean metadata of yum repositories.
Loaded plugins: fastestmirror, refresh-packagekit, security
Cleaning repos: base c6-media epel extras updates
20 metadata files removed
8 sqlite files removed
0 metadata files removed
< INFO > Generating yum repository ...
< INFO > Fetching source tarballs ...
< INFO > + 1 of 6: http://iredmail.org/yum/misc/iRedAdmin-0.2.tar.bz2
< INFO > + 2 of 6: http://iredmail.org/yum/misc/roundcubemail-0.8.2.tar.gz
< INFO > + 3 of 6: http://iredmail.org/yum/misc/phpldapadmin-1.2.2.tgz
< INFO > + 4 of 6: http://iredmail.org/yum/misc/phpMyAdmin-3.5.3-all-languages.tar.bz2
< INFO > + 5 of 6: http://iredmail.org/yum/misc/iRedAPD-1.3.8.tar.bz2
< INFO > + 6 of 6: http://iredmail.org/yum/misc/phpPgAdmin-5.0.4.tar.bz2
< INFO > Validate packages ... [ OK ]
< INFO > Install package: dialog
< INFO > Installing package(s): dialog
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
.....
...











After this step, iRedMail instalation will be update all your repo's database, to make sure you get the latest realease of the files. after update all repo's database, it will continue with downloading required packages and install it. You just need to relax and wait ( and hope have fast internet connection ), becasue in my case, it will install ( including update) 80 package.
Complete!




********************************************************************
* Start iRedMail Configurations
********************************************************************
< INFO > Create SSL certification files.
< INFO > Create required system accounts: vmail, iredapd, iredadmin.
< INFO > Configure Apache web server and PHP.
< INFO > Configure PostgreSQL database server.
< INFO > Configure Postfix (Message Transfer Agent).
< INFO > Configure Policyd (postfix policy server, code name cluebringer).
< INFO > Configure Dovecot (pop3/imap/managesieve server, version 2).
< INFO > Configure ClamAV (anti-virus toolkit).
< INFO > Configure Amavisd-new (interface between MTA and content checkers).
< INFO > Configure SpamAssassin (content-based spam filter).
< INFO > Configure iRedAPD (postfix policy daemon).
< INFO > Configure iRedAdmin (official web-based admin panel).
< INFO > Configure Fail2ban (authentication failure monitor).
< INFO > Configure Awstats (logfile analyzer for mail and web server).
< INFO > Configure Roundcube webmail.
< INFO > Configure phpPgAdmin (web-based PostgreSQL management tool).

*************************************************************************
* iRedMail-0.8.3 installation and configuration complete.
*************************************************************************

< INFO > Disable SELinux in /etc/selinux/config.
< Question > Would you like to use firewall rules provided by iRedMail now?
< Question > File: /etc/sysconfig/iptables, with SSHD port: 22. [Y|n] n
and then iRedMail will try to update your ClamAv Database, after installation finish, you will get this notification.
********************************************************************
* URLs of installed web applications:
*
* - Webmail: httpS://merkurius.anekarupatera.lan/mail/
* - Admin Panel (iRedAdmin): httpS://merkurius.anekarupatera.lan/iredadmin/
*   + Username: postmaster@anekarupatera.lan, Password: ********
*

********************************************************************
* Congratulations, mail server setup complete. Please refer to tip
* file for more information:
*
*   - /tmp/iRedMail-0.8.3/iRedMail.tips
*
* And it's sent to your mail account postmaster@anekarupatera.lan.
*
* Please reboot your system to enable mail services.
*
********************************************************************
Important, first you must read the /tmp/iRedMail-0.8.3/iRedMail.tips, on the first installation I've not read it at all, but after got some trouble i came back to read it :D
$ cat /tmp/iRedMail-0.8.3/iRedMail.tips
Finish ??? Not Yet We must update bind configuration with Domain Keys Indentified Main (DKIM), now open your console again.
$ amavisd show keys
Or, if the above command complain about config file, "Config file "/etc/amavisd.conf" does not exist, at /usr/sbin/amavisd line 1799." you can use command below.
$ amavisd -c /etc/amavisd/amavisd.conf showkeys
In my case, the output loook like this
$ amavisd -c /etc/amavisd/amavisd.conf showkeys
; key#1, domain anekarupatera.lan, /var/lib/dkim/anekarupatera.lan.pem
dkim._domainkey.anekarupatera.lan. 3600 TXT (
  "v=DKIM1; p="
  "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCkfeQwd0g+DmQf4PE0vwtO3sJV"
  "pGgLrq1g5Uw0/erPxL8DGj2IdviHQuA364CpOvB4jA4h9U/fJiGBsWNA0SjnLTjV"
  "yLM4iNOSCPISJKnnvcnG6vv4UXDjwYoDJd5JYNbW2tURNMDQeWNdfQ4thLygtPH8"
  "3hkpL1b9EV5Xf9ldAwIDAQAB")
Copy and paste output text to your bind configuration in ONE LINE !!!, make it like this
$ cat /var/named/anekarupatera.lan

$ORIGIN anekarupatera.lan.
$ttl 86400
@       IN      SOA     nebula.anekarupatera.lan. root.anekarupatera.lan. (
                        2009101590
                        43200
                        3600
                        1209600
                        604800 )

                IN      NS                      nebula.anekarupatera.lan.

                IN      MX      10              nebula.anekarupatera.lan.

aurora          IN      A       192.168.110.74
athena          IN      A       192.168.110.200
gaia            IN      A       192.168.110.230
chronos         IN      A       192.168.110.231
porteus         IN      A       192.168.110.232
samba           IN      A       192.168.110.253
nebula          IN      A       192.168.110.254

mail            IN      CNAME   nebula
www             IN      CNAME   nebula

dkim._domainkey.anekarupatera.lan. IN TXT "v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCkfeQwd0g+DmQf4PE0vwtO3sJVpGgLrq1g5Uw0/erPxL8DGj2IdviHQuA364CpOvB4jA4h9U/fJiGBsWNA0SjnLTjVyLM4iNOSCPISJKnnvcnG6vv4UXDjwYoDJd5JYNbW2tURNMDQeWNdfQ4thLygtPH83hkpL1b9EV5Xf9ldAwIDAQAB"
Now test your DKIM key, it should be pass right now.
# amavisd -c /etc/amavisd/amavisd.conf testkeys
TESTING#1: dkim._domainkey.anekarupatera.lan => pass
Final check, Make sure you have /var/www/awstats/awstats.pl on /var/www/awstats/ directory, if you don't have it, you must create it using command below.
ln /usr/share/awstats/wwwroot/cgi-bin/awstats.pl  /var/www/awstats/awstats.pl
Now reboot your linux.

After Reboot :

READ your iRedMail.tips


Wednesday, November 28, 2012

Running Rsync as Daemon on Centos 6.2

Configuring /etc/rsyncd.conf
# mcedit /etc/rsyncd.conf
max connections = 2
motd file = /etc/rsync.motd
log file = /var/log/rsync.log
pid file = /var/run/rsync.pid
lock file = /var/run/rsync.lock
timeout = 300
[Test] comment = "Backup Testing" path = /mnt/share uid = root gid = root list = true use chroot = no read only = no list = yes auth users = root, merkurius, venus, jupiter secrets file = /etc/rsyncd.secrets hosts allow = 192.168.1.0/255.255.255.0
Creating the secrets file on /etc/rsyncd.secrets, and add the usernames and the passwords, one per line, separated by a colon (:)
# mcedit /etc/rsyncd.secrets
root:password merkurius:Password venus:passworD jupiter:PassWord
Finally, change the permission of this file so it can't be read or modified by other users.
# chmod 600 /etc/rsyncd.secrets
Edit /etc/xinetd.d/rsync
# mcedit /etc/xinetd.d/rsync
service rsync { disable = no socket_type = stream wait = no user = root server = /usr/bin/rsync server_args = --daemon log_on_failure += USERID }
Testing from Localhost
# rsyncd root@localhost::
Test "Backup Testing"
or
#rsync rsync://root@localhost
Test "Backup Testing"
Testing from another computer
# rsync -avzr root@192.168.77.194::Test /tmp/test/
Password:******* receiving incremental file list ./ new.txt sent 76 bytes received 216 bytes 83.43 bytes/sec total size is 71 speedup is 0.24
As another user : merkurius
# rsync -avzr merkurius@192.168.77.194::Test /tmp/test/
Password:***** receiving incremental file list ./ install.log sent 81 bytes received 8707 bytes 2510.86 bytes/sec total size is 35011 speedup is 3.98
Check Result
# ls -al /tmp/test/
total 48 drwxr-xr-x 2 root root 4096 Nov 28 17:08 . drwxrwxrwt. 14 root root 4096 Nov 28 17:01 .. -rw-r--r-- 1 root root 34940 Nov 28 17:08 install.log -rw-r--r-- 1 root root 71 Nov 28 16:57 new.txt
As shown above, all file are belong to root, because we specify uid and gid as root, when rsync run as daemon, we can specify which user and group owns the files that are transfer from and to.

Done

Wednesday, June 27, 2012

TigerVNC on CentOS 6

According to the Tigervnc wiki, TigerVNC is a high-performance, platform-neutral implementation of VNC (Virtual Network Computing), a client/server application that allows users to launch and interact with graphical applications on remote machines. TigerVNC provides the levels of performance necessary to run 3D and video applications, and it attempts to maintain a common look and feel and re-use components, where possible, across the various platforms that it supports. TigerVNC also provides extensions for advanced authentication methods and TLS encryption.

To install TigerVNC, follow this step.

1. Create the repository config file /etc/yum.repos.d/slce.repo:
[slce]
name=Scientific Linux Cyrillic Edition
baseurl=http://downloads.naulinux.ru/pub/SLCE/6x/$basearch/CyrEd/RPMS/
enabled=0
gpgcheck=1
gpgkey=http://downloads.naulinux.ru/pub/SLCE/RPM-GPG-KEY-linux-ink
2. Install tigervnc-server rpm package:
# yum --enablerepo=slce install tigervnc-server
3.Create VNC user
As root :
# useradd lombok
# passwd lombok
4.Set VNC's user password
Switch user into the account for each user, and run: vncpasswd This will create a .vnc directory.
[~]# su - lombok
[~]$ cd .vnc
[.vnc]$ ls
passwd
[.vnc]$ exit
[~]
#

4. Edit the server configuration
Edit /etc/sysconfig/vncservers, and add the following to the end of the file.
VNCSERVERS="1:lombok
VNCSERVERARGS[1]="-geometry 800x600"

5. Edit your iptables

6. Start the VNC Server

# /etc/init.d/vncserver start

7.Testing VNC Server

As user lombok :

# vncserver :1

At this point, your server is ready to accept connection from another computer.



Connect to TigerVNC Server

Start VNC Viewer Client, because vncserver starting at display 1 (vncserver:1) you must connect using IP:display_number, in this case : 192.168.110.75:1



Just enter user lombok password and press OK


And....


Optional

Another Option fow VNC Viewer is TightVNC Java Viewer version 2.5.0


Enter user lombok password and press login.


End.

Tuesday, June 26, 2012

X11vnc on Centos 6.0 (insecure connection)

Installing X11vnc

Often you will need remote access to an already logged in GUI session on a "real" console. Or you will need to help another user remotely with an GUI or visual issue. You will need either "vnc-server" or "x11vnc". The vnc-server option will be a module added to X11 for "allways on" vnc support, while x11vnc will allow for adhoc vnc support. vnc-server install will require no third party repos or source building.

x11vnc is a way to view remotely and interact with real X displays (i.e. a display corresponding to a physical monitor, keyboard, and mouse) with any VNC viewer. In this way it plays the role for Unix/X11 that WinVNC plays for Windows.

1. Download the latest rpm install from http://dag.wieers.com/rpm/packages/x11vnc/ to the host you want the vnc-client to connect to:
[root@edp-01 ~]# wget http://dag.wieers.com/rpm/packages/x11vnc/x11vnc-0.9.3-1.el5.rf.i386.rpm
2. Install, as root, via the yum or rpm programs on the host you want the vnc-client to connect to:
[root@edp-01 ~]# rpm -ivh  x11vnc-0.9.3-1.el5.rf.i386.rpm
Or
[root@edp-01 ~]# yum install x11vnc-0.9.3-1.el5.rf.i386.rpm

Configuring firewall option


The iptables rules in /etc/sysconfig/ need to be amended to open the VNC ports; as needed, if a local ipv6 setup is being used, those need to be amended as well: 
[root@edp-01 ~]# mcedit /etc/sysconfig/iptables
add folowing line to the iptables file :
-A INPUT -m state --state NEW -m tcp -p tcp -m multiport --dports 5900:5903,6001:6003 -j ACCEPT
So it look like : 
[root@edp-01 ~]# cat /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp -m multiport --dports 5900:5903,6001:6003 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT ... and then restart the iptables:
[root@edp-01 ~]# /etc/init.d/iptables restart

Starting x11vnc

Start the x11vnc process on the host you want the vnc-client to connect to. Please take a long look at the possible options from the x11vnc website. A very simple/insecure example for a trusted network setup (local network or VPN) is to have the user with the GUI console issue the command:
[root@edp-01 ~]# x11vnc -nopw -display :0.0

Accessing x11vnc


Install VNC viewer on client computer next. Download from the site below to install. http://www.realvnc.com/products/free/4.1/download.html Start VNC viewer after installing. Then following scrren is shown. Input [(Server's hostname or IP address):(display number)] like following example.


Just choose continue if you asked for encrypted connection.

 

And the result is:

 

End

Referensi : Referensi 01