阅读leishao的编程日志

我终于有了一台小小小小的服务器

今天申请了linode的vps 服务器 最小的plan,360M的内存,16G的硬盘。作为备份服务器和自己的试验田,应该都够用了。购买的过程很顺利,不过你得有一张支持双币的信用卡。

最重要的就是服务器的机房的选用,我选的是 Fremont, CA, USA

我选的是CentOS5.5的操作系统,开机一进去,占用的内存才16M!系统干净得出乎我的意料。

接下来装一个VPN,然后装nginx,可以慢慢玩了。happy coding!

点击以下链接注册,我会得到一些些优惠。
http://www.linode.com/?r=bfd894cac8df6214c69e7d360e18c09aee658da2

一些参考资料:

1、Linode 购买、安装、测试、配置教程

2、Linode VPS的申请和设置及基于Nginx的WordPress详细配置

3、Linode介绍

解决centos5.4 搭建好了pptpd却无法连接的问题

朋友在自己的服务器上搭建好了pptpd 服务器,好链接vpn结果却无法链接。google了半天

最后决定查看日志,pptpd的日志位于 /var/log/message

在windows拨vnp链接,然后tail -f /var/log/message 查看日志信息

出现了

May 30 11:32:56 localhost pppd[3398]: In file /etc/ppp/options.pptpd: unrecognized opt ion ‘repuire-chap’

在配置文件中注释掉 repurie-chap 这行

接着的问题是:

May 30 11:58:05 localhost pppd[5503]: Plugin /usr/lib/pptpd/pptpd-logwtmp.so is for pp    pd version 2.4.3, this is 2.4.4

google 一下,貌似要下载源码编译新的plugin

1、下载源代码

wget http://nchc.dl.sourceforge.net/project/poptop/pptpd/pptpd-1.3.4/pptpd-1.3.4.tar.gz

2、解压缩进入plugin目录

tar xvf  pptpd-1.3.4.tar.gz

cd pptpd-1.3.4/plugins

cp patchlevel.h patchlevel.h.bak

sed  -i  ’s/2\.4\.3/2\.4\.4/’ patchlevel.h

make

然后把新生成的pptpd-logwtmp.so 拷贝到相应目录即可

cp pptpd-logwtmp.so /usr/local/lib/pptpd/pptpd-logwtmp.so

OK,解决

总结,学会看日志很重 tail -f /var/log/message

–EOF–

pku acm online jude 分类存档

acm.pku.edu.cn

1、 排序
1423, 1694, 1723, 1727, 1763, 1788, 1828, 1838, 1840, 2201, 2376, 2377, 2380, 1318, 1877, 1928, 1971, 1974, 1990, 2001, 2002, 2092, 2379,
1002(需要字符处理,排序用快排即可) 1007(稳定的排序) 2159(题意较难懂) 2231
2371(简单排序) 2388(顺序统计算法) 2418(二*排序树)
2、 搜索、回溯、遍历
1022,1111,1118,1129,1190,1562,1564,1573,1655,2184,2225,2243,2312,2362,2378,2386,1010,1011,1018,1020,1054,1062,1256,1321,1363,1501,1650,1659,1664,1753,2078,208
3,2303,2310,2329

