天天看點

centos5.4下Webmin管理系列(一):webmin的安裝

一、确定CentOS已經安裝,并且所需服務也已成功裝好

    我在192.168.1.250的一台伺服器上安裝了CentOS5.4版本,安裝了Apache+MySQL+Samba+FTP+DNS+DHCP+SQUID等。從inittab中修改啟動級别為3。重新開機後離開機房,使用辦公室裡192.168.1.188的電腦遠端SSH到伺服器。

二、下載下傳WebMin的最新版本,并安裝

    進入www.webmin.com,點選左側download區域中的RPM,複制連結的下載下傳位址,回到pietty終端中:

[lk@hd ~]$ --2010-08-24 15:30:03--  http://downloads.sourceforge.net/project/webadmin/webmin/1.510/webmin-1.510-1.noarch.rpm?r=http%3A%2F%2Fwww.webmin.com%2F

正在解析主機 downloads.sourceforge.net... 216.34.181.59

Connecting to downloads.sourceforge.net|216.34.181.59|:80... 已連接配接。

已發出 HTTP 請求,正在等待回應... 302 Found

位置:http://cdnetworks-kr-2.dl.sourceforge.net/project/webadmin/webmin/1.510/webmin-1.510-1.noarch.rpm [跟随至新的 URL]

--2010-08-24 15:30:05--  http://cdnetworks-kr-2.dl.sourceforge.net/project/webadmin/webmin/1.510/webmin-1.510-1.noarch.rpm

正在解析主機 cdnetworks-kr-2.dl.sourceforge.net... 211.39.135.163

Connecting to cdnetworks-kr-2.dl.sourceforge.net|211.39.135.163|:80... 已連接配接。

已發出 HTTP 請求,正在等待回應... 200 OK

長度:15995394 (15M) [application/x-rpm]

Saving to: `webmin-1.510-1.noarch.rpm'

100%[======================================>] 15,995,394  58.6K/s   in 6m 29s

2010-08-24 15:36:37 (40.2 KB/s) - `webmin-1.510-1.noarch.rpm' saved [15995394/15995394]

[1]-  Done                    wget http://downloads.sourceforge.net/project/webadmin/webmin/1.510/webmin-1.510-1.noarch.rpm?r=http%3A%2F%2Fwww.webmin.com%2F

[2]+  Done                    ts=1282634860

[lk@hd ~]$ ls

webmin-1.510-1.noarch.rpm

[lk@hd ~]$ rpm -ivh webmin-1.510-1.noarch.rpm

warning: webmin-1.510-1.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 11f63c51

error: can't create transaction lock on /var/lib/rpm/__db.000

出現錯誤,換用tar.gz包,再做一次:

[lk@hd ~]$ wget http://downloads.sourceforge.net/project/webadmin/webmin/1.510/webmin-1.510.tar.gz?r=http%3A%2F%2Fwww.webmin.com%2F&ts=1282635512&mirror=cdnetworks-kr-1

[1] 18084

[2] 18085

[lk@hd ~]$ --2010-08-24 15:40:35--  http://downloads.sourceforge.net/project/webadmin/webmin/1.510/webmin-1.510.tar.gz?r=http%3A%2F%2Fwww.webmin.com%2F

位置:http://cdnetworks-kr-2.dl.sourceforge.net/project/webadmin/webmin/1.510/webmin-1.510.tar.gz [跟随至新的 URL]

--2010-08-24 15:40:37--  http://cdnetworks-kr-2.dl.sourceforge.net/project/webadmin/webmin/1.510/webmin-1.510.tar.gz

長度:14841163 (14M) [application/x-gzip]

Saving to: `webmin-1.510.tar.gz'

100%[======================================>] 14,841,163  45.6K/s   in 6m 49s

2010-08-24 15:47:26 (35.4 KB/s) - `webmin-1.510.tar.gz' saved [14841163/14841163]

