1. 程式人生 > >Linux指令碼程式包及安裝

Linux指令碼程式包及安裝

指令碼程式並不多見,所以在軟體包分類中並沒有把它列為一類。它更加類似於 Windows 下的程式安裝,有一個可執行的安裝程式,只要執行安裝程式,然後進行簡單的功能定製選擇(比如指定安裝目錄等),就可以安裝成功,只不過是在字元介面完成的。

目前常見的指令碼程式以各類硬體的驅動居多,我們需要學習一下這類軟體的安裝方式,以備將來不時之需。

我們來看看指令碼程式如何安裝和使用。安裝一個叫作 Webmin 的工具軟體,Webmin 是一個基於 Web 的系統管理介面,藉助任何支援表格和表單的瀏覽器(和 File Manager 模組所需要的Java),你就可以設定使用者賬號、apache、DNS、檔案共享等。

Webmin 包括一個簡單的 Web 伺服器和許多 CGI 程式,這些程式可以直接修改系統檔案,比如 /etc/inetd.conf 和 /etc/passwd。Web 伺服器和所有的 CGI 程式都是用 Perl 5 編寫的,沒有使用任何非標準 Perl 模組。也就是說,Webmin 是一個用 Perl 語言寫的、可以通過瀏覽器管理 

Linux 的軟體。

webmin安裝步驟

首先下載 Webmin 軟體,這裡下載的是 webmin-1.610.tar.gz。

接下來解壓縮軟體,命令如下:

[[email protected] ~]# tar -zxvf webmin-1.610.tar.gz

進入解壓目錄,命令如下:

[[email protected] ~]# cd webmin-1.610

執行安裝程式 setup.sh,並指定功能選項,命令如下:

[[email protected] webmin-1.610]# ./setup.sh
**************************
* Welcome to the Webmin setup script,version 1.610 *
**************************
Webmin is a web-based interface that allows Unix-like operating
systems and common Unix ser

vices to be easily administered.
Installing Webmin in /root/webmin-1.610...
**************************
Webmin uses separate directories for configuration files and log files.
Unless you want to run multiple versions of Webmin at the same time
you can just accept the defaults.
Config file directory [/etc/webmin]:
#選擇安裝位置,預設安裝在/etc/webmin目錄下。
如果安裝到預設位置,則直接回車
Log file directory [/var/webmin]:
#日誌檔案儲存位置,直接回車,選擇預設位置
**************************
Webmin is written entirely in Perl.Please enter the full path to the
Perl 5 interpreter on your system.
Full path to peri (default /usr/bin/perl):
#指定Perl語言的安裝位置,直接回車,選擇預設位置,Perl預設就安裝這裡
Testing Perl...
Perl seems to be installed ok
**************************
Operating system name: CentOS Linux Operating system version: 6.3
**************************
Webmin uses its own password protected web server to provide access to the administration programs.
The setup script needs to know:
-What port to run the web server on.There must not be another web server already u
sin
g this port.
-The login name required to access the web server.
-The password required to access the web server.
-If the Webserver should use SSL (if your system supports it).
-Whether to start webmin at boot time.
Web server port (default 10000):
#指定Webmin監聽的埠,直接回車,預設選定 10000
Login name (default admin):admin #輸入登入Webmin的使用者名稱
Login password:
Password again:
#輸入登陸密碼
The Perl SSLeay library is not installed.SSL not available.
#apache預設沒有啟動SSl功能,所以SSl沒有被啟用
Start Webmin at boot time (y/n):y
#是否在開機的同時啟動Webmin
…安裝過程省略…
Webmin has been installed and started successfully.Use your web browser to go to
http://localhost:10000/
and login with the name and password you entered previously.
#安裝完成

在瀏覽器位址列中輸入"http://192.168.2.199:10000/ ",然後輸入使用者名稱和密碼,就可以登入到 Webmin 介面,如圖 1 所示。



圖 1 Webmin登入介面


當然,我們並不是要講解 Webmin 管理介面如何使用,而是要講解指令碼程如何安裝,所以工作已經完成。這種指令碼安裝簡單快速,不過需要軟體開商釋出安裝指令碼。但是 Linux 中的絕大多數軟體是沒有這種指令碼的。