只写操作的过程,其它没有相应的说明!!
CentOS 5.4下配置pptpd服务器已经在其它篇章中有描述,这里为文章的链接入口<< CentOS release 5.4 (Final) 配置PPTP VPN服务器(初步)>>
!!本文也是在此基础上做的改变,请先参照上述文章,完成PPTP VPN服务器的构建,再做如下步骤!!
一、安装相关配置包
1、安装httpd、mysql及php相关包
[root@localhost ~]# yum -y install httpd httpd-devel mysql mysql-server mysql-devel [root@localhost ~]# yum -y install php php-devel php-mysql php-common php-gd php-mbstring php-mcry
2、配置httpd服务:
[root@localhost ~]# netstat -ant |grep 80 [root@localhost ~]# /etc/init.d/httpd start Starting httpd: [ OK ] [root@localhost ~]# vi /etc/sysconfig/iptables [root@localhost ~]# grep 80 /etc/sysconfig/iptables -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 80 -j ACCEPT #增加此行 [root@localhost ~]# /etc/init.d/iptables restart Flushing firewall rules: [ OK ] Setting chains to policy ACCEPT: filter nat [ OK ] Unloading iptables modules: [ OK ] Applying iptables firewall rules: [ OK ] Loading additional iptables modules: ip_conntrack_netbios_n[ OK ] [root@localhost ~]# chkconfig httpd --list httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off [root@localhost ~]# chkconfig httpd on #设置httpd自动启动 [root@localhost ~]# chkconfig httpd --list httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off [root@localhost ~]# netstat -ant |grep 80 tcp 0 0 :::80 :::* LISTEN
3、启动mysql数据库:
[root@localhost ~]# /etc/init.d/mysqld start Initializing MySQL database: Installing MySQL system tables... OK Filling help tables... OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /usr/bin/mysqladmin -u root password 'new-password' /usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password' Alternatively you can run: /usr/bin/mysql_secure_installation See the manual for more instructions. You can start the MySQL daemon with: cd /usr ; /usr/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd mysql-test ; perl mysql-test-run.pl Please report any problems with the /usr/bin/mysqlbug script! The latest information about MySQL is available on the web at http://www.mysql.com Support MySQL by buying support/licenses at http://shop.mysql.com [ OK ] Starting mysqld: [ OK ]4、设置数据库密码;
[root@localhost ~]# mysqladmin -u root password 'leekwen'
5、安装Freeradius2相关包
[root@localhost ~]# yum install -y freeradius2 freeradius2-mysql freeradius2-utils
6、启动radius进程,调试模式:
[root@localhost ~]# radiusd -X FreeRADIUS Version 2.1.12, for host i386-redhat-linux-gnu, built on Jan 9 2013 at 05:02:57 Copyright (C) 1999-2009 The FreeRADIUS server project and contributors. ... adding new socket proxy address * port 51738 Listening on authentication address * port 1812 Listening on accounting address * port 1813 Listening on command file /var/run/radiusd/radiusd.sock Listening on authentication address 127.0.0.1 port 18120 as server inner-tunnel Listening on proxy address * port 1814 Ready to process requests.
7、开启另外一个终端进行测试,如图:
8、如果结果与上图不同,请临时关闭防火墙后,临时关闭防火墙命令如下:
[root@localhost ~]# iptables -F
重新运行测试命令:
[root@localhost ~]# radtest steve testing localhost 1812 testing123##############
# !!error !! #
##############
Failed binding to authentication address * port 1812: Address already in use
/etc/raddb/radiusd.conf[240]: Error binding to port for 0.0.0.0 port 1812
请先用 lsof 命令查看,再用 killall -9 radiusd命令结束后,重新开启服务后,在进行测试!
二、下载ppp源码文件,集成ppp client:
1、下载源码:
[root@localhost ~]# wget ftp://ftp.samba.org/pub/ppp/ppp-2.4.4.tar.gz --2013-07-01 18:33:36-- ftp://ftp.samba.org/pub/ppp/ppp-2.4.4.tar.gz => `ppp-2.4.4.tar.gz' Resolving ftp.samba.org... 216.83.154.106, 2001:470:1f05:1a07::1 Connecting to ftp.samba.org|216.83.154.106|:21... connected. Logging in as anonymous ... Logged in! ==> SYST ... done. ==> PWD ... done. ==> TYPE I ... done. ==> CWD /pub/ppp ... done. ==> SIZE ppp-2.4.4.tar.gz ... 688763 ==> PASV ... done. ==> RETR ppp-2.4.4.tar.gz ... done. Length: 688763 (673K) 100%[===========================================>] 688,763 135K/s in 5.3s 2013-07-01 18:33:45 (127 KB/s) - `ppp-2.4.4.tar.gz' saved [688763]
2、解压并做相关配置
[root@localhost ~]# tar zxf ppp-2.4.4.tar.gz [root@localhost ~]# cp -R ppp-2.4.4/pppd/plugins/radius/etc/ /etc/radiusclient [root@localhost ~]# cp /etc/radiusclient/radiusclient.conf /etc/radiusclient/radiusclient.conf.bak [root@localhost ~]# vi /etc/radiusclient/radiusclient.conf 行号 修改前的配置文件 修改后的配置文件 25 issue /usr/local/etc/radiusclient/issue 修改为:issue /etc/radiusclient/issue 46 servers /usr/local/etc/radiusclient/servers 修改为:servers /etc/radiusclient/servers 50 dictionary /usr/local/etc/radiusclient/dictionary 修改为:dictionary /etc/radiusclient/dictionary 61 mapfile /usr/local/etc/radiusclient/port-id-map 修改为:mapfile /etc/radiusclient/port-id-map说明:修改相关配置文件的路径,确保radiusclient.conf这个文件中radiusclient相关的路径都是“/etc/radiusclient”开头的.
3、配置字典文件:
[root@localhost ~]# ls -l /etc/radiusclient/dictionary* -rw-r--r-- 1 root root 7656 Jul 1 18:34 /etc/radiusclient/dictionary -rw-r--r-- 1 root root 12295 Jul 1 18:34 /etc/radiusclient/dictionary.ascend -rw-r--r-- 1 root root 1395 Jul 1 18:34 /etc/radiusclient/dictionary.compat -rw-r--r-- 1 root root 599 Jul 1 18:34 /etc/radiusclient/dictionary.merit -rw-r--r-- 1 root root 2649 Jul 1 18:34 /etc/radiusclient/dictionary.microsoft [root@localhost ~]# vi /etc/radiusclient/dictionary 行号 文件内容 253 INCLUDE /etc/radiusclient/dictionary.microsoft 254 INCLUDE /etc/radiusclient/dictionary.merit #增加此行 255 INCLUDE /etc/radiusclient/dictionary.ascend #增加此行 256 INCLUDE /etc/radiusclient/dictionary.compat #增加此行
4、在pptpd服务中添加freeradius插件:
1. 激活可浏览的表单模板
Set-SPInfoPathFormsService -AllowUserFormBrowserEnabling $true -AllowUserFormBrowserRendering $true
2. 设置数据连接超时
Set-SPInfoPathFormsService –DefaultDataConnectionTimeout 15 –MaxDataConnectionTimeout 25
3. 设置数据连接响应大小
Set-SPInfoPathFormsService –MaxDataConnectionResponseSize 3
4. 修改认证设置
Set-SPInfoPathFormsService –RequireSslForDataConnections $true – AllowEmbeddedSqlForDataConnection $true – AllowUdcAuthenticationForDataConnections $true – AllowUserFormCrossDomainDataConnections $true
RequireSslForDataConnections:True为表单使用HTTP认证时需要SSL加密。
AllowEmbeddedSqlForDataConnection:当有包含用户名和密码的数据库连接信息的数据连接文件时,设置为True。
AllowUdcAuthenticationForDataConnections:是否允许自定义表单通过数据连接文件访问数据源。
AllowUserFormCrossDomainDataConnections:当表单需要访问与SharePoint不同的数据源时,设置为True。
5. 设置会话状态
Set-SPInfoPathFormsService –MaxPostbacksPerSession 110 – ActiveSessionTimeout 720
6. 启用视图状态
Set-SPInfoPathFormsService –AllowViewState $true –ViewStateThreshold 40961
7. 验证并上传表单模板
Test-SPInfoPathFormTemplate -Path "<<full path to InfoPath form template>>" Install-SPInfoPathFormTemplate-Path "<<full path to InfoPath form template>>"
8. 一次上传多个表单模板
"<<path of form 1>>" , "<<path of form 2>" , "<<path of form 3>>" | Install-SPInfoPathFormTemplate
9. 激活/反激活网站集的表单模板
Enable-SPInfoPathFormTemplate -Identity "<<name of form template>>" -Site "<<URL of Site Collection>>"
Disable-SPInfoPathFormTemplate -Identity "<<name of form template>>" -Site "<<URL of Site Collection>>"
10. 从InfoPath表单服务移除一个表单
Uninstall-SPInfoPathFormTemplate -Identity "<<name of form template>>"
11. 禁用InfoPath表单服务中的某一表单
Stop-SPInfoPathFormTemplate -Identity "<<name of form template>>"
12. 启用Web服务代理
Set-SPInfoPathWebServiceProxy -Identity "<<URL of web application>>" -AllowWebServiceProxy $true
Set-SPInfoPathWebServiceProxy -Identity "<<URL of web application>>" -AllowForUserForms $true
减少键盘输入,可以大大提高程序员的工作效率,快捷键的使用就是一个很好的例子。程序员经常使用终端。那么在终端上有没有类似的“快捷键”可以提高我们的效率呢?程序员的工作往往是前后相关连的。所以,本文将演示如何使用上一条命令提高工作效率的。
1.使用上一条命令的所有参数
方法:!*
例子:如果我对hello.txt和bye.txt进行了编辑,然后希望使用git add添加这两个文件。就可以使用:git add !*
2.使用上一条命令的最后一个参数
方法:!$
ALT + .
ESC + .
其中后面两种方法,terminal中会自动补全
3.使用上一条命令中除了最后一个参数的部分
方法:!-:
例子:个人认为这个比较有用,因为有些命令中间会输入一大堆选项,最后一个才是实际发挥作用的对象,如果再次输入选项,会显得麻烦。
4.使用上一条命令中任意一个部份
方法:ALT + <num> + .
其中num表示的上一条命令中的第几部分,从0开始,对于ls -shld hello.txt。ALT +0+. 就是ls。1就是-shld
5.替换上一条命令中的一个部份
方法:将foo替换为bar
^foo^bar 仅替换地一个
!!:gs/foo/bar 替换所有
6.上一条命令
方法:!!
最后:推荐一个网站,可以这样来学习,如果遇到一条需要输入的命令,让你觉得需要键盘输入过多,或者说你猜想可能有更好的、更快捷的方式时,不妨到这个网站上来搜一下,这样慢慢积累,加以时日,应该还是有一定的收获: commandlinefu.com