The C programming language: "Creators admit Unix & C hoax
In an announcement that has stunned the computer industry, Ken Thompson, Dennis Ritchie and Brian Kernighan admitted that the Unix operating system and C programming language created by them is an elaborate April Fools prank kept alive for over 20 years. Speaking at the recent UnixWorld Software Development Forum, Thompson revealed the following:
'In 1969, AT&T had just terminated their work with the GE/Honeywell/AT&T Multics project. Brian and I had just started working with an early release of Pascal from Professor Nichlaus Wirth's ETH labs in Switzerland and we were impressed with its elegant simplicity and power. Dennis had just finished reading 'Bored of the Rings', a hilarious National Lampoon parody of the great Tolkien 'Lord of the Rings' trilogy. As a lark, we decided to do parodies of the Multics environment and Pascal. Dennis and I were responsible for the operating environment. We looked at Multics and designed the new system to be as complex and cryptic as possible to maximize casual users' frustration levels, calling it Unix as a parody of Multics, as well as other more risqu? allusions. Then Dennis and Brian worked on a truly warped version of Pascal, called 'A'. When we found others were actually trying to create real programs with A, we quickly added additional cryptic features and evolved into B, BCPL and finally C.
We stopped when we got a clean compile on the following syntax:
for(;P('\n'),R--;P('|'))for(e=C;e--;P('_' (*u /8)%2))P('|' (*u/4) %2);
To think that modern programmers would try to use a language that allowed such a statement was beyond our comprehension! We actually thought of selling this to the Soviets to set their computer science progress back 20 or more years. Imagine our surprise when AT&T and other US corporations actually began trying to use Unix and C! It has taken them 20 years to develop enough expertise to generate even marginally useful applications using this 1960's technological parody, but we are impressed with the tenacity (if not common sense) of the general Unix and C programmer. In any event, Brian, Dennis and I have been working exclusively in Pascal on the Apple Macintosh for the past few years and feel really guilty about the chaos, confusion and truly bad programming that have resulted from our silly prank so long ago."
Major Unix and C vendors and customers, including AT&T, Microsoft, Hewlett-Packard, GTE, NCR, and DEC have refused comment at this time. Borland International, a leading vendor of Pascal and C tools, including the popular Turbo Pascal, Turbo C and Turbo C++, stated they had suspected this for a number of years and would continue to enhance their Pascal products and halt further efforts to develop C. An IBM spokesman broke into uncontrolled laughter and had to postpone a hastily convened news conference concerning the fate of the RS-6000, merely stating 'VM will be available Real Soon Now'. In a cryptic statement, Professor Wirth of the ETH institute and father of the Pascal, Modula 2 and Oberon structured languages, merely stated that P. T. Barnum was correct.
In a related late-breaking story, usually reliable sources are stating that a similar confession may be forthcoming from William Gates concerning the MS-DOS and Windows operating environments. And IBM spokesmen have begun denying that the Virtual Machine (VM) product is an internal prank gone awry.
[COMPUTERWORLD 1 May]
[contributed by Bernard L. Hayes]
2004-12-20
2004-12-08
Linux FTP 的架設
鳥哥的Linux與ADSL的私房菜- 簡易 vsftpd 伺服器設定
(為了怕這個網頁將來不見,把部分文件拷貝如下)
以 Tarball 安裝
要以 Tarball 安裝,當然得先下載 Tarball 的檔案了!vsftpd 的官方網站下載點為:
ftp://vsftpd.beasts.org/users/cevans/
您可以自行找尋自己喜歡的版本來安裝。我這裡以 1.2.0 這一版來安裝 vsftpd 在我的 Mandrake 9.0 上面喔!(註:如果是 Red Hat 的系統,原本就有 vsftpd 了,所以使用 RPM 安裝比較好!至於其他沒有提供 vsftpd RPM 檔案的 distribution 就可以使用 Tarball 咯!)
安裝的過程真的是很簡單,不過, vsftpd.conf 這個檔案放置的地點在 RPM 與 Tarball 則可能有點不一樣,需要給他特別留意呢!例如 Red Hat 9 預設放置在 /etc/vsftpd/vsftpd.conf ,而 Tarball 則預設放置在 /etc/vsftpd.conf 裡面說!
-------------------------------------------------------------------
最簡單的 vsftpd.conf 設定
如果您很懶的去設定 vsftpd 的話,那麼可以使用很簡單的設定值來規劃您的 FTP 伺服器。底下就是 Red Hat 9 的預設 vsftpd 的設定值,您可以使用這樣的設定值來啟動您的 FTP 伺服器即可。這樣的設定值有幾個用處:
任何在 /etc/vsftpd.ftpusers 裡面的使用者帳號均無法使用 vsftpd 喔!
開放 anonymous 與 實體用戶 登入 vsftpd ;
實體用戶登入主機時,可以跳至任何具有登入權限的目錄當中(沒有 chroot );
使用 port 20 作為主動連線時的 ftp-data 傳送埠口;
利用 /etc/hosts.allow(deny) 來管理登入權限;
當 Client 上傳/下載檔案時,該資訊會記錄在 /var/log/vsftpd.log 裡面;
其他的設定均已預設值來規範(如被動式 port number 等等)。
[root@test root]# vi /etc/xinetd.d/vsftpd
service ftp
{
socket_type = stream
wait = no
user = root
server = /usr/local/sbin/vsftpd
server_args = /etc/vsftpd.conf
# 上面這個請依照您的主機環境來設定!尤其是 server_args 請設定您的
# vsftpd.conf 所在目錄的完整檔名(含目錄名稱)!
log_on_success += DURATION USERID
log_on_failure += USERID
nice = 10
disable = no
}
[root@test root]# vi /etc/vsftpd/vsftpd.conf # (或 /etc/vsftpd.conf)
# 關於主機與安全性的設定
use_localtime=YES
dirmessage_enable=YES
connect_from_port_20=YES
xferlog_enable=YES
xferlog_std_format=YES
pam_service_name=vsftpd
tcp_wrappers=YES
# 關於 anonymous 的設定
anonymous_enable=YES
# 關於 real user 的設定
local_enable=YES
write_enable=YES
local_umask=022
userlist_enable=YES
# 以上設定值的意義請往前翻到 vsftpd.conf 設定值的意義 章節去察看!
[root@test root]# /etc/rc.d/init.d/xinetd restart
這樣您的最簡易的 FTP 伺服器就已經設定完成了!簡單的很吧!而且還相當的安全呢!
-------------------------------------------------------------------
針對僅有開放實體用戶登入的設定
好了,這裡我們再使用其他的設定值來修正我們的 vsftpd.conf 這個設定檔。因為開放 anonymous 畢竟不太安全,所以我們將 anonymous 的登入權限關閉,並且僅讓 real user (實體用戶) 登入我們的 vsftpd 時,要如何設定呢?我的要求如下:
使用台灣本地的時間而不是 GMT 時間;
所有在 /etc/passwd 裡面出現的實體帳號均能登入 vsftpd 主機;
但是系統帳號 (如 root 等, UID 小於 500 的帳號)均不能使用 vsftpd ;
而且由於 badbird 與 nogoodbird 這兩個帳號使用者比較不乖,我要讓這兩個使用者被關在自己的家目錄當中(chroot);
並且限制資料的傳輸速度為 100 Kbytes/second;
當使用者進入 /home 這個目錄時,顯示:『一般使用者家目錄』的字樣在 Client 端的螢幕上;
使用者可以進行上傳、下載以及修改檔案等等動作。
上面的設定裡面有很多重複的地方,比方說 /etc/vsftpd.ftpusers 與 /etc/vsftpd.user_list 就是重複的設定了!不過,這樣是比較安全啦!因為 PAM 模組是外掛的程式,而另一個檔案則是 vsftpd 提供的功能!但是請特別留意,因為很多使用者可能會一不小心僅修改了其中一個檔案,另一個檔案則忘記修訂,會很麻煩喔! ^_^!至於也是重點之一的 /etc/vsftpd.chroot_list 就可以將使用者限制在他們自己的家目錄內了!設定上很容易吧!附帶說明,上面的檔名都與 vsftpd.conf 的設定有關!
看過了上面關於實體用戶的設定之後,咦!那麼如何讓 root 可以登入 vsftpd 主機呢?!呵呵!就是將 /etc/vsftpd.ftpusers 與 /etc/vsftpd.user_list 這兩個檔案裡面的 root 拿掉就可以啦!不過,本人可是不建議這麼搞的喔!
(為了怕這個網頁將來不見,把部分文件拷貝如下)
以 Tarball 安裝
要以 Tarball 安裝,當然得先下載 Tarball 的檔案了!vsftpd 的官方網站下載點為:
ftp://vsftpd.beasts.org/users/cevans/
您可以自行找尋自己喜歡的版本來安裝。我這裡以 1.2.0 這一版來安裝 vsftpd 在我的 Mandrake 9.0 上面喔!(註:如果是 Red Hat 的系統,原本就有 vsftpd 了,所以使用 RPM 安裝比較好!至於其他沒有提供 vsftpd RPM 檔案的 distribution 就可以使用 Tarball 咯!)
- 下載與解壓縮:
[root@test root]# wget > ftp://vsftpd.beasts.org/users/cevans/vsftpd-1.2.0.tar.gz
[root@test root]# cd /usr/local/src
[root@test root]# tar -zxvf /root/vsftpd-1.2.0.tar.gz
[root@test root]# cd vsftpd-1.2.0/
# 在這個目錄下有個 INSTALL 與 README 請務必察看喔! - 開始編譯與安裝
# vsftpd 預設安裝的路徑為:
# 所有可執行檔放置在 /usr/local/sbin 裡面;
# man page 放置在 /usr/local/man/man5 與 /usr/local/man/man8
# 若 super daemon 為 xinetd 時,會複製一份啟動檔案到 /etc/xinetd.d 去!
[root@test vsftpd-1.2.0]# make
# 編譯的過程可能有 warning 的訊息,只要不是 Error 就可以不理他!
[root@test vsftpd-1.2.0]# make install
[root@test vsftpd-1.2.0]# cp vsftpd.conf /etc
# 將 PAM 身份認證模組給他放進去系統裡面!
[root@test vsftpd-1.2.0]# cp RedHat/vsftpd.pam /etc/pam.d/vsftpd
# 建立 ftp 這個使用者以及他的家目錄:
# 若本來就存在 ftp 這個使用者,那就不需要進行新增!
[root@test vsftpd-1.2.0]# useradd -M ftp -d /var/ftp
[root@test vsftpd-1.2.0]# mkdir -p /var/ftp
[root@test vsftpd-1.2.0]# chown root:root /var/ftp
[root@test vsftpd-1.2.0]# chown 755 /var/ftp
# 建立 vsftpd 需要的特殊目錄
[root@test vsftpd-1.2.0]# mkdir -p /usr/share/empty - 如果需要移除時:
# 如果想要移除 vsftp 時,可以這樣做
[root@test vsftpd-1.2.0]# rm /usr/local/sbin/vsftpd
[root@test vsftpd-1.2.0]# rm /usr/local/man/man5/vsftpd.conf.5
[root@test vsftpd-1.2.0]# rm /usr/local/man/man8/vsftpd.8
[root@test vsftpd-1.2.0]# rm /etc/xinetd.d/vsftpd
[root@test vsftpd-1.2.0]# rm /etc/vsftpd.conf
# 因為剛剛安裝只有安裝這幾個檔案而已說!所以啦, vsftpd 真的是挺安全的說! - 測試:
# 先確認一下 xinetd.d 有沒有問題再說:
[root@test root]# vi /etc/xinetd.d/vsftpd
service ftp
{
socket_type = stream
wait = no
user = root
server = /usr/local/sbin/vsftpd
log_on_success += DURATION USERID
log_on_failure += USERID
nice = 10
disable = no
}
[root@test root]# /etc/rc.d/init.d/xinetd restart
[root@test root]# ftp localhost
ftp localhost
Connected to localhost.
220 (vsFTPd 1.2.0)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): anonymous
# 這樣就表示 vsftpd 已經可以正確的啟動了,不過因為我們還沒有設定好
# /etc/vsftpd.conf ,所以會有無法登入的問題!沒關係,
# 等一下設定好就 OK 了!
安裝的過程真的是很簡單,不過, vsftpd.conf 這個檔案放置的地點在 RPM 與 Tarball 則可能有點不一樣,需要給他特別留意呢!例如 Red Hat 9 預設放置在 /etc/vsftpd/vsftpd.conf ,而 Tarball 則預設放置在 /etc/vsftpd.conf 裡面說!
-------------------------------------------------------------------
最簡單的 vsftpd.conf 設定
如果您很懶的去設定 vsftpd 的話,那麼可以使用很簡單的設定值來規劃您的 FTP 伺服器。底下就是 Red Hat 9 的預設 vsftpd 的設定值,您可以使用這樣的設定值來啟動您的 FTP 伺服器即可。這樣的設定值有幾個用處:
任何在 /etc/vsftpd.ftpusers 裡面的使用者帳號均無法使用 vsftpd 喔!
開放 anonymous 與 實體用戶 登入 vsftpd ;
實體用戶登入主機時,可以跳至任何具有登入權限的目錄當中(沒有 chroot );
使用 port 20 作為主動連線時的 ftp-data 傳送埠口;
利用 /etc/hosts.allow(deny) 來管理登入權限;
當 Client 上傳/下載檔案時,該資訊會記錄在 /var/log/vsftpd.log 裡面;
其他的設定均已預設值來規範(如被動式 port number 等等)。
[root@test root]# vi /etc/xinetd.d/vsftpd
service ftp
{
socket_type = stream
wait = no
user = root
server = /usr/local/sbin/vsftpd
server_args = /etc/vsftpd.conf
# 上面這個請依照您的主機環境來設定!尤其是 server_args 請設定您的
# vsftpd.conf 所在目錄的完整檔名(含目錄名稱)!
log_on_success += DURATION USERID
log_on_failure += USERID
nice = 10
disable = no
}
[root@test root]# vi /etc/vsftpd/vsftpd.conf # (或 /etc/vsftpd.conf)
# 關於主機與安全性的設定
use_localtime=YES
dirmessage_enable=YES
connect_from_port_20=YES
xferlog_enable=YES
xferlog_std_format=YES
pam_service_name=vsftpd
tcp_wrappers=YES
# 關於 anonymous 的設定
anonymous_enable=YES
# 關於 real user 的設定
local_enable=YES
write_enable=YES
local_umask=022
userlist_enable=YES
# 以上設定值的意義請往前翻到 vsftpd.conf 設定值的意義 章節去察看!
[root@test root]# /etc/rc.d/init.d/xinetd restart
這樣您的最簡易的 FTP 伺服器就已經設定完成了!簡單的很吧!而且還相當的安全呢!
-------------------------------------------------------------------
針對僅有開放實體用戶登入的設定
好了,這裡我們再使用其他的設定值來修正我們的 vsftpd.conf 這個設定檔。因為開放 anonymous 畢竟不太安全,所以我們將 anonymous 的登入權限關閉,並且僅讓 real user (實體用戶) 登入我們的 vsftpd 時,要如何設定呢?我的要求如下:
使用台灣本地的時間而不是 GMT 時間;
所有在 /etc/passwd 裡面出現的實體帳號均能登入 vsftpd 主機;
但是系統帳號 (如 root 等, UID 小於 500 的帳號)均不能使用 vsftpd ;
而且由於 badbird 與 nogoodbird 這兩個帳號使用者比較不乖,我要讓這兩個使用者被關在自己的家目錄當中(chroot);
並且限制資料的傳輸速度為 100 Kbytes/second;
當使用者進入 /home 這個目錄時,顯示:『一般使用者家目錄』的字樣在 Client 端的螢幕上;
使用者可以進行上傳、下載以及修改檔案等等動作。
- 基礎設定檔
[root@test root]# vi /etc/vsftpd/vsftpd.conf (或 /etc/vsftpd.conf)
# 關於主機與安全性的設定
use_localtime=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
pam_service_name=vsftpd
tcp_wrappers=YES
# 關於 anonymous 的設定
anonymous_enable=NO
# 關於 Real User 的設定
local_enable=YES
write_enable=YES
local_umask=022
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
userlist_deny=YES
userlist_file=/etc/vsftpd.user_list
local_max_rate=100000
# 以上設定值的意義請往前翻到 vsftpd.conf 設定值的意義 章節去察看! - 限制實體用戶在自己的家目錄內 (chroot) 的設定檔
[root@test root]# vi /etc/vsftpd.chroot_list
badbird
nogoodbird
# 沒有寫到這個檔案內的其他用戶,就可以離開自己的家目錄,
# 而到其他目錄裡面去瀏覽了! - 以 PAM 模組限制某些帳號無法登入主機的設定:
[root@test root]# vi /etc/pam.d/vsftpd
# 會發現這樣的字句:
auth ..... file=/etc/vsftpd.ftpusers ....
# 那個 file=.. 後面接的檔名就是以 PAM 模組抵擋的帳號內容了!
[root@test root]# vi /etc/vsftpd.ftpusers
# 底下列出的帳號將無法使用 vsftpd 喔!與 wu ftp 的 /etc/ftpusers 相同功能
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody - 以 userlist_file 抵擋某些帳號的登入:
# 事實上,這個功能與上面的 PAM 功能相似啦!只是 PAM 是外掛的,而
# 這個設定是 vsftpd 預設提供的就是了!
[root@test root]# vi /etc/vsftpd.user_list
# 這個檔案的設定與上面 /etc/vsftpd.ftpusers 相同即可!
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody - 設定進入目錄時,顯示的訊息:
[root@test root]# vi /home/.message
一般使用者家目錄 - 重新啟動 xinetd 囉!
[root@test root]# /etc/rc.d/init.d/xinetd restart
上面的設定裡面有很多重複的地方,比方說 /etc/vsftpd.ftpusers 與 /etc/vsftpd.user_list 就是重複的設定了!不過,這樣是比較安全啦!因為 PAM 模組是外掛的程式,而另一個檔案則是 vsftpd 提供的功能!但是請特別留意,因為很多使用者可能會一不小心僅修改了其中一個檔案,另一個檔案則忘記修訂,會很麻煩喔! ^_^!至於也是重點之一的 /etc/vsftpd.chroot_list 就可以將使用者限制在他們自己的家目錄內了!設定上很容易吧!附帶說明,上面的檔名都與 vsftpd.conf 的設定有關!
看過了上面關於實體用戶的設定之後,咦!那麼如何讓 root 可以登入 vsftpd 主機呢?!呵呵!就是將 /etc/vsftpd.ftpusers 與 /etc/vsftpd.user_list 這兩個檔案裡面的 root 拿掉就可以啦!不過,本人可是不建議這麼搞的喔!
DSP Lab 架站記錄 20041208
前兩天在全新的 server 上,裝上 Fedoro core 2(暴力的把所有套件都裝進去),之後啟動了 Apache 和 Mysql。下載安裝了 PhpMyAdmin,測試 PHP 運作正常後,就把 Xoops2 架上去了。安裝過程裡 浪遊者之愛玩電腦 提供了不少幫助,不過,比起其他自由軟體的台灣官方網站,這個站似乎少了些安裝教學文件,不知道是不是因為站長出書的關係,這些撇步都放到書裡去賣了(開放軟體免費歸免費,知識還是要錢的啊)。不過好在還有 google 和許多前輩分享的經驗,還是暴力的把這個站架起來了。
以下是一些碰到問題的 solution:
以下是一些碰到問題的 solution:
- Xoops Mail 的設定:
進入→ 系統管理員選單 → 系統管理 → 系統設定 → 郵件設定
或是
PHP 寄信:修改 php.ini 檔,SMTP = 我的ISP的SMTP 跟
sendmail_from = 我的mail
- Xoops 轉頁會出現亂碼的問題
在 /etc/httpd/conf/httpd.conf 裡
加一句 AddDefaultCharset Off
訂閱:
文章 (Atom)