Posts Tagged ‘install’

CenTos OpenVpn 一键安装包

星期日, 四月 19th, 2015

原创内容,转载请注明出处:http://www.myzhenai.com.cn/post/2015.html http://www.myzhenai.com/thread-17453-1-1.html
关键字:centos openvpn 一键安装包 openvpn install script
pptp一键安装包网上有很多,但是openvpn的一键安装包却很少,这个是我自己写的一个一键安装脚本,利用yum进行安装的,所以安装的版本还算不低.默认会自动识别i386或是x86_64。同时支持centos5x和centos6x.不过好像centos7x还不能够兼容openvpn,起码我在源库里并没有看到有openvpn这个安装包.
虽然说是一键安装的脚本,但是在生成key和dh文件的时候还是需要一路回车并留意输入”y”回车. 因为在这几步这里我折腾了很久也不能实现自动交互,所以也只能是麻烦用户们在这里手动一下.安装完成后需要reboot重启服务器,如果出现无法连接的故障,请检查你服务端时间和本地时间.
一键安装脚本演示视频
Youtube:https://youtu.be/YHlwp8yN1yk
BaiduPan:链接: http://pan.baidu.com/s/1i3O7qQT 密码: wbm2
QQ:http://v.qq.com/boke/page/v/y/2/v0174hns6y2.html

#wget http://www.myzhenai.com.cn/openvpn.sh
## wget https://goo.gl/rht4E1?openvpn.sh
#sh openvpn.sh
#reboot

然后将/home/vpn.tar.gz这个文件下载到本地,这个就是客户端配置文件.

