menembus batas impian

Archive for April, 2012

How to Install OpenVPN on CentOS VPS


OpenVPN is an open source virtual private network (VPN) software. Follow the steps below to configure OpenVPN on CentOS:

1. Install dependencies:

# yum install gcc make rpm-build autoconf.noarch zlib-devel pam-devel openssl-devel

2. Get OpenVPN:

# wget http://openvpn.net/release/lzo-1.08-4.rf.src.rpm

# wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

3. Prepare to install:

# rpmbuild –rebuild lzo-1.08-4.rf.src.rpm

# rpm -Uvh /usr/src/redhat/RPMS/x86_64/lzo-*.rpm

# rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

4. Install OpenVPN:

# yum install openvpn

5. Copy the OpenVPN directory:

# cp -r /usr/share/doc/openvpn-2.2.0/easy-rsa/ /etc/openvpn/

6. Build SSL keys. When prompted for key information, you can simply press enter to bypass:

#cd /etc/openvpn/easy-rsa/2.0

#chmod 755 *

#source ./vars

#./vars

#./clean-all

#./build-ca

#./build-key-server server

#./build-dh

7. Create the OpenVPN config:

# cd /etc/openvpn

# vi server.conf

Copy the following sample config into the document, edit the IP address and port to your main IP address and desired port, then press ESC, then :wq and enter to save and exit the document.

local 123.123.123.123 #- change it with your server ip address

port 1234 #- change the port you want

proto udp #- protocol can be tcp or udp

dev tun

tun-mtu 1500

tun-mtu-extra 32

mssfix 1450

ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt

cert /etc/openvpn/easy-rsa/2.0/keys/server.crt

key /etc/openvpn/easy-rsa/2.0/keys/server.key

dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem

plugin /usr/share/openvpn/plugin/lib/openvpn-auth-pam.so /etc/pam.d/login

client-cert-not-required

username-as-common-name

server 10.8.0.0 255.255.255.0

push “redirect-gateway def1”

push “dhcp-option DNS 208.67.222.222”

push “dhcp-option DNS 4.2.2.1”

keepalive 5 30

comp-lzo

persist-key

persist-tun

status server-tcp.log

verb 3

8. Start OpenVPN:

# openvpn /etc/openvpn/server.conf

Check that it returns “Initialization Sequence Completed.” If so, press ctrl-c to quit.

9. Setup NAT rules:

# echo 1 > /proc/sys/net/ipv4/ip_forward

# iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT –to 0.0.0.0

(Modify “0.0.0.0” to your server’s IP)

Create a user to login to the VPN with:

#useradd username -s /bin/false

#passwd username

10. Create an OpenVPN config file on your local machine with name vpn1.ovpn, copy the sample below with your IP and port, and place it in your OpenVPN configurations folder:

client

dev tun

proto udp

remote 123.123.123.123 4567 #- your OPENVPN server ip and port

resolv-retry infinite

nobind

tun-mtu 1500

tun-mtu-extra 32

mssfix 1450

persist-key

persist-tun

ca ca.crt

auth-user-pass

comp-lzo

verb 3

11. Download ca.crt from /etc/openvpn/easy-rsa/2.0/keys to the same OpenVPN configs folder.

12. Start the VPN on the VPS:

# openvpn /etc/openvpn/server.conf

Log in to the VPN from your local machine (using OpenVPN or another desktop client) with the username/password you created.

Howto : Install Canon LBP2900 printer on Linux


This post show how to install LBPXXXX in Linux

Features

12 ppm mono printing
Zero warm-up time from sleep mode
First Print Out Time in only 9.3 seconds
Up to 2400 x 600dpi print resolution
Energy efficient and quiet operation
Easy to use All-in-One cartridg

This tutorial will show you how to install Canon LPB2900 on Linux, tested also on Canon LBP3100 and is working, and should work on all

the Canon laser printers LBP XXXX Series.

Before to begin we have to see if all the necessary dependencies are installed, if not we have to install them, check the ones below if already

are installed :

1/6: printer-testpages

2/6: dynamic
3/6: libopenslp1
4/6: cups-common
5/6: portreserve
6/6: cups

If all is installed then we go with the installation :

1- Download the driver from here, or from :

2- change to root :

su – (root)

3- change to the folder where you download the driver and extract it, in my case :

cd /home/zinovsky/Desktop

tar -xvf Driver.tar.gz change Driver with the name and version of your driver in my case i downloaded CAPTDRV180.tar.gz

output :

[root@localhost Desktop]# tar xvf CAPTDRV180.tar.gz

so now if we want to install in debian ( ubuntu for exmple) we have to choose :

