Guides

          對guides這個詞認識源于struts文檔,參考、指南,這里是sfilyh 關(guān)于CODE的guides。

            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
            21 隨筆 :: 1 文章 :: 5 評論 :: 0 Trackbacks

          2011年12月22日 #


          1.配置網(wǎng)絡參數(shù) /etc/sysconfig/network-scripts/ifcfg-eth0
          請記得,這個 ifcfg-eth0 與文件內(nèi)的 DEVICE 名稱配置需相同,并且,在這個文件內(nèi)的所有配置, 基本上就是 bash 的變量配置守則啦!
          [root@linux ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
          DEVICE
          =eth0                <== 網(wǎng)絡卡代號,必須要 ifcfg-eth0 相對應
          BOOTPROTO
          =static           <== 啟動協(xié)議,有 dhcp 及 static 這里是 static
          BROADCAST
          =192.168.1.255    <== 就是廣播位址羅
          HWADDR
          =00:40:D0:13:C3:46   <== 就是網(wǎng)絡卡位址
          IPADDR
          =192.168.1.13        <== 就是 IP 啊
          NETMASK
          =255.255.255.0      <== 就是子遮罩網(wǎng)絡
          NETWORK
          =192.168.1.0        <== 就是網(wǎng)域啊!該網(wǎng)段的第一個 IP
          GATEWAY
          =192.168.1.2        <== 就是默認路由!
          ONBOOT
          =yes                 <== 是否啟動啟動的意思
          MTU
          =1500                   <== 就是最大傳輸單元的配置值。
          #GATEWAYDEV
          =eth0           <== 主要路由的裝置為那個,通常不用配置
          配置完成后啟動網(wǎng)卡,ifup eth0 。此時可以ping通局域網(wǎng)內(nèi)的計算機。

          2.配置 DNS 的 IP: /etc/resolv.conf
          [root@linux ~]# vi /etc/resolv.conf
          nameserver 
          168.95.1.1
          nameserver 
          139.175.10.20


          3.配置默認路由   /etc/sysconfig/static-routes
          [root@linux sysconfig]# vi /etc/sysconfig/static-routes
          any net 
          0.0.0.0 gw 192.168.1.1


          三步配置下來,內(nèi)網(wǎng)和外網(wǎng)ping 成功!

           《靜態(tài)路由詳細介紹》
            http://my.oschina.net/qichang/blog/33458

           《鳥哥的 Linux 私房菜筆記》在線版
            http://vbird.dic.ksu.edu.tw/linux_basic/linux_basic.php
          posted @ 2012-02-28 16:46 Guides 閱讀(229) | 評論 (0)編輯 收藏


          1.查看當前系統(tǒng)中的用戶
          select user,host,password from mysql.user

           2.為用戶設(shè)置密碼
          set password for root@localhost=password('在這里填入root密碼');


          3.開戶數(shù)據(jù)庫遠程訪問功能(下面是授予root用戶訪問所有數(shù)據(jù)庫和表的權(quán)限并且設(shè)置訪問密碼為root)
          grant all on *.* to root@'%' identified by 'root';




          posted @ 2012-02-21 17:12 Guides 閱讀(185) | 評論 (0)編輯 收藏


           1.  Spring3.0中的異常處理配置方法

           2. Spring3MVC 在JSP中使用@ModelAttribute

           3. [學習筆記]基于注解的spring3.0.x MVC學習筆記

           4. Spring3 MVC 深入研究
          posted @ 2012-02-02 16:51 Guides 閱讀(218) | 評論 (0)編輯 收藏

          使用apache comments Codec 這個jar


          代碼如下
              public static void main(String[] args) {        
                  String s 
          = "guides";        
                  System.out.println(DigestUtils.md5Hex(s.getBytes()));
              }



          posted @ 2012-01-05 15:04 Guides 閱讀(300) | 評論 (0)編輯 收藏

          從struts validator中提取出來的。這種東西寫起來麻煩,還是直接拷吧!

          \b(^['_A-Za-z0-9-]+(\.['_A-Za-z0-9-]+)*@([A-Za-z0-9-])+(\.[A-Za-z0-9-]+)*((\.[A-Za-z0-9]{2,})|(\.[A-Za-z0-9]{2,}\.[A-Za-z0-9]{2,}))$)\b


          posted @ 2011-12-31 17:52 Guides 閱讀(199) | 評論 (0)編輯 收藏

          配置的時候,犯了個很大的錯誤,疏忽了。

          自定義二級域名的需求
          http://guides.network.com 的請求轉(zhuǎn)至 http://www.network.com/guides 而且域名保持不變

          nginx配置代碼
          server {
                  server_name  *.network.com
          ;        
                  
                  if ( $http_host ~* 
          "^(.*?)\.network\.com$")
                  {
                      set $domain $
          1;              
                  }
                  
                  location / {            
                      proxy_pass   http://network
          ;
                      
                      if ($domain !~* ^www$)
                      {
                          rewrite ^/(.*)    /$domain/$
          1 break;
                      }                         
                      
                      proxy_set_header Host $host:
          80;
                      proxy_set_header X_Forwarded_For $remote_addr;
                      index  index.html index.htm;
                  }

          }

          當時用php測試,用get方式可以拿到值,用post就是拿不到值。最后發(fā)現(xiàn)把name="id"漏掉了.............................




          更新日志
          2011-12-31 17:48:14
          按照這個配置會出現(xiàn)一個問題,在oschina上問了下,不好解決。
          http://www.oschina.net/question/208700_35450
          posted @ 2011-12-22 17:01 Guides 閱讀(4740) | 評論 (2)編輯 收藏

          主站蜘蛛池模板: 绥芬河市| 阿拉善盟| 德江县| 郸城县| 福安市| 福建省| 静海县| 建宁县| 许昌县| 永昌县| 淮滨县| 托里县| 棋牌| 黄大仙区| 阿尔山市| 通化县| 东至县| 东辽县| 黄陵县| 三亚市| 新巴尔虎右旗| 华坪县| 鲜城| 汶上县| 巧家县| 桦川县| 贡山| 奉新县| 天峻县| 婺源县| 广汉市| 新闻| 宿松县| 靖西县| 孝义市| 鄂州市| 贺兰县| 出国| 共和县| 遵化市| 宣城市|