简单:1128, 1166, 1176, 1231, 1256, 1270, 1321, 1543, 1606, 1664, 1731, 1742, 1745, 1847, 1915, 1950, 2038, 2157, 2182, 2183, 2381, 2386, 2426,
不易:1024, 1054, 1117, 1167, 1708, 1746, 1775, 1878, 1903, 1966, 2046, 2197, 2349,
推荐:1011, 1190, 1191, 1416, 1579, 1632, 1639, 1659, 1680, 1683, 1691, 1709, 1714, 1753, 1771, 1826, 1855, 1856, 1890, 1924, 1935, 1948, 1979, 1980, 2170, 2288, 2331, 2339, 2340,1979(和迷宫类似) 1980(对剪枝要求较高)
3、 历法
1008 2080 (这种题要小心)
4、 枚举
1012,1046, 1387, 1411, 2245, 2326, 2363, 2381,1054(剪枝要求较高),1650(小数的精度问题)
5、 数据结构的典型算法
容易:1182, 1656, 2021, 2023, 2051, 2153, 2227, 2236, 2247, 2352, 2395,
不易:1145, 1177, 1195, 1227, 1661, 1834,
推荐:1330, 1338, 1451, 1470, 1634, 1689, 1693, 1703, 1724, 1988, 2004, 2010, 2119, 2274, 1125(弗洛伊德算法) ,2421(图的最小生成树)
6、 动态规划
1037 A decorative fence、
1050 To the Max、
1088 滑雪、
1125 Stockbroker Grapevine、
1141 Brackets Sequence、
1159 Palindrome、
1160 Post Office、
1163 The Triangle、
1458 Common Subsequence、
1579 Function Run Fun、
1887 Testing the CATCHER、
1953 World Cup Noise、
2386 Lake Counting
动态规划
容易:
1018, 1050, 1083, 1088, 1125, 1143, 1157, 1163, 1178, 1179, 1189, 1208, 1276, 1322, 1414, 1456, 1458, 1609, 1644, 1664, 1690, 1699, 1740, 1742, 1887, 1926, 1936, 1952, 1953, 1958, 1959, 1962, 1975, 1989, 2018, 2029, 2033, 2063, 2081, 2082, 2181, 2184, 2192, 2231, 2279, 2329, 2336, 2346, 2353, 2355, 2356, 2385, 2392, 2424,
不易:
1019, 1037, 1080, 1112, 1141, 1170, 1192, 1239, 1655, 1695, 1707, 1733, 1737, 1837, 1850, 1920, 1934, 1937, 1964, 2039, 2138, 2151, 2161, 2178,
推荐:
1015, 1635, 1636, 1671, 1682, 1692, 1704, 1717, 1722, 1726, 1732, 1770, 1821, 1853, 1949, 2019, 2127, 2176, 2228, 2287, 2342, 2374, 2378, 2384, 2411,
7、 贪心
1042, 1065, 1230, 1784,1328 1755(或用单纯形方法),2054,1017, 1328,1862, 1922 ,2054, 2209, 2313, 2325, 2370。
8、 模拟
容易:1006, 1008, 1013, 1016, 1017, 1169, 1298, 1326, 1350, 1363, 1676, 1786, 1791, 1835, 1970, 2317, 2325, 2390,
不易:1012, 1082, 1099, 1114, 1642, 1677, 1684, 1886,1281 1928 2083 2141 2015
9、 递归
1664
10、字符串处理
1488, 1598, 1686, 1706, 1747, 1748, 1750, 1760, 1782, 1790, 1866, 1888, 1896, 1951, 2003, 2121, 2141, 2145, 2159, 2337, 2359, 2372, 2406, 2408, 1016 1051 1126 1318 1572 1917 1936 2039 2083 2136 2271 2317 2330,2121 2403
11、数论
1006,1014,1023,1061,1152,1183,1730,2262
12、几何有关的题目
凸包:1113, 1228, 1794, 2007, 2187,1113 wall,2187 beauty contest
容易:1319, 1654, 1673, 1675, 1836, 2074, 2137, 2318,
不易:1685, 1687, 1696, 1873, 1901, 2172, 2333,
13、任意精度运算、数字游戏、高精度计算
1001 1023 1047 1060 1079 1131 1140 1142 1207 1220 1284 1289 1306 1316 1338 1405 14541503 1504 1519 1565 1650 1969 2000 2006 2081 2247 2262 2305 2316 2389
1001, 1220, 1405, 1503,1001(高精度乘法) 2413(高精度加法,还有二分查找)
14、概率统计
1037,1050
15、小费用最大流、最大流
2195 going home,2400 supervisor, supervisee,1087 a plug for UNIX,1149 PIGS,1273 drainage ditches,1274 the perfect stall,1325 machine schedule,1459 power network,2239 selecting courses
16、压缩存储的DP
1038 bugs integrated inc,1185 炮兵阵地,2430 lazy cow
17、最长公共子串(LCS)
1080 human gene functions,1159 palindrome,1458 common subsequence,2192 zipper
18、图论及组合数学
2421 Constructing Roads、
2369 Permutations、
2234 Matches Game、
2243 Knight Moves、
2249 Binomial Showdown、
2255 Tree Recovery、
2084 Game of Connections、
1906 Three powers、
1833 排列、
1850 Code、
1562 Oil Deposits、
1496 Word Index、
1306 Combinations、
1125 Stockbroker Grapevine、
1129 Channel Allocation、
1146 ID Codes、
1095 Trees Made to Order、找规律
2247 Humble Numbers、
2309 BST、
2346 Lucky tickets、
2370 Democracy in danger、
2365 Rope、
2101 Honey and Milk Land
2028 When Can We Meet?、
2084 Game of Connections、
1915 Knight Moves、
1922 Ride to School、
1941 The Sierpinski Fractal、
1953 World Cup Noise、
1958 Strange Towers of Hanoi、
1969 Count on Canton、
1806 Manhattan 2025、
1809 Regetni、
1844 Sum、
1870 Bee Breeding、
1702 Eva\’s Balance、
1728 A flea on a chessboard、
1604 Just the Facts、
1642 Stacking Cubes、
1656 Counting Black、
1657 Distance on Chessboard、
1662 CoIns、
1663 Number Steps、
1313 Booklet Printing、
1316 Self Numbers、
1320 Street Numbers、
1323 Game Prediction、
1338 Ugly Numbers、
1244 Slots of Fun、
1250 Tanning Salon、
1102 LC-Display、
1147 Binary codes、
1013 Counterfeit Dollar、
19、博弈类
1067 取石子游戏、
1740 A New Stone Game、
2234 Matches Game、
1082 Calendar Game 、
2348 Euclid\’s Game、
2413 How many Fibs?、
2419 Forest
20、简单、模拟题
1001 Exponentiation 、
1002 487-3279、
1003 Hangover 、
1701 Dissatisfying Lift、
2301 Beat the Spread!、
2304 Combination Lock、
2328 Guessing Game、
2403 Hay Points 、
2406 Power Strings、
2339 Rock, Scissors, Paper、
2350 Above Average、
2218 Does This Make Me Look Fat?、
2260 Error Correction、
2262 Goldbach\’s Conjecture、
2272 Bullseye、
2136 Vertical Histogram、
2174 Decoding Task、
2183 Bovine Math Geniuses、
2000 Gold Coins、
2014 Flow Layout、
2051 Argus、
2081 Calendar、
1918 Ranking List、
1922 Ride to School、
1970 The Game、
1972 Dice Stacking、
1974 The Happy Worm、
1978 Hanafuda Shuffle、
1979 Red and Black、
1617 Crypto Columns、
1666 Candy Sharing Game、
1674 Sorting by Swapping、
1503 Integer Inquiry、
1504 Adding Reversed Numbers、
1528 Perfection、
1546 Basically Speaking、
1547 Clay Bully、
1573 Robot Motion、
1575 Easier Done Than Said?、
1581 A Contesting Decision、
1590 Palindromes、
1454 Factorial Frequencies、
1363 Rails、
1218 THE DRUNK JAILER、
1281 MANAGER、
1132 Border、
1028 Web Navigation、
21、初等数学
1003 Hangover、
1045 Bode Plot、
1254 Hansel and Grethel、
1269 Intersecting Lines、
1401 Factorial、
1410 Intersection、
2363 Blocks 、
2365 Rope、
2242 The Circumference of the Circle、
2291 Rotten Ropes、
2295 A DP Problem、
2126 Factoring a Polynomial、
2191 Mersenne Composite Numbers、
2196 Specialized Four-Digit Numbers、
1914 Cramer\’s Rule、
1835 宇航员、
1799 Yeehaa!、
1607 Deck、
1244 Slots of Fun、
1269 Intersecting Lines、
1299 Polar Explorer、
1183 反正切函数的应用、
22、匹配
1274, 1422, 1469, 1719, 2060, 2239
===================================
经典
1011(搜索好题)
1012(学会打表)
1013
1019(它体现了很多此类问题的特点)
1050(绝对经典的dp)
1088(dp好题)
1157(花店,经典的dp)
1163(怎么经典的dp那么多呀???)
1328(贪心)
1458(最长公共子序列)
1647(很好的真题,考临场分析准确和下手迅速)
1654(学会多边形面积的三角形求法)
1655(一类无根树的dp问题)
1804(逆序对)
2084(经典组合数学问题)
2187(用凸包求最远点对,求出凸包后应该有O(N)的求法,可我就是调不出来)
2195(二分图的最佳匹配)
2242(计算几何经典)
2295(等式处理)
2353(dp,但要记录最佳路径)
2354(立体解析几何)
2362(搜索好题)
2410(读懂题是关键)
2411(经典dp)

