Guides

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

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

          2011年12月20日 #


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

          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


          三步配置下來,內網和外網ping 成功!

           《靜態路由詳細介紹》
            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.查看當前系統中的用戶
          select user,host,password from mysql.user

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


          3.開戶數據庫遠程訪問功能(下面是授予root用戶訪問所有數據庫和表的權限并且設置訪問密碼為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 的請求轉至 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就是拿不到值。最后發現把name="id"漏掉了.............................




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


          支付寶接口(java版)里摘下來的。

          String subject = new String(request.getParameter("subject").getBytes("ISO-8859-1"),"utf-8");
          posted @ 2011-12-20 16:23 Guides 閱讀(212) | 評論 (0)編輯 收藏

          主站蜘蛛池模板: 邹城市| 大港区| 定州市| 会理县| 防城港市| 高淳县| 察雅县| 依安县| 孟津县| 乌鲁木齐市| 陕西省| 炉霍县| 新营市| 化德县| 厦门市| 黑龙江省| 金寨县| 辽阳市| 东丽区| 巫溪县| 聊城市| 兴城市| 建宁县| 哈密市| 察雅县| 丽水市| 周至县| 昆山市| 麻江县| 邯郸县| 乃东县| 介休市| 灵宝市| 鹤庆县| 普洱| 天镇县| 五大连池市| 怀化市| 合水县| 且末县| 喀喇沁旗|