瀏覽模式: 普通 | 列表

[公告] 改版通知

由於我的筆記會用到大量引用指令有時偶爾出現程式碼

這個 F2blog 實在是越用越難用

因此本人決定換掉了

但是因為工作繁忙...鮮少有時間來轉換...

因此在此日之後本站不會再新增文章...(雖然電腦裡面積一堆了)

好了,就這樣了..

調整 Tomcat JVM 參數

Linux

catalina.sh
最前面加入

JAVA_OPTS=’-Xms512m -Xmx1024m’


-Xms:初始值
-Xmx:最大值
-Xmn:最小值

Windows
在catalina.bat最前面加入
set JAVA_OPTS=-Xms512m -Xmx1024m

重新註冊所有dll

此為出處 http://blog.blueshop.com.tw/joychen/archive/2008/01/25/54165.aspx

for %1 in (%windir%\system32\*.dll) do regsvr32.exe /s %1

沒想到cmd也支援 for 迴圈啊..

Grub 開機失敗解決


我本人習慣不切 /boot
但 Linux 有時安裝完畢後會一直停留在 grub 開機訊息
這時往往需要重新安裝一次 grub..
1. 用安裝光碟 linux rescue 修復模式
2. 掛載 kernel 並 chroot
# chroot /mnt/sysimage
3.重新執行安裝 grub 指令
# /sbin/grub-install /dev/hda

把 tomcat 管理畫面洗掉

於 ROOT/WEB-INF 底下之 web.xml

找到下面這段


CODE:

 
 <!-- JSPC servlet mappings start -->            
 
 <servlet>
                              <servlet-name>org.apache.jsp.index_jsp</servlet-name>
                              <servlet-class>org.apache.jsp.index_jsp</servlet-class>
 </servlet>
 
 <servlet-mapping>
                              <servlet-name>org.apache.jsp.index_jsp</servlet-name>
                              <url-pattern>/index.jsp</url-pattern>
 </servlet-mapping>
 
 <!-- JSPC servlet mappings end -->
 
 

取代成

CODE:

 
 <welcome-file-list>
              <welcome-file>index.jsp</welcome-file>
              <welcome-file>index.html</welcome-file>
      </welcome-file-list>
 
 


然後修改 ROOT/index.jsp 內容 隨你怎麼改愛怎麼改就都會生效了

RH 系列 Linux 自動 fsck

若有不正常關閉系統的情況常常需要待在主機前面按下 Y
找了找 Google 看到這個解法.
http://jeikul.sharera.com/blog/BlogTopic/326.htm

echo "AUTOFSCK_TIMEOUT=5" > /etc/sysconfig/autofsck
echo "AUTOFSCK_DEF_CHECK=yes" >> /etc/sysconfig/autofsck

應該是有效

FreeBSD Ldap Client 端設定

1. 安裝套件
必須裝 openldapclient, nss_ldap, pam_ldap 這三種套件

nss_ldap :
功能: 尋找到帳號資訊
設定檔: /usr/local/etc/nss_ldap.conf

備註:直接使用 ports 安裝 nss_ldap 即會自動安裝相對應的 openldap-client 版本
若是先安裝 openldap-client 再安裝 nss_ldap 的話
可能造成 openldap-client 與 nss_ldap 版本不符合而無法安裝 nss_ldap


pam_ldap:
功能: 讓系統辨識帳號
設定檔: /usr/local/etc/openldap/ldap.conf  

pam_mkhomedir
功能: 如名稱,非常方便的附屬套件,可自由選擇安裝與否

2.調整設定
設定套件以及變更設定值使用ldap認證

/etc/nsswitch.conf :
功能: 讓系統依照順序尋找
設定:
group_compat: ldap nis
passwd_compat: ldap nis

/usr/local/etc/openldap/ldap.conf
功能: pam_ldap 設定檔
設定:
host [serverIP]
base [dc=your,dc=dnname]
bind_policy soft
pam_filter objectclass=posixaccount
pam_login_attribute uid

/usr/local/etc/nss_ldap.conf
功能: nss_ldap 設定檔
設定:
直接ln -s 共用 ldap.conf 即可

/etc/passwd
功能: 密碼認證檔
設定:
vipw加入
+:*::::::::

/etc/group
功能: 群組檔
設定:
vi /etc/group
加入
+:*::

/etc/pam.d/sshd
功能: pam 模組中 sshd 設定
設定:

CODE:
 #
 # $FreeBSD: src/etc/pam.d/sshd,v 1.15 2003/04/30 21:57:54 markm Exp $
 #
 # PAM configuration for the "sshd" service
 #
 # auth
 
 auth required pam_nologin.so no_warn
 auth sufficient pam_opie.so no_warn no_fake_prompts
 auth requisite pam_opieaccess.so no_warn allow_local
 #auth sufficient pam_krb5.so no_warn try_first_pass
 #auth sufficient pam_ssh.so no_warn try_first_pass
 auth sufficient /usr/local/lib/pam_ldap.so no_warn try_first_pass
 auth required pam_unix.so no_warn try_first_pass
 
 
 # account
 
 #account required pam_krb5.so
 account required pam_login_access.so
 account required pam_unix.so
 
 # session
 
 session optional pam_ssh.so
 session required pam_permit.so
 session required /usr/local/lib/pam_mkhomedir.so
 # password #password sufficient pam_krb5.so no_warn try_first_pass password required pam_unix.so no_warn try_first_pass
 
 


重點在這一行
 
auth sufficient /usr/local/lib/pam_ldap.so no_warn try_first_pass

auth 中 pam_ldap 務必在 pam_unix 前載入

其他服務也比照設定.

3.驗證

ldapsearch -x

若有搜尋到資訊即ok.

開啟 SuSE 10.1 Xmanager 遠端登入

 vi /etc/opt/gnome/gdm/gdm.conf

此設定檔與大部分相同,以下為我更動過的選項

[security]
# If any distributions ship with this one off, they should be shot
# this is only local, so it's only for say kiosk use, when you
# want to minimize possibility of breakin
AllowRoot=true
# If you want to be paranoid, turn this one off
AllowRemoteRoot=true
# If true this will basically append -nolisten tcp to every X command line,
# a good default to have (why is this a "negative" setting? because if
# it is false, you could still not allow it by setting command line of
# any particular server).  It's probably better to ship with this on
# since most users will not need this and it's more of a security risk
# then anything else.
# Note: Anytime we find a -query or -indirect on the command line we do
# not add a "-nolisten tcp", as then the query just wouldn't work, so
# this setting only affects truly local sessions.
DisallowTCP=false
AllowShutdown=true
# Whether you need the root password to shut down from GDM and logout dialog.
SecureShutdown=true

[xdmcp]
# Distributions: Ship with this off.  It is never a safe thing to leave
# out on the net.  Setting up /etc/hosts.allow and /etc/hosts.deny to only
# allow local access is another alternative but not the safest.
# Firewalling port 177 is the safest if you wish to have xdmcp on.
# Read the manual for more notes on the security of XDMCP.
Enable=true
# The port.  177 is the standard port so better keep it that way
Port=177



設定完成後

/etc/init.d/xdm restart

即可連線.