趣味
1067(很难的数学,但仔细研究,是一片广阔的领域)
1147(有O(n)的算法,需要思考)
1240(直到一棵树的先序和后序遍历,那么有几种中序遍历呢?dp)
1426(是数论吗?错,是图论!)
1648(别用计算几何,用整点这个特点绕过精度的障碍吧)
1833(找规律)
1844(貌似dp或是搜索,其实是道有趣的数学题)
1922(贪心,哈哈)
2231
2305(不需要高精度噢)
2328(要仔细噢)
2356(数论知识)
2359(约瑟夫问题变种)
2392(有趣的问题)

很繁的题
1001
1008
1087(构图很烦,还有二分图的最大匹配)
1128(USACO)
1245
1329
1550(考的是读题和理解能力)
1649(dp)
2200(字符串处理+枚举)
2358(枚举和避免重复都很烦)
2361(仔细仔细再仔细)

难题
1014(数学证明比较难,但有那种想法更重要)
1037(比较难的dp)
1405(高精度算法也分有等级之分,不断改进吧)
2002(不知道有没有比O(n^2*logn)更有的算法?)
2054(极难,很强的思考能力)
2085(组合数学)
2414(dp,但要剪枝)
2415(搜索)
2423(计算几何+统计)

多解题
1002(可以用排序,也可以用统计的方法)
1338(搜索和dp都可以)
1664(搜索和dp都练一练吧)
2082(这可是我讲的题噢)
2352(桶排和二*树都行)

