实验环境
- 管理员已经在服务器中安装了CentOS系统,并熟悉了图形桌面环境及目录,文件管理基本命令的使用。为了进一步提高服务器的易用性,需要为其安装一些用于服务器管理及桌面环境的应用程序。
 
需求描述
- 使用“软件“功能删除Mozilla Firefox浏览器
 
[root@localhost /]# rpm -e firefox
警告:文件 /usr/lib64/firefox/distribution/extensions/langpack-zh@firefox.mozilla.org.xpi: 移除失败: 没有那个文件或目录
警告:文件 /usr/lib64/firefox/distribution/extensions/langpack-zh-TW@firefox.mozilla.org.xpi: 移除失败: 没有那个文件或目录- 使用RPM软件包的方式安装Mozilla Firefox浏览器
 
[root@localhost /]# mount /dev/cdrom /mnt
mount: /dev/sr0 写保护,将以只读方式挂载
[root@localhost /]# cd /mnt/Packages/
[root@localhost Packages]# rpm -ivh firefox-68.10.0-1.el7.centos.x86_64.rpm 
警告:firefox-68.10.0-1.el7.centos.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:firefox-68.10.0-1.el7.centos     ################################# [100%]
[root@localhost Packages]#- 使用源代码编译的方式安装Apache
 
[root@localhost /]# wget --ftp-user=t263 --ftp-password=123.123 ftp://172.16.150.13/软件下载/y2/y2c/httpd-2.4.25.tar.gz
--2022-06-30 15:52:25--  ftp://172.16.150.13/%E8%BD%AF%E4%BB%B6%E4%B8%8B%E8%BD%BD/y2/y2c/httpd-2.4.25.tar.gz
           => “httpd-2.4.25.tar.gz”
正在连接 172.16.150.13:21... 已连接。
正在以 t263 登录 ... 登录成功!
==> SYST ... 完成。   ==> PWD ... 完成。
==> TYPE I ... 完成。 ==> CWD (1) /软件下载/y2/y2c ... 完成。
==> SIZE httpd-2.4.25.tar.gz ... 8460433
==> PASV ... 完成。   ==> RETR httpd-2.4.25.tar.gz ... 完成。
长度:8460433 (8.1M) (非正式数据)
100%[=====================================================================================================================>] 8,460,433   7.53MB/s 用时 1.1s   
2022-06-30 15:52:26 (7.53 MB/s) - “httpd-2.4.25.tar.gz” 已保存 [8460433]
[root@localhost /]#
[root@localhost Packages]# rpm -ivh pcre-devel-8.32-17.el7.x86_64.rpm 
警告:pcre-devel-8.32-17.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:pcre-devel-8.32-17.el7           ################################# [100%]
[root@localhost Packages]# rpm -ivh apr-devel-1.4.8-7.el7.x86_64.rpm 
警告:apr-devel-1.4.8-7.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:apr-devel-1.4.8-7.el7            ################################# [100%]
[root@localhost Packages]# rpm -ivh expat-devel-2.1.0-12.el7.x86_64.rpm 
警告:expat-devel-2.1.0-12.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:expat-devel-2.1.0-12.el7         ################################# [100%]
[root@localhost Packages]# rpm -ivh libdb-devel-5.3.21-25.el7.x86_64.rpm 
警告:libdb-devel-5.3.21-25.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:libdb-devel-5.3.21-25.el7        ################################# [100%]
[root@localhost Packages]# rpm -ivh cyrus-sasl-devel-2.1.26-23.el7.x86_64.rpm 
警告:cyrus-sasl-devel-2.1.26-23.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:cyrus-sasl-devel-2.1.26-23.el7   ################################# [100%]
[root@localhost Packages]# rpm -ivh openldap-devel-2.4.44-22.el7.x86_64.rpm 
警告:openldap-devel-2.4.44-22.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:openldap-devel-2.4.44-22.el7     ################################# [100%]
[root@localhost Packages]# rpm -ivh apr-util-devel-1.5.2-6.el7.x86_64.rpm 
警告:apr-util-devel-1.5.2-6.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:apr-util-devel-1.5.2-6.el7       ################################# [100%]
[root@localhost Packages]#
[root@localhost /]# tar zxf httpd-2.4.25.tar.gz -C /usr/src
[root@localhost /]# ls /usr/src
debug  httpd-2.4.25  kernels
[root@localhost /]# cd /usr/src/httpd-2.4.25/
[root@localhost httpd-2.4.25]# ./configure --prefix=/usr/local/apache
[root@localhost httpd-2.4.25]# make
[root@localhost httpd-2.4.25]# make install
[root@localhost httpd-2.4.25]# vim /usr/local/apache/conf/httpd.conf 
  1 #
  2 # This is the main Apache HTTP server configuration file.  It contains the
  3 # configuration directives that give the server its instructions.
  4 # See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
  5 # In particular, see 
  6 # <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
  7 # for a discussion of each configuration directive.
  8 #
  9 # Do NOT simply read the instructions in here without understanding
 10 # what they do.  They're here only as hints or reminders.  If you are unsure
 11 # consult the online docs. You have been warned.  
 12 #
 13 # Configuration and logfile names: If the filenames you specify for many
 14 # of the server's control files begin with "/" (or "drive:/" for Win32), the
 15 # server will use that explicit path.  If the filenames do *not* begin
 16 # with "/", the value of ServerRoot is prepended -- so "logs/access_log"
 17 # with ServerRoot set to "/usr/local/apache2" will be interpreted by the
 18 # server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log" 
 19 # will be interpreted as '/logs/access_log'.
 20 
 21 #
 22 # ServerRoot: The top of the directory tree under which the server's
 23 # configuration, error, and log files are kept.
 24 #
 25 # Do not add a slash at the end of the directory path.  If you point
 26 # ServerRoot at a non-local disk, be sure to specify a local disk on the
 27 # Mutex directive, if file-based mutexes are used.  If you wish to share the
 28 # same ServerRoot for multiple httpd daemons, you will need to change at
 29 # least PidFile.
 30 #
 31 ServerRoot "/usr/local/apache"
 32 
 33 #