[1]-  Done                    wget http://downloads.sourceforge.net/project/webadmin/webmin/1.510/webmin-1.510.tar.gz?r=http%3A%2F%2Fwww.webmin.com%2F

[2]+  Done                    ts=1282635512

解壓縮,并進入檔案夾,開始安裝:

[lk@hd ~]$ tar zxvf webmin-1.510.tar.gz

webmin-1.510  webmin-1.510-1.noarch.rpm  webmin-1.510.tar.gz

[lk@hd ~]$ cd webmin-1.510

[lk@hd webmin-1.510]$ ./setup.sh

***********************************************************************

*            Welcome to the Webmin setup script, version 1.510        *

Webmin is a web-based interface that allows Unix-like operating

systems and common Unix services to be easily administered.

ERROR: The Webmin install script must be run as root

[lk@hd webmin-1.510]$

需要使用root身份。

[lk@hd webmin-1.510]$ su

密碼:

[root@hd webmin-1.510]# ./setup.sh

Installing Webmin in /home/lk/webmin-1.510 ...

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]:

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 perl (default /usr/bin/perl):

Testing Perl ...

Perl seems to be installed ok

Operating system name:    CentOS Linux

Operating system version: 5.4

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 using 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):

Login name (default admin):

Login password:

Password again:

Use SSL (y/n): y

Start Webmin at boot time (y/n): y

Creating web server config files..

..done

Creating access control file..

Inserting path to perl into scripts..

Creating start and stop scripts..

Copying config files..

Configuring Webmin to start at boot time..

Created init script /etc/rc.d/init.d/webmin

Creating uninstall script /etc/webmin/uninstall.sh ..

Changing ownership and permissions ..

Running postinstall scripts ..

Attempting to start Webmin mini web server..

Starting Webmin server in /home/lk/webmin-1.510

Pre-loaded WebminCore

Webmin has been installed and started successfully. Use your web

browser to go to

  https://hd:10000/

and login with the name and password you entered previously.

Because Webmin uses SSL for encryption only, the certificate

it uses is not signed by one of the recognized CAs such as

Verisign. When you first connect to the Webmin server, your

browser will ask you if you want to accept the certificate

presented, as it does not recognize the CA. Say yes.

[root@hd webmin-1.510]#

ok,安裝成功。

現在再思考剛才RPM沒能安裝成功的原因,很可能是非root身份導緻的。

今天重新安裝系統,又重新試了一遍rpm包,安裝成功,注意身份必須是root:

[root@lk lk]# wget http://prdownloads.sourceforge.net/webadmin/webmin-1.510-1.noarch.rpm

--2010-08-27 09:37:56--  http://prdownloads.sourceforge.net/webadmin/webmin-1.510-1.noarch.rpm

正在解析主機 prdownloads.sourceforge.net... 216.34.181.59

Connecting to prdownloads.sourceforge.net|216.34.181.59|:80... 已連接配接。

已發出 HTTP 請求,正在等待回應... 301 Moved Permanently

位置:http://downloads.sourceforge.net/project/webadmin/webmin/1.510/webmin-1.510-1.noarch.rpm [跟随至新的 URL]

--2010-08-27 09:37:57--  http://downloads.sourceforge.net/project/webadmin/webmin/1.510/webmin-1.510-1.noarch.rpm

Reusing existing connection to prdownloads.sourceforge.net:80.

--2010-08-27 09:37:58--  http://cdnetworks-kr-2.dl.sourceforge.net/project/webadmin/webmin/1.510/webmin-1.510-1.noarch.rpm

100%[======================================>] 15,995,394   593K/s   in 44s

2010-08-27 09:38:42 (354 KB/s) - `webmin-1.510-1.noarch.rpm' saved [15995394/15995394]

[root@lk lk]# rpm -ivh webmin-1.510-1.noarch.rpm

Preparing...                ########################################### [100%]

Operating system is CentOS Linux

   1:webmin                 ########################################### [100%]

^[[B

Webmin install complete. You can now login to https://lk:10000/

as root with your root password.

繼續閱讀