有同樣問題的朋友,我的情況是,在升級到 Debian GNU/Linux r4.0 後,Apache2 預設不會載入 userdir 的 module ,所以使用者就沒有辨法擁有個人網頁了。
我的情況:
當我執行 http://123.45.67.89/~061/打我啊,笨蛋.htm 時,會在 /var/log/apache2/error.log 裏看到 File does not exist: /var/www/~061 而不是 File does not exist: /home/061/public_html/打我啊,笨蛋.htm 。
要確定載入了哪些 modules ,執行 apache2ctl -M 。
在 Debian GNU/Linux r4.0 底下,要讓 Apache2 載入 userdir modules 的做法是,執行:
# cd /etc/apache2/mods-enabled
# ln -s ../mods-available/userdir.load .
# ln -s ../mods-available/userdir.conf .
# apache2ctl -k restart (重新啟動 apache2)
再執行一次 apache2ctl -M ,看看有沒有 userdir ? 就知道有沒有成功了!!
音樂分享 - 「君がいるから」by 江口一聲
2007年7月27日 星期五
apache2 底下的 public_html 路徑老是對映到 /var/www 的錯誤原因
2007年5月3日 星期四
Linux Kernel panic: VFS 開機失敗
VFS : Cannot open root device "802" or unknown-block(8,2)
Please append a corect "root=" boot option
Kernel panic: VFS: Unable to mount root fs on unknown-block(8,2)
我在 IBM Netfinity 3500 與 HP DL370 升級 Linux Kernel 都遇過此問題,也一直不解為何會如此,早知道有解就該多找找 Google ... 冏rz
以下是找到的解法...
這一篇是說明問題,問題在於 升級後的 kernel 的 initrd.img 沒有內含 ext3 的 module (ext3.ko) ,所以開機時就無法讀入 ext3 的分割區,開機當然就失敗啦~
Linux Kernel panic VFS Unable to mount root fs and solution | Frequently Asked Questions
Q. I am using Linux on HP server and I am getting error that read root file system , Linux Kernel panic: VFS: Unable to mount root fs on unknown-block(8,2) . How do I solve this problem?
A. Most modern distributions including Debian uses loadable kernel module for ext3 file system. So to read ext3/ext2 file system kernel must load ext3 kernel module (ext3.ko).
This module is included in an initrd image. If an initrd image is missing or that image does not include suitable kernel modules to access the ext3 filesystem on the partition, an error message (Linux Kernel panic: VFS: Unable to mount root fs on unknown-block(8,2) will be displayed to you.
To solve this problem you need to use mkinitrd script that constructs a directory structure that can serve as an initrd root file system.
解決方法就是,自已再做一個 initrd.img 並把 ext3 的 module 包進入,以下是做法:
Source: Rebuild the initial ramdisk image | Frequently Asked Questions
Q: I think I am missing some driver or my initial ramdisk is corrupted for running kernel how do I Rebuild the initial ramdisk image under Linux?
A: You need ramdisk if you have added new hardware devices such as SCSI or FibreChannel controller to your server as the ramdisk contains the necessary modules (i.e. drivers) to initialize hardware driver. If you modified the /etc/modprob.conf (or modules.conf) file then you need to execute special script called mkinitrd.
The mkinitrd script constructs a directory structure that can serve as an initrd root file system. It then generates an image containing that directory structure using mkcramfs, which can be loaded using the initrd mechanism. The kernel modules for the specified kernel version will be placed in the directory structure. If version is omitted(省略), it defaults to the version of the kernel that is currently running.
Find out your kernel version:
# uname -r 先確認 kernel 版本
2.6.15.4
Make backup of existing ram disk: 做個備份
# cp /boot/initrd.$(uname -r).img /root
To create initial ramdisk image type following command as the root user:
# mkinitrd -o /boot/initrd.$(uname -r).img $(uname -r) 製作 initrd.img
# ls -l /boot/initrd.$(uname -r).img
You may need to modify grub.conf to point out to correct ramdisk image, make sure following line existing in grub.conf file:
initrd /boot/initrd.img-2.6.15.4.img 在 grub.conf 裏指定正確的 initrd.img
When the system boots using an initrd image created by mkinitrd command, the
linuxrc will wait for an amount of time which is configured through mkinitrd.conf, during which it may be interrupted by pressing ENTER. After that, the modules specified in will be loaded.
講了很多 initrd.img ,現在來解釋一下 什麼是 initrd... 簡單說就是 Initial Ramdisk 的縮寫,為了解決開機時有關雞生蛋或蛋生雞的問題… 說明:root file system 是 ext3 ,但是 ext3 並未包含在 kernel 裏,而是做成 loadable module ,這樣開機時 kernel 就讀不到 root file system 了… 即使是 kernel 想載入 ext3 module,可是對這 module 在 ext3 的 file system 裏啊~ 哈 真是有趣,果然是雞跟蛋的問題… 這個initrd 會產生一個 image 檔,裏面會有一個 filesystem ,並也建構了 modules 的目錄與放進了 module,這樣 kernel 就能載入這些 module了,然後就能把 root filesystem 掛載起來,繼續完開機的動作。
Source: Digital Hermit - Kernel-Build-HOWTO
Create Initial RAMDisk
If you have built your main boot drivers as modules (e.g., SCSI host adapter, filesystem, RAID drivers) then you will need to create an initial RAMdisk image. The initrd is a way of sidestepping the chicken and egg problem of booting -- drivers are needed to load the root filesystem but the filesystem cannot be loaded because the drivers are on the filesystem. As the manpage for mkinitrd states:
mkinitrd creates filesystem images which are suitable for use as Linux initial
ramdisk(initrd) images. Such images are often used for preloading the
block device modules (such as IDE, SCSI or RAID) which are needed to access the
root filesystem. mkinitrd automatically loads filesystem modules (such as
ext3 and jbd), IDE modules,all scsi_hostadapter entries in /etc/modules.conf,
and raid modules if the systems root partition is on raid, which makes it
simple to build and use kernels using modular device drivers.
--MKINITRD(8)
To create the initrd, do the following:
$ mkinitrd /boot/initrd-2.6.0.img 2.6.0
Some versions of mkinitrd may require other options to specify the location of the new kernel. On SuSe 9.0, for example, the following syntax is required:
$ mkinitrd -k vmlinux-VERSION -i initrd-VERSION
2007年5月2日 星期三
PHP5 ... register_globals Off 之前的程式都不能用了
php4.1.2 起,更改 register_globals off (php.ini)
register_globals boolean
Whether or not to register the EGPCS (Environment, GET, POST, Cookie, Server) variables
as global variables.
As of PHP 4.2.0, this directive defaults to off.
Please read the security chapter on Using register_globals for related information.
Please note that register_globals cannot be set at runtime (ini_set()). Although, you
can use .htaccess if your host allows it as described above. An example .htaccess entry:
php_flag register_globals off.
注: register_globals is affected by the variables_order directive.
This directive was removed in PHP 6.0.0.
關於使用 register_globals On 的風險,請參考
PHP: Using Register Globals - Manual
Address : <http://tw.php.net/manual/tw/security.globals.php>
取得變數可改用以下方式宣告。
建議只用 POST ,以免有 sql injecktion 的風險。
while(list($key, $value) = each($_GET))
{
${$key} = $value;
}
while(list($key, $value) = each($_POST))
{
${$key} = $value;
}
2007年3月25日 星期日
更換 計數器
更換成 Site Meter ,也是免費的,而且多了一個 Page Ranking 的功能,可以看看哪些頁面被觀看最多次。 讚!! 我需要這個功能。
What is Site Meter ?
Site Meter is a free, fast, and easy way to add a web counter to your web page. Not only does it display the number of visitors to your web site, it also keeps statistics on the number of visits each hour and each day. See an example of the free real-time web traffic reporting you can have for your site.
Site Meter
Source: Site Meter - Counter and Statistics Tracker
免費網路傳檔空間 - MediaFire
Source: Free File Hosting Made Simple - MediaFire
Address : <http://www.mediafire.com/>
以下是官網說明:(真是優點多多,大家自取善用吧~)
MediaFire is the simplest way to host files and share them with others
- Share files with all of your friends and upload them only once (傳檔給朋友)
- Link to files from your MySpace page, your blog, or forums (在別的網頁放檔案的鏈結,以供下載)
- Keep frequently used documents online for easy access from any computer
- 100% Free
- Unlimited Disk Space (不限空間大小)
- Upload an Unlimited Number of Files (不限檔案數量)
- Serve Unlimited Downloads (不限下載次數)
- No Waits, Lines, or Queues (不需等待 ) (Lines?)
- Easily Email Files After Uploading (上傳後即顯示檔案鏈結,方便Email)
- No Sign Up Required (不需註冊帳號即可使用)
2007年3月14日 星期三
免費線上播放自己的影片 (Stream)
http://www.camstreams.com/
提供免費的大頻寬做為中繼,讓朋友連到該公司的網站觀看您上傳的即時串流 (real time stream),讓一般使用者不必擁有 Stream Server 與大頻寬,就能擁有類似架站的功能,其限制為…只供公開播放,不能設限制,所以每個人能在網路上看到其他人分享的影片。
網友分享的線上串流(影片): http://www.camstreams.com/streamingwebcams.asp
安裝說明: Setup Instructions
有簡單版跟進階版(可調bitrate),還是要裝 .NET FRamework. :-(
超強的WebCAM軟體 AbelCam
AbelCam
WebCam Server for Windows- Use any capture device or TV tuner to stream video right from your Windows system.
- motion detection / email on motion detection
- Windows Media broadcast
- Support for Tilt/Pan devices
- Video Recording
- Use up to 10 Video Devices simultaneously
- FTP Upload
- Web Server to serve HTML pages and multimedia content
- Control your Webcams from any location through the Web Admin Interface
有個缺點… 要裝 .NET Framework 才行~
Source: AbelCam: WebCam Server for Windows
免費的 CCD 抓圖程式 Dorgem
Dorgem
Official site: http://dorgem.sourceforge.net/Dorgem is a webcam capture application for Windows 9x and up. Any Video for Windows compatible webcam (or other digital camera) is supported.
It has unlimited storage events that can put the captured image on an FTP site as well as a local disk, all with their own time interval. It can put a unlimited texts and bitmaps on the captured image before the image is stored.
Dorgem supports an unlimited number of simultaneous cameras. It has a built-in webserver for still images and can be used as security camera because of its motion detection.
支援自動抓圖,還能個動上傳到 ftp ,還內建 WebServer ,可以顯示抓下的圖,且支援動態偵測,所以可以當保全監視錄影機。 重點是… 免費的!! 謝謝了 Frank Fesevur.
Frank 的WebCam http://www.fesevur.com/webcam.php