:set nu
194 ServerName www.example.com:80
[root@localhost httpd-2.4.25]# /usr/local/apache/bin/apachectl start
连接虚拟机的网页服务测试

- 使用RPM软件包的方式安装Webmin,并使用rpm查询软件的用途,文件列表
 
[root@localhost /]# wget --ftp-user=t263 --ftp-password=123.123 ftp://172.16.150.13/软件下载/y2/y2c/webmin-1.831-1.noarch.rpm
--2022-06-30 16:31:58--  ftp://172.16.150.13/%E8%BD%AF%E4%BB%B6%E4%B8%8B%E8%BD%BD/y2/y2c/webmin-1.831-1.noarch.rpm
           => “webmin-1.831-1.noarch.rpm”
正在连接 172.16.150.13:21... 已连接。
正在以 t263 登录 ... 登录成功!
==> SYST ... 完成。   ==> PWD ... 完成。
==> TYPE I ... 完成。 ==> CWD (1) /软件下载/y2/y2c ... 完成。
==> SIZE webmin-1.831-1.noarch.rpm ... 28389374
==> PASV ... 完成。   ==> RETR webmin-1.831-1.noarch.rpm ... 完成。
长度:28389374 (27M) (非正式数据)
100%[=====================================================================================================================>] 28,389,374  9.56MB/s 用时 2.8s   
2022-06-30 16:32:01 (9.56 MB/s) - “webmin-1.831-1.noarch.rpm” 已保存 [28389374]
[root@localhost /]# ls
bin  boot  dev  etc  home  httpd-2.4.25.tar.gz  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var  webmin-1.831-1.noarch.rpm
[root@localhost /]# 
[root@localhost /]# mount /dev/cdrom /mnt
mount: /dev/sr0 写保护,将以只读方式挂载
[root@localhost /]# cd /mnt/Packages/
[root@localhost Packages]# rpm -ivh perl-Net-SSLeay-1.55-6.el7.x86_64.rpm
警告:perl-Net-SSLeay-1.55-6.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:perl-Net-SSLeay-1.55-6.el7       ################################# [100%]
[root@localhost Packages]#
[root@localhost Packages]# cd /
[root@localhost /]# rpm -ivh webmin-1.831-1.noarch.rpm 
警告:webmin-1.831-1.noarch.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 11f63c51: NOKEY
准备中...                          ################################# [100%]
Operating system is CentOS Linux
正在升级/安装...
   1:webmin-1.831-1                   ################################# [100%]
Webmin install complete. You can now login to https://localhost.localdomain:10000/
as root with your root password.
[root@localhost /]#连接虚拟机网页