# !/bin/bash
#***************************************************************************************************************************************************#
# CenTos6 OpenVpn VPN Install Script                                                                           #
# Author: RucLinux                                                                                             #  
# Web: http://www.myzhenai.com.cn http://www.myzhenai.com http://www.haikou-china.com http://jiayu.mybabya.com #
yum install redhat-lsb -y
el=`rpm -qa |grep epel` && yum -q remove $el -y
version=`lsb_release -a|grep -e Release|awk -F ":" '{ print $2 }'|awk -F "." '{ print $1 }'`
rm -rf *.rpm
if [ $version == "6" ];then
if [ $(getconf WORD_BIT) = '32' ];then
wget http://apt.sw.be/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
rpm -ivh rpmforge-release-0.5.3-1.el6.rf.i686.rpm
else
wget http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
rpm -ivh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
fi
fi
if [ $version == "5" ];then
if [ $(getconf WORD_BIT) = '32' ];then
wget http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.3-1.el5.rf.i386.rpm
rpm -ivh rpmforge-release-0.5.3-1.el5.rf.i386.rpm
else
wget http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm
rpm -ivh rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm
fi
fi
if [ $version == "7" ];then
wget http://apt.sw.be/redhat/el7/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
rpm -ivh rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
fi
yum remove openvpn -y
rm -rf /etc/openvpn/*
rm -rf /home/vpn
rm -rf /home/vpn.tar.gz
yum update -y
yum install gcc gcc-c++ lrzsz lzo openssl openssl-devel iptables pkcs11-helper pkcs11-helper-devel openssh-clients openvpn -y
easy=`find / -name easy-rsa` && cp -R $easy /etc/openvpn/
#if ! [ -d "$easy"];then
#yum install easy-rsa -y
#cp -R $easy /etc/openvpn/
#else
#cp -R $easy /etc/openvpn/
#fi
cd /etc/openvpn/easy-rsa/2.0/
chmod +rwx *
./vars
sed -i 's/export KEY_COUNTRY="US"/export KEY_COUNTRY="CN"/g' vars
sed -i 's/export KEY_PROVINCE="CA"/export KEY_PROVINCE="HN"/g' vars
sed -i 's/export KEY_CITY="SanFrancisco"/export KEY_CITY="HAIKOU"/g' vars
sed -i 's/export KEY_ORG="Fort-Funston"/export KEY_ORG="OpenVPN"/g' vars
sed -i 's/export KEY_EMAIL="me@myhost.mydomain"/export KEY_EMAIL="root@foxmail.com"/g' vars
sed -i 's/export KEY_EMAIL=mail@host.domain/export KEY_EMAIL=root@foxmail.com/g' vars
server=`find / -name sample-config-files` && cp $server/server.conf /etc/openvpn/
sed -i 's/;push "route 192.168.10.0 255.255.255.0"/push "route 192.168.10.0 255.255.255.0"/g' /etc/openvpn/server.conf
sed -i 's/;push "dhcp-option DNS 208.67.222.222"/push "dhcp-option DNS 8.8.8.8"/g' /etc/openvpn/server.conf
sed -i 's/;push "dhcp-option DNS 208.67.220.220"/push "dhcp-option DNS 8.8.4.4"/g' /etc/openvpn/server.conf
sed -i 's/;client-to-client/client-to-client/g' /etc/openvpn/server.conf
sed -i 's/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/g' /etc/sysctl.conf
. ./vars
./clean-all
#echo -e "\n\n\n\n\n\n\n\n" | ./build-ca
#echo -e "\n\n\n\n\n\n\n\n\n\n" | ./build-key-server server && echo -e "\n\n\n\n\n\n\n\n\n\n" | ./build-key client-name
./build-ca
./build-key-server server
./build-key client-name
./build-dh
openssl rsa -in keys/client-name.key -out keys/client-name.pem
chmod +x keys/*
mkdir /home/vpn
size=`grep 'export KEY_SIZE=1024' $easy/2.0/vars`
if [[ $size == "export KEY_SIZE=1024" ]];then
cp keys/{ca.crt,ca.key,client-name.crt,client-name.csr,client-name.key,server.crt,server.key,dh1024.pem,client-name.pem} /etc/openvpn/
cp keys/{ca.crt,ca.key,client-name.crt,client-name.csr,client-name.key,server.crt,server.key,dh1024.pem,client-name.pem} /home/vpn/
else
cp keys/{ca.crt,ca.key,client-name.crt,client-name.csr,client-name.key,server.crt,server.key,dh2048.pem,client-name.pem} /etc/openvpn/
cp keys/{ca.crt,ca.key,client-name.crt,client-name.csr,client-name.key,server.crt,server.key,dh2048.pem,client-name.pem} /home/vpn/
fi
cd /home/
tar -zcvf vpn.tar.gz vpn/*
cd /
ip=`ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"`
iptables -F
service iptables save
service iptables restart
iptables -A INPUT -p tcp --dport 1194 -j ACCEPT
iptables -A INPUT -p udp --dport 1194 -j ACCEPT
iptables -A INPUT -p tcp --dport 1723 -j ACCEPT
iptables -A INPUT -p tcp --dport 47 -j ACCEPT
iptables -A INPUT -p tcp --dport 2009 -j ACCEPT
iptables -A INPUT -p udp --dport 2009 -j ACCEPT
iptables -A INPUT -p gre -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -j SNAT --to-source $ip
iptables -t nat -A POSTROUTING -s 10.8.0.20/24 -j SNAT --to-source $ip
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to-source $ip
iptables -t nat -A POSTROUTING -s 10.10.10.0/24 -j SNAT --to-source $ip
service iptables save
service iptables restart
#con=`grep '/usr/sbin/openvpn –config /etc/openvpn/server.conf &'` /etc/rc.local
#if [[ $con != "/usr/sbin/openvpn –config /etc/openvpn/server.conf &" ]];then
echo '/usr/sbin/openvpn –config /etc/openvpn/server.conf &' >> /etc/rc.local
#fi
#openvpn --config /etc/openvpn/server.conf &
chkconfig openvpn on
chkconfig iptables on
service openvpn start
echo '*********************************************************';
echo '****                                                 ****';
echo '****        End script installation                  ****';
echo '****  Please download your configuration file        ****';
echo '****  /home/vpn.tar.gz     to the local client       ****';
echo '****        http://www.myzhenai.com.cn               ****';

centos下安装五笔输入法的教程

星期日, 六月 9th, 2013

原创内容,转载请注明出处:http://www.myzhenai.com/thread-15645-1-1.html http://www.myzhenai.com.cn/post/1151.html
关键字:linux centos ubuntu fedora yum install ibus table chinese wubi haifeng jidian Epel
很多第一次使用linux系统的朋友都因为使用五笔输入法而止步,其实linux下也有好多款优秀的五笔输入法的,五码,海峰和极点五笔等.现在我们就说一说安装这些输入法的方法.
*注明:安装之前请您将您的系统更新至最新版本

#yum update

一:安装Epel更新源,因为默认的centos源里是没有这些文件的,所以我们借助fedora的源来安装,安装完成后再卸载这个更新的源即可.
安装Epel更新源 http://www.myzhenai.com/thread-15362-1-1.html
二:安装输入法,这里我使用的是倒序的安装.如果您安装过程中提示什么失误,将以下方法的顺序反过来操作即可.

#yum install ibus-table-chinese-wubi-haifeng
#yum install ibus-table-chinese-wubi-jidian
#yum install ibus-table-chinese-wubi
#yum install ibus-table-chinese
#yum install ibus-table

三:使用输入法
1:centos桌面工具栏左上角 系统\首选项\输入法\ 在输入配置工具里使用默认的“使用IBus(推荐)” 点击“首先输入法(p)”按钮.
2:IBus 设置\输入法\选择输入法\汉语\ 选择要添加的输入法,然后点击“添加”按钮.
四:卸载Epel更新源,因为centos和fedora某些文件还是会有冲突的,所以我们只使用默认的更新源,以免系统自动更新的时候更新了不兼容或不信赖的包和库文件.

#yum remove epel-release

输入法配置完成.开始享受你的linux Centos之旅吧.
*注,安装极点五笔的另一个方法 http://www.myzhenai.com/thread-14248-1-2.html

Dropbox注册安装使用和升级的方法

星期六, 三月 16th, 2013

Dropbox是一款优秀稳定的网盘,免费安装用户有2.0GB的存储空间,同时可以通过一些推广等手段获得额外的增加空间容量.现在我们就来一一讲一讲注册和安装的方法,以及额外增加空间容量的方法.
-:注册
打开:http://db.tt/kCaOEpbI 或 http://db.tt/jl6rODl5 如图1界面
Dropbox
注册完成后进入的就是你的Dropbox网盘管理页面.
=:安装
下载Dropbox客户端进行安装,这里我们没有讲解手机客户端的安装,如果是手机客户端,请参考https://www.dropbox.com/mobile 我们解释的是Windows系统和Linux系统的安装,Windows系统安装请参考:https://www.dropbox.com/downloading?os=win
Linux系统里的安装有些麻烦,所以我们重点讲解linux下的安装方法.官方的下载安装页面:https://www.dropbox.com/install 请下载对应系统的文件进行安装或下载源码进行安装.
官方的安装文档:
Install Dropbox via command line

The Dropbox daemon works fine on all 32-bit and 64-bit Linux servers. To install, run the following command in your Linux terminal.

32-bit:

cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86" | tar xzf -

64-bit:

cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -

Next, run the Dropbox daemon from the newly created .dropbox-dist folder.

~/.dropbox-dist/dropboxd

If you’re running Dropbox on your server for the first time, you’ll be asked to copy and paste a link in a working browser to create a new account or add your server to an existing account. Once you do, your Dropbox folder will be created in your home directory. Download this CLI script to control Dropbox from the command line. For easy access, put a symlink to the script anywhere in your PATH.

Installing Dropbox from source

Download installer source (tar.bz2)
Extract the tar ball like so:

tar xjf ./nautilus-dropbox-1.4.0.tar.bz2

In most distributions, the following commands should do the rest:

cd ./nautilus-dropbox-1.4.0; ./configure; make; make install;

For specific distributions or to configure your installation, see the INSTALL file included with the source package.

安装完成后,在本地会生成一个Dropbox目录,你只要将要储存的文件复制或保存在这个目录里,然后运行Dropbox客户端就可以自动上传了,以后都可以自动同步.可以新建目录或删减目录及文件.

源码编译安装方法:http://www.myzhenai.com.cn/post/798.html http://www.myzhenai.com/thread-15149-1-1.html
备份下载地址:http://ruclinux.googlecode.com/files/Dropbox.tar.gz
Dropbox外链教程:http://www.myzhenai.com.cn/post/827.html http://www.myzhenai.com/thread-15264-1-1.html

Dropbox免费升级方法
https://www.dropbox.com/getspace 在官方的升级页面里选择你要推广的方式,分别有邮件推广(需要Gmail邮箱和美国Yahoo邮箱),在使用时会提示允许Dropbox读取邮件联系人,需要同意才能进行下一步,然后在列表中选择你要邀请的用户名,Dropbox会自动发送推广邮件,邮件里的链接是你的邀请链接.还有就是Facebook帐户关注Dropbox和发Facebook博文,带上你的Dropbox推广链接.另一个是使用twitter帐号关注Dropbox或@Dropbox以及发送twitter博文.以上的每种方式都有125MB的容量奖励.
最后一种就是获得你的推广链接进行推广,https://www.dropbox.com/referrals 在这里可以看到您的推广链接.比如http://db.tt/kCaOEpbI

最后附上注册及安装使用中需要的英文的翻译汉化.

注册:
Welcome to dropbox
欢迎到Dropbox
Bring your photos,docs and videos anywhere Take a tour
把您的照片,文档和视频的任何地方采取参观
First name
名字
Last name
姓
Email
电子邮件
Password
密码
I agree to Dropbox Terms
我同意条款
Create account
创建帐户
what is Dropbox?
什么是Dropbox?

使用:
Open Dropbox Folder
打开Dropbox文件夹
Launch Dropbox Website
启动Dropbox的网站
Recently Changed Files
最近修改的文件
**% of 2.0GB used
使用2.0GB的百分之几
All files up to date
所有的文件
Get More Space
获得更多的空间
Pause Syncing
暂停同步
Preferences
首选项
Help center
帮助中心
Quit Dropbox
退出的Dropbox