CANON_UK/Driver/Debian/cndrvcups-common_1.80-1_i386.deb
CANON_UK/Driver/Debian/cndrvcups-capt_1.80-1_i386.deb

if We have to install the driver on red-hat based distribution like in my case will choose

CANON_UK/Driver/RPM/cndrvcups-common-1.80-1.i386.rpm
CANON_UK/Driver/RPM/cndrvcups-capt-1.80-1.i386.rpm

like this :

[root@localhost Desktop]# cd CANON_UK/

[root@localhost CANON_UK]# ls Doc/ Driver/ Src/ [root@localhost CANON_UK]# cd Driver/ [root@localhost Driver]# ls Debian/ RPM/

in my case i will install in red-hat based distribution so is a RPM package ( fedora,Mandriva, Linpus )

[root@localhost Driver]# cd RPM/

[root@localhost RPM]# rpm -ivh cndrvcups-common-1.80-1.i386.rpm

Preparing… ########################################### [100%]
1:cndrvcups-common ########################################### [100%]
[root@localhost RPM]# rpm -ivh cndrvcups-capt-1.80-1.i386.rpm
Preparing… ########################################### [100%]
1:cndrvcups-capt ########################################### [100%]

Driver is installed .

4- Now we have to restart CUPS :

/etc/init.d/cups restart

5-Now type tail /var/log/messages

[root@localhost ~]# tail /var/log/messages

Jan 24 18:37:51 localhost perl: [RPM] cups-1.3.9-0.2mdv2009.0 installed
Jan 24 18:40:25 localhost kernel: usb 1-1: new high speed USB device using ehci_hcd and address 6
Jan 24 18:40:25 localhost kernel: usb 1-1: configuration #1 chosen from 1 choice
Jan 24 18:40:25 localhost kernel: usb 1-1: New USB device found, idVendor=04a9, idProduct=2676
Jan 24 18:40:25 localhost kernel: usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jan 24 18:40:25 localhost kernel: usb 1-1: Product: Canon CAPT USB Device
Jan 24 18:40:25 localhost kernel: usb 1-1: Manufacturer: Canon
Jan 24 18:40:25 localhost kernel: usb 1-1: SerialNumber: 0000A376H8Jd
Jan 24 18:40:25 localhost kernel: usblp0: USB Bidirectional printer dev 6 if 0 alt 0 proto 2 vid 0x04A9 pid 0×2676
Jan 24 18:40:25 localhost kernel: usbcore: registered new interface driver usblp

6- Now type :

/usr/sbin/lpadmin -p LBP2900 -m CNCUPSLBP2900CAPTK.ppd -v ccp:/var/ccpd/fifo0 -E

N.B : If you are trying to install another LBP printer other than LBP2900 then use the command bellow and choose the CNCUPSLBPxxxxCAPTK.ppd

that correspond to your printer model and replace it in the the command above.

ls /usr/share/cups/model/ |grep CNCUPS

7-and then

/usr/sbin/ccpdadmin -p LBP2900 -o /dev/usb/lp0

N.B : If you are trying to install another LBP printer other than LBP2900 then change LBP2900 in the command above with your LBPxxxx printer

output :

CUPS_ConfigPath = /etc/cups/

LOG Path = None

UI Port = 59787

Entry Num : Spooler : Backend : FIFO path : Device Path : Status

—————————————————————————-

[0] : LBP2900 : ccp : /var/ccpd/fifo0 : /dev/usb/lp0 : New!!

8- /etc/initd/ccpd start :

/etc/init.d/ccpd start

9- Now Set ccpd to start when you startup your computer:

For debian use :

sudo update-rc.d ccpd defaults 20

for other distributions i prefer this methode :

gedit /etc/rc.local

and add at the end :

/etc/init.d/ccpd start

save and close

10- Printer is ready to print 🙂

Status Monitor :

to monitor printing type :

captstatusui -P LBP2900

http://www.unixmen.com/installation-canon-lbp2900-on-linux-2/

satu langkah tambahan instal phpmyadmin di linuxmint12


setelah melakukan instal phpmyadmin dari Software manager maka running lewat terminal:

sudo ln -s /usr/share/phpmyadmin/ /var/www/phpmyadmin

langkah ini perlu dilakukan krn folder phpmyadmin saat instal masuk ke folder user/share/ kemudian

Unutk mengatasinya sebenarnya cukup mudah. Phpmyadmin berada di directory /usr/share, dan agar kit abisa mengaksesnya lewat web browser, cukup buat sebuah link yang menuju ke directory /usr/share/phpmyadmin dan diletakan di /var/www:

#sudo ln -s /usr/share/phpmyadmin/ /var/www/phpmyadmin