如何在 RHEL 8/CentOS 8 上安装 Webmin如何在 RHEL 8/CentOS 8 上安装 Webmin如何在 RHEL 8/CentOS 8 上安装 Webmin如何在 RHEL 8/CentOS 8 上安装 Webmin
  • 业务
  • 目标
  • 支持
  • 登录
找到的结果: {phrase} (显示: {results_count} 共: {results_count_total})
显示: {results_count} 共: {results_count_total}

加载更多搜索结果...

搜索范围
模糊匹配
搜索标题
搜索内容

如何在 RHEL 8/CentOS 8 上安装 Webmin

发表 admin at 2025年2月28日
类别
  • 未分类
标签

Webmin 是基于 Web 的管理员工具,可以管理系统的许多方面。安装后,我们可以管理机器的资源、在其上运行的服务器应用程序、设置 cronjobs 等等。它带有自己的 http 服务器,不需要额外的容器或网络服务器。丰富的功能集可以通过网络界面访问,因此我们只需要一个浏览器来远程管理我们的系统。

在本教程中,我们将在 RHEL 8/CentOS 8 上安装 Webmin,添加必要的服务文件以方便管理,并登录 WUI(Web 用户界面)。

在本教程中您将学习:

  • 如何从 tarball 安装 Webmin

  • 如何添加和测试systemd服务文件

  • 如何访问网页界面

在 RHEL 8 上安装 Webmin

如何在 Redhat 8 上安装 webmin 分步说明

