104的小美工作家-找工作也可以試試喔!

2010年7月5日 星期一

Apache Mod_rewrite 開啟方式

<body ONDRAGSTART="window.event.returnValue=false" onSelectStart="event.returnValue=false" ONCONTEXTMENU="window.event.returnValue=false" >

修改Apache 設定檔

將底下模組的#拿掉
LoadModule rewrite_module modules/mod_rewrite.so
AddModule mod_rewrite.c

修改.htaccess 設定值,將其設定為 All
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All

2009年6月2日 星期二

PHP 表單文字(textarea)內容斷行

使用 nl2br() 函式

參考手冊

2009年4月23日 星期四

網頁重新整理語法

a href="javascript:window.location.reload()"

2009年4月13日 星期一

CentOS 第三方套件庫 - RPMforge

*參考說明

1. CentOS 5

You should make sure that you have Priorities installed.

1.1. Priorities

yum-priorities is available in the CentOS 5 repositories:

yum install yum-priorities

Plugins are enabled in CentOS 5 by default.

Make sure that yum-priorities is enabled by editing the /etc/yum/pluginconf.d/priorities.conf file, and ensuring that it contains the following lines:

[main]
enabled=1

Edit the .repo files in /etc/yum.repos.d/ and set up priorities by adding the line:

priority=N

to a repository entry, where N is an integer number from 1 to 99.

The recommended settings are:

[base], [addons], [updates], [extras] ... priority=1 
[centosplus],[contrib] ... priority=2
Third Party Repos such as rpmforge ... priority=N (where N is > 10 and based on your preference)

1.2. RPMforge

Download the rpmforge-release package. Choose one of the two links below, depending on your architecture. If you are unsure of which one to use you can check your architecture with the command uname -i

(You can find a complete list of rpmforge-release package packages at http://dag.wieers.com/packages/rpmforge-release/ but it is recommended that you use one of the two listed above).

Install DAG's GPG key

rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

Verify the package you have downloaded

rpm -K rpmforge-release-0.3.6-1.el5.rf.*.rpm

Security warning: The rpmforge-release package imports GPG keys into your RPM database. As long as you have verified the package and trust Dag then it should be safe.

Install the package

rpm -i rpmforge-release-0.3.6-1.el5.rf.*.rpm

This will add a yum repository config file and import the appropriate GPG keys. At this point, you can set the priority of the RPMForge repository, and also of the CentOS repositories if you have not done so yet.

Test with this command:

yum check-update

It should output these two lines:

Loading "priorities" plugin
...
76 packages excluded due to repository priority protections

The number above may differ, but there should be several packages shown as being excluded.

If so then it looks like things are working so try installing something like this

yum install mplayer

2009年4月11日 星期六

2009年4月6日 星期一

CentOS5 中VNC Server 設定

1. 所需套件:
# yum -y install vnc vnc-server

2. VNC Server 設定
修改VNCSERVERS="1:myusername" VNCSERVERARGS 的設定
(1表示port為5901,2表示port為5902......; myusername 為登入者帳號)

# vi /etc/sysconfig/vncservers
VNCSERVERS="2:root"
VNCSERVERARGS[2]="-geometry 1024x768 -depth 24"

3. 設定VNC 使用者密碼
# vncpasswd

4. 修改 X桌面設定值,將xstartup中底下的兩行註解拿掉
#service vncserver start (先啟動一次VNC Server)
# vi ~/.vnc/xstartup

unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

5. 設定防火牆,讓VNC Server 可以從外部網路連入
#vi /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5902 -j ACCEPT

6.從新啟動iptables
#service iptables restart

7. 啟動VNC Server 檢查port 有否開啟
# /etc/rc.d/init.d/vncserver start
#netstat -tlnp
tcp 0 0 *:5902

8. 利用VNC Viewer 連入

2009年4月5日 星期日

How to install ZIPARCHIVE for PHP in CentOS5

如何在CentOS 5 中安裝PHP用的 ZIP 擴充套件:

Step 0: Set up the yum-priorities plugin: http://wiki.centos.org/PackageManagement/Yum/Priorities
Step 1: Enable the EPEL repository: http://wiki.centos.org/AdditionalResources/Repositories
Step 2: Install the php-pecl-zip extension package:

依造上面的步驟說明分別是:
1. #yum install yum-priorities

2. #wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
#rmp -ivh epel-release-5-3.noarch.rpm

3. #yum install php-pecl-zip
過程中會驗證GPG key 選擇 y