Note:
1011: 很经典的剪支
1014: 难在数学上
1017: 严格的数学证明貌似不容易
1021: 有点繁,考察对图形进行各种旋转的处理
1083: 巧妙的思考角度
1150: 分奇偶讨论,lg(n)算法
1218: 三行就够了,虽然简单,但也有优劣之别
1505: 二分加贪心
1654: 做法也许很多吧,本人用有向面积做的
1674: 计算圈的个数(算是graph 吧)
1700: 数学证明不容易
1742: O(m*n)的算法
1863: 要耐心地慢慢写…^_^
1988: 并查集
2051: 堆
2078: 不难,但剪支可以做到很好
2082::O(n),你想到了吗?
2084: 卡特兰数
2182: 线段树
2195: 最小费用最大流
2234: 经典博弈算法
2236: 并查集
2299: 二分思想
2395: Kruskal 最小生成树的拓展
2406: KMP
2411: 用二进制串来表示状态

其实最好的做题时间是在大学时候,现在仅做存档吧。

selinux的操作

selinux服务在centos中是默认开启的,不过它的存在常常影响到apache等服务器的访问,下面是centos 中的一些selinux的常识

1、配置文件

/etc/selinux/config

SELINUX =”enforcing” 为开启  SELINUX =”disabled” 为关闭

2、查看selinux的状态

getenforce

3、设置selinux

一种使用setenforce命令


setenforce  1  //开启selinux

setenforce  0  //关闭selinux

二、修改配置文件

三、修改grub

在grub的启动参数中增加:selinux=0 关闭 selinux

ubuntu启用root用户

出于安全的考虑,ubuntu是禁用root用户的,普通用户可以通过sudo来获得root权限。如果你要切换到root用户可以通过一下几种方式

一、添加root的用户的密码

sudo passwd root

二、直接sudo切换

sudo -s

如果要禁用root用户直接 sudo passwd -l root 即可

–EOF–

开始学习CI

学习CI 一个简单的学习新框架的案例                 

原来的学过cakephp,也用cakephp做过一个项目,zendframewokr的学习曲线太抖了,所以选择CodeIgniter进行 快速开发,学习的东西能立马作出来才有意义

zendframework 无论是cakephp还是zendframework 都是类似于rails的框架,重配置,基本遵循DRY的原则 ZendFramework 应用了非常多的设计模式,甚至有点像java了。 看看CodeIgniter的特性吧

CodeIgniter 就是你所需要的,如果…

  • 你想要一个小巧的框架。
  • 你需要出色的性能。
  • 你需要广泛兼容标准主机上的各种 PHP 版本和配置(例如 PHP4)。
  • 你想要一个几乎只需 0 配置的框架。
  • 你想要一个不需使用命令行的框架。
  • 你想要一个不需坚守限制性编码规则的框架。
  • 你对 PEAR 这种大规模集成类库不感兴趣。
  • 你不希望被迫学习一门模板语言(虽然可以选择你喜欢的模板解析器)。
  • 你不喜欢复杂,热爱简单。
  • 你需要清晰、完整的文档。