Webmin 唯一需要的是一些 perl 软件包。我们将以 root 用户身份工作,Webmin 需要以 root 身份运行,以便能够管理一切。

  1. 为了在安装前解决依赖问题,我们可以使用dnf来安装包Net::SSLeay,如下所示:

    dnf install perl perl-Net-SSLeay

    另一个需要的模块是Encode::Detect。如果我们安装了cpan,我们就可以轻松安装这个模块:

    cpan[1]> install "Encode::Detect"
    [...]
      JGMYERS/Encode-Detect-1.01.tar.gz
      ./Build install  -- OK

    模块安装成功后,我们可以退出cpan,暂时不需要它。

    cpan[2]> exit
  2. 接下来我们下载Webmin的tarball包:

    # wget http://prdownloads.sourceforge.net/webadmin/webmin-1.900.tar.gz

    并提取它:

    # tar -xvf webmin-1.900.tar.gz

    然后进入进程中创建的目录:

    # cd webmin-1.900/
  3. 我们调用设置脚本,并需要回答几个问题。这里给出的参数是将安装 Webmin 的目标目录。这可以是任何方便的东西。出于本教程的目的,我们将保留所有默认值。

    # ./setup.sh /usr/local/webmin
    
    ***********************************************************************
    *            Welcome to the Webmin setup script, version 1.900        *
    ***********************************************************************
    Webmin is a web-based interface that allows Unix-like operating
    systems and common Unix services to be easily administered.
    
    Installing Webmin from /root/temp/webmin-1.900 to /usr/local/webmin ...
    
    ***********************************************************************
    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]: ENTER
    Log file directory [/var/webmin]: ENTER
    
    ***********************************************************************
    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): ENTER
    
    Testing Perl ...
    Perl seems to be installed ok
    
    ***********************************************************************
    For Webmin to work properly, it needs to know which operating system
    type and version you are running. Please select your system type by
    entering the number next to it from the list below
    ---------------------------------------------------------------------------
      1) Pardus Linux           2) SmartOS                3) Sun Solaris          
      4) Lycoris Desktop/LX     5) Caldera OpenLinux eS   6) Caldera OpenLinux    
      7) Asianux Server         8) Asianux                9) Whitebox Linux       
     10) Tao Linux             11) CentOS Linux          12) Springdale Linux     
     13) Virtuozzo Linux       14) Scientific Linux      15) Gralinux             
     16) NeoShine Linux        17) Endian Firewall Linu  18) Oracle Enterprise Li 
     19) Oracle VM             20) XenServer Linux       21) CloudLinux           
     22) MostlyLinux           23) Cloudrouter Linux     24) Sangoma Linux        
     25) Redhat Enterprise Li  26) Redhat Linux Desktop  27) AlphaCore Linux      
     28) X/OS Linux            29) Haansoft Linux        30) cAos Linux           
     31) Wind River Linux      32) Amazon Linux          33) Redhat Linux         
     34) Fedora Linux          35) White Dwarf Linux     36) Slamd64 Linux        
     37) Slackware Linux       38) Xandros Linux         39) APLINUX              
     40) BigBlock              41) Ubuntu Linux          42) Mepis Linux          
     43) Devuan Linux          44) Raspbian Linux        45) Linux Mint           
     46) Debian Linux          47) SuSE OpenExchange Li  48) SuSE SLES Linux      
     49) SuSE Linux            50) United Linux          51) Corel Linux          
     52) TurboLinux            53) Cobalt Linux          54) Mandrake Linux Corpo 
     55) pclinuxos Linux       56) Mageia Linux          57) Mandrake Linux       
     58) Mandriva Linux        59) Mandriva Linux Enter  60) Conectiva Linux      
     61) ThizLinux Desktop     62) ThizServer            63) MSC Linux            
     64) SCI Linux             65) LinuxPPC              66) Trustix SE           
     67) Trustix               68) Tawie Server Linux    69) TinySofa Linux       
     70) Cendio LBS Linux      71) Ute Linux             72) Lanthan Linux        
     73) Yellow Dog Linux      74) Corvus Latinux        75) Immunix Linux        
     76) Gentoo Linux          77) Secure Linux          78) OpenNA Linux         
     79) SoL Linux             80) Coherent Technology   81) PlayStation Linux    
     82) StartCom Linux        83) Yoper Linux           84) Caixa Magica         
     85) openmamba Linux       86) FreeBSD               87) DragonFly BSD        
     88) OpenBSD               89) NetBSD                90) BSDI                 
     91) HP/UX                 92) SGI Irix              93) DEC/Compaq OSF/1     
     94) IBM AIX               95) SCO UnixWare          96) SCO OpenServer       
     97) Mac OS X              98) Darwin                99) OpenDarwin           
     100) Cygwin                101) Sun Java Desktop Sys  102) Synology DSM         
     103) Generic Linux         104) Windows              
    ---------------------------------------------------------------------------
    Operating system: 25
    
    Please enter the version of Redhat Enterprise Linux you are running
    Version: 8
    
    Operating system name:    Redhat Enterprise Linux
    Operating system version: 8
    
    ***********************************************************************
    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): ENTER
    Login name (default admin):  ENTER
    Login password: type secure password
    Password again: type secure password again
    Use SSL (y/n): n
    Webmin does not support being started at boot time on your system.
    ***********************************************************************
    Copying files to /usr/local/webmin ..
    ..done
    
    Creating web server config files..
    ..done
    
    Creating access control file..
    ..done
    
    Inserting path to perl into scripts..
    ..done
    
    Creating start and stop scripts..
    ..done
    
    Copying config files..
    ..done
    
    Creating uninstall script /etc/webmin/uninstall.sh ..
    ..done
    
    Changing ownership and permissions ..
    ..done
    
    Running postinstall scripts ..
    ..done
    
    Enabling background status collection ..
    ..done
    
    Attempting to start Webmin mini web server..
    Starting Webmin server in /usr/local/webmin
    Cron 15468873867543 missing any time spec
    ..done
    
    ***********************************************************************
    Webmin has been installed and started successfully. Use your web
    browser to go to
    
      http://rhel8lab.linuxconfig.org:10000/
    
    and login with the name and password you entered previously.
  4. 在访问 WUI 之前,我们需要在防火墙上打开我们设置 Webmin 提供服务的端口,在本例中为默认端口 10000:

    # firewall-cmd --zone=public --add-port=10000/tcp --permanent
    success
    # firewall-cmd --reload
    success
  5. 接下来,我们创建名为 /etc/systemd/system/webmin.service 的服务文件,其中包含以下内容:

    [Unit]
    Description=Webmin
    Requires=local-fs.target
    After=basic.target
    Conflicts=shutdown.target
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/etc/webmin/start
    ExecStop=/etc/webmin/stop
    ExecReload=/etc/webmin/reload
    
    [Install]
    WantedBy=multi-user.target

    我们需要重新加载 systemd,以便它可以看到更改:

    # systemctl daemon-reload
  6. 我们将通过进入 /etc/webmin 目录并执行安装程序生成的 stop 脚本,使用服务器自己的脚本来停止服务器:

    # ./stop 
    Stopping Webmin server in /usr/local/webmin
  7. 现在我们可以使用 systemd 安全地管理服务:

    # systemctl start webmin

    并检查其状态:

    # systemctl status webmin
      webmin.service - Webmin
       Loaded: loaded (/etc/systemd/system/webmin.service; disabled; vendor preset: disabled)
       Active: active (exited) since Mon 2019-01-07 20:31:31 CET; 45min ago
      Process: 16004 ExecStart=/etc/webmin/start (code=exited, status=0/SUCCESS)
     Main PID: 16004 (code=exited, status=0/SUCCESS)
        Tasks: 0 (limit: 12544)
       Memory: 2.3M
       CGroup: /system.slice/webmin.service
  8. 我们可以通过启用 systemd 服务来添加启动时缺少的自动启动:

    # systemctl enable webmin
    Created symlink /etc/systemd/system/multi-user.target.wants/webmin.service -> /etc/systemd/system/webmin.service.
  9. 并通过在浏览器的地址栏中输入 http://:10000 来从浏览器访问这个丰富的工具。

    Webmin 的登录页面。

©2015-2025 Norria support@norria.com