那现在就开始吧 当然每个框架都有它的代表CMS,CodeIgniter也不例外,那就是expressionengine http://expressionengine.com/

还有就是参考文档,以及一本书: codeigniter-for-rapid-php-application-development

ubuntu10.04 使用google dns

最近公司的dns服务器经常抽风,所以干脆把dns给改了。

一、备份

mv  /etc/resolv.conf  /etc/resolv.conf.bak

二、编辑文件resolv.conf

sudo vim /etc/resolv.conf

清空文件内容,然后加入下面两行

nameserver 8.8.8.8
nameserver 8.8.4.4

保存退出(:wq)

三、设置文件/etc/resolv.conf 为只读 (防止被dhcp更改)

sudo chattr +i  /etc/resolv.conf

四、重启网络

sudo /etc/init.d/networking restart

五、测试是否生效

测试是否可以生效
1、查看使用的dns服务器
leishao@codinglog:~$ nslookup
> server
Default server: 8.8.8.8
Address: 8.8.8.8#53
Default server: 8.8.8.4
Address: 8.8.8.4#53

2、测试路由
sudo apt-get install traceroute

sudo traceroute -n -w 2 -q 2 -m 30 8.8.8.8

3、测试dns服务器是否可以使用
nslookup -debug blog.codinglog.net 8.8.8.8

4、测试是否可以使用其他的dns服务器
nslooup blog.codinglog.net 4.2.2.1  # Level 3’s DNS SERVER
nslooup blog.codinglog.net 4.2.2.2  # Level 3’s DNS SERVER
nslookup blog.codinglog.net 208.67.222.222  #OPEN DNS

测试完毕,大功告成!

apache中文显示乱码处理

新开一网站,打开全是乱码,立即想到是apache服务器编码的问题,打开apache的配置文件httpd.conf,找到

AddDefaultCharset UTF8

改为

AddDefaultCharset OFF

搞定!

原理:

当且仅当应答内容是text/plain或text/html时,AddDefaultChartset将会在HTTP应答头中加入的默认字符集。理论上这将覆盖在文档体中通过<meta>标签指定的字符集,AddDefaultCharset Off 将会禁用此功能。AddDefaultCharset On 将启用Apache内部的默认字符集iso-8859-1

所以如果设定了AddDefaultChartSet 选项,首先显示服务器设置的字符集,然后才是由网页的meta指定的字符集

AddDefaultCharset只应当在如下情况下使用:所有文本资源都使用同一种确定的字符集,且分别标记他们的字符集非常麻烦。一个这样的例子是向包含动态内容的资源中添加字符集参数(比如先前遗留的CGI脚本),这样可能会因为在输出中包含用户提供的数据而导致跨站点脚本攻击。但是请注意:更好的解决办法是修改或删除这些脚本,因为设置了默认的字符集以后将会使得浏览器的字符集自动探测功能失效。

所以如果你的页面编码是gb2312,而且页面没有指定meta,你就可以直接在虚拟主机主机配置文件或者相应的配置文件中加入AddDefaultCharSet GB2312解决

另利用AddCharSet 建立文件的后缀文件名和相应的字符集进行映射,比如:

AddLanguage ja .ja
AddCharset ISO-2022-JP .jis

文档xxxx.ja.jis会被当成是使用字符集ISO-2022-JP的日文文档

二分法算法实现

二分查找(binary search),也叫做折半查找。主要是对一个已经排序的数组进行查找,复杂度为O(logn)。

基本过程:

将要查找的值x与数组的中间元素进行比较。如果输入的值x 小于中间元素的值,则在该数组的前半部分查找;否则,在该数组的后半部分查找。如此循环,直到得出结果。

//php的二分法搜索
function binarysearch($key,$arr) {
$low =  0;
$high = count($arr) -1 ;

while($low <=  $high)
{
$mid = (int)(($low + $high)/2);
if ($key < $arr[$mid]) $high = $mid -1; else if ($key > $arr[$mid])
$low = $mid + 1;
else
return $mid;
}
return -1;
}

//测试
$test = array(1,2,3,5,7,9,11,20,222);
$key = 20;
$result = binarysearch($key,$test);
//返回的是7
echo $result;

在 centos5.2上搭建lamp测试环境

今天按测试人员要求给sugarcrm搭建一台lamp的web服务器,做点笔记好歹忙活了半天。
一、安装完centos后,第一件要做的就是调 整系统的开机启动服务减少占用资源
1、禁用selinux 和iptables 以及设定开机启动服务若干
最简单的办法:直接在命令行 setup进行配置
selinux的配置文件为 /etc/sysconfig/selinux
如果你禁用的话可以手动进行编辑,也可以 在root权限下使用sed命令:
sed -i ‘/SELINUX=enforcing/s/SELINUX=enforcing/SELINUX=disabled/’ /etc/sysconfig/selinux

对于开机启动服务,可以使用ntsysv进行管理,运行ntsysv后,按空格键代表选中

设 定好后可以按以下命令查看服务的状态:

查看服务
chkconfig –list | wc -l  查询系统总共的服务 个数
chkconfig –list | grep 3:on | wc -l 查询个数
chkconfig –list | grep 3:on | cut -f1查询运行中的服务

二、安装php5.2版本的和mysql server
由于默认源里面的php是5.1的,而 sugarcrm 需要的php版本是5.2的 所以需要从测试仓库中安装新版本的php
1、新建测试源文件
vim /etc/yum.repos.d/CentOS-Testing.repo
# CentOS-Testing:
# !!!! CAUTION !!!!
# This repository is a proving grounds for packages on their way to CentOSPlus and CentOS Extras.
# They may or may not replace core CentOS packages, and are not guaranteed to function properly.
# These packages build and install, but are waiting for feedback from testers as to
# functionality and stability. Packages in this repository will come and go during the
# development period, so it should not be left enabled or used on production systems without due
# consideration.
[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
includepkgs=php*

ps: 加上includepkgs 这行是因为我只想升级php

yum install php-common -y

2、 安装mysql服务器并设置开机启动

安装mysql服务器
yum install mysql-server

/usr/bin/mysqladmin -u root password ‘new-password’

添加到系统服务中

/sbin/chkconfig –add mysqld         [在服务清单中添加mysql服务]

/sbin/chkconfig mysqld on             [设置mysql服务开机启动]

3、忘记mysql密码的处理

首先,你必须拥有 MySQL操作的所有权限;

其次,停止MySQL服务:/etc/init.d/mysql stop

第三,使用无权限 模式启动MySQL服务:mysqld_safe –skip-grant-tables –skip-networking &

第 四,登录MySQL重置密码:mysql -u your_user_name mysql
mysql> UPDATE user SET Password=PASSWORD(‘New_of_Your_Password’) WHERE User=’your_user_name’;
mysql> FLUSH PRIVILEGES;

最后,不要忘记重启你的MySQL已使修改生效:/etc/init.d/mysql restart

感谢mcspring提供的方法

http://hi.baidu.com/mcspring/blog/item/78ab84136d142adaf7039ee1.html

三、 设定centos的网络启动方式
由于明天得把服务器搬到另一个地方,所以得设置一下centos服务器以静态ip获取地址,这样才可以ssh到
服 务器上
到/etc/sysconfig/network-scripts/ 目录寻找网卡的配置文件,比如第一个网卡就是ifcfg-eth0
更 改为下面这种格式,更改之前先做下备份
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
NETMASK=255.255.255.0
IPADDR=172.17.103.10
USERCTL=no
PEERDNS=yes
GATEWAY=172.17.103.254

注 解:
DEVICE 接口名(设备,网卡)
BOOTPROTO IP的配置方法(static:固定IP, dhcpHCP, none:手动)
HWADDR MAC地址
ONBOOT 系统启动的时候网络接口是否有效(yes/no)
TYPE 网络类型(通常是Ethemet)
NETMASK 网络掩码
IPADDR IP地址
IPV6INIT IPV6是否有效(yes/no)
GATEWAY 默认网关IP地址

设置完后重启服务器的网络

service network restart

四、关于sugarcrm安装的一些说明
1、保证sugarcrm目录可写
2、保证data和data/upload目录可写
3、modules 目录可写
4、cache以及其子目录可写
5、custom目录可写
这样就可以了,收工 ^_^