当前位置: 首页 > news >正文

管理面板Ajenti的在Windows10下Ubuntu24.04/Ubuntu22.04里的安装

Ajenti是一款基于Web的开源系统管理控制面板,可用于通过Web浏览器,管理远程系统管理性任务,这一点与 Webmin模块 非常相似。 Ajenti是一款功能非常强大的轻型工具,它提供了快速的、反应灵敏的Web界面,可用于管理小型服务器环境,还最适合虚拟专用服务器(VPS)和专门服务器。

总结:

Ubuntu22.04里安装方便快捷,管理配置一切正常

在Ubuntu24.04里安装一波三折,最后也无法登录管理

以前在Ubuntu实体机的体验:

在linux安装管理面板:

安装文档:Installing — Ajenti 2.2.4 documentation

 但是安装完成之后,没有启动成功。用这条命令启动成功了:

systemctl restart ajenti

但是需要用系统的root登录,这个感觉有点安全隐患啊。

现在新版本安装,发现是普通用户登录,然后有sudo权限的账户可以再二次登录,获得root权限,安全性没问题。

textract 可以在任何文档中提取文本

Pycuda cuda封装

在Windows10下Ubuntu24.04实践

在Windows10 里的Ubuntu24.04环境里做实验,进行安装。整体一言难尽,最后跌跌撞撞安装成了,但是账户无法登录,登录上去之后是空白页面,显示:

当前无法使用此页面ERR_EMPTY_RESPONSE

一键安装(失败)

按照官网的命令,

curl https://raw.githubusercontent.com/ajenti/ajenti/master/scripts/install.sh | sudo bash -s -

结果下载失败,报错:curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 1 ms: Couldn't connect to server

用繁琐一点的方法,先拿到安装文件,再执行

安装文件在这个链接:ajenti/scripts/install.sh at master · ajenti/ajenti · GitHub

https://github.com/ajenti/ajenti/blob/master/scripts/install.sh

下载到win10,然后到Ubuntu里面去cp到Ubuntu的工作目录,比如win10下载到e:\360Download目录,目标目录是~/download,执行:

skywalk@DESKTOP-9C5AU01:/mnt/e/360Downloads$ cp install.sh  ~/download/

cp到Ubuntu的目录之后执行:

chmod 755 install.sh
sudo ./install.sh

但是安装的时候python那块报错。(后来才发现手动安装的时候python也有报错,估计是Ubuntu24.04的安全性导致的)

改用官方的手动安装

官方手动安装

安装需要的库

sudo add-apt-repository universe
sudo apt-get install build-essential python3-pip python3-dev python3-lxml libssl-dev python3-dbus python3-augeas python3-apt ntpdate

配置pip加速:

sudo pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

pip安装的时候会碰到error: externally-managed-environment 报错,解决方法是加上参数解决:--break-system-packages

安装Ajenti2

升级库,若是报错,不升级也可以

sudo pip3 install --break-system-packages setuptools pip wheel -U

安装Ajenti2

sudo pip3 install  --break-system-packages ajenti-panel ajenti.plugin.ace ajenti.plugin.augeas ajenti.plugin.auth-users ajenti.plugin.core ajenti.plugin.dashboard ajenti.plugin.datetime ajenti.plugin.filemanager ajenti.plugin.filesystem ajenti.plugin.network ajenti.plugin.notepad ajenti.plugin.packages ajenti.plugin.passwd ajenti.plugin.plugins ajenti.plugin.power ajenti.plugin.services ajenti.plugin.settings ajenti.plugin.terminal

如果报错python3-cryptography无法remove,则需要手工apt删除python3-cryptography再安装:

sudo apt remove python3-cryptography

ajenti终于安装完成:

Installing collected packages: cryptography, pyOpenSSL, aj, ajenti.plugin.core, ajenti-panel, ajenti.plugin.plugins, ajenti.plugin.passwd, ajenti.plugin.filesystem, ajenti.plugin.datetime, ajenti.plugin.augeas, ajenti.plugin.ace, ajenti.plugin.terminal, ajenti.plugin.settings, ajenti.plugin.notepad, ajenti.plugin.network, ajenti.plugin.filemanager, ajenti.plugin.packages, ajenti.plugin.dashboard, ajenti.plugin.auth-users, ajenti.plugin.services, ajenti.plugin.power
Successfully installed aj-2.2.10 ajenti-panel-2.2.10 ajenti.plugin.ace-0.32 ajenti.plugin.augeas-0.20 ajenti.plugin.auth-users-0.33 ajenti.plugin.core-0.109 ajenti.plugin.dashboard-0.42 ajenti.plugin.datetime-0.42 ajenti.plugin.filemanager-0.31 ajenti.plugin.filesystem-0.50 ajenti.plugin.network-0.30 ajenti.plugin.notepad-0.30 ajenti.plugin.packages-0.36 ajenti.plugin.passwd-0.27 ajenti.plugin.plugins-0.52 ajenti.plugin.power-0.25 ajenti.plugin.services-0.35 ajenti.plugin.settings-0.34 ajenti.plugin.terminal-0.42 cryptography-42.0.4 pyOpenSSL-24.0.0

看看安装好的库

sudo pip3 list | grep aj

 非常棒:

aj                        2.2.10
ajenti-panel              2.2.10
ajenti.plugin.ace         0.32
ajenti.plugin.augeas      0.20
ajenti.plugin.auth-users  0.33
ajenti.plugin.core        0.109
ajenti.plugin.dashboard   0.42
ajenti.plugin.datetime    0.42
ajenti.plugin.filemanager 0.31
ajenti.plugin.filesystem  0.50
ajenti.plugin.network     0.30
ajenti.plugin.notepad     0.30
ajenti.plugin.packages    0.36
ajenti.plugin.passwd      0.27
ajenti.plugin.plugins     0.52
ajenti.plugin.power       0.25
ajenti.plugin.services    0.35
ajenti.plugin.settings    0.34
ajenti.plugin.terminal    0.42

 创建python虚拟环境安装(失败)

在实体Ubuntu下,应该可以略过这步。但是在Windows10的Ubuntu24.04下,碰到报错,所以必须要创建虚拟环境

sudo apt install python3.12-venv
python3 -m venv py312

 激活环境

source py312/bin/activate

镜像加速

pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

  

 安装Ajenti2

pip3 install setuptools pip wheel -U

安装

pip3 install ajenti-panel ajenti.plugin.ace ajenti.plugin.augeas ajenti.plugin.auth-users ajenti.plugin.core ajenti.plugin.dashboard ajenti.plugin.datetime ajenti.plugin.filemanager ajenti.plugin.filesystem ajenti.plugin.network ajenti.plugin.notepad ajenti.plugin.packages ajenti.plugin.passwd ajenti.plugin.plugins ajenti.plugin.power ajenti.plugin.services ajenti.plugin.settings ajenti.plugin.terminal

 最后安装的时候ajenti-panel需要sudo权限,但是sudo之后,又会报跟系统冲突,所以最终还是用了官方手动安装方法,没有使用虚拟环境。

启动服务

 以前用systemctl restart ajenti 在ubuntu的低版本下启动成功过,但是这次在Win10下的Ubuntu24.04报错:Unit ajenti.service not found.

所以最终是使用命令启动:

sudo ajenti-panel -v

但是启动后,账户登录成功后,页面显示

当前无法使用此页面ERR_EMPTY_RESPONSE

 这样无法对ajenti进行配置管理。

在Windows10下Ubuntu22.04实践

在Ubuntu22.04下安装和配置都比较顺利,按照官方手册进行即可。

安装依赖包:

sudo add-apt-repository universe
sudo apt-get install build-essential python3-pip python3-dev python3-lxml libssl-dev python3-dbus python3-augeas python3-apt ntpdate

安装Ajenti2

sudo pip3 install setuptools pip wheel -U
sudo pip3 install ajenti-panel ajenti.plugin.core ajenti.plugin.dashboard ajenti.plugin.settings ajenti.plugin.plugins

安装Ajenti2所有插件

sudo pip3 install ajenti-panel ajenti.plugin.ace ajenti.plugin.augeas ajenti.plugin.auth-users ajenti.plugin.core ajenti.plugin.dashboard ajenti.plugin.datetime ajenti.plugin.filemanager ajenti.plugin.filesystem ajenti.plugin.network ajenti.plugin.notepad ajenti.plugin.packages ajenti.plugin.passwd ajenti.plugin.plugins ajenti.plugin.power ajenti.plugin.services ajenti.plugin.settings ajenti.plugin.terminal

 启动服务

安装好后,启动服务

sudo ajenti-panel

用浏览器连接8000端口即可管理配置。

具体管理配置见:管理面板Ajenti的在Windows10下Ubuntu24.04/Ubuntu22.04里的配置管理-CSDN博客

调试

install.sh安装的时候报错python处理失败

rm: cannot remove '/usr/lib//usr/bin/python3/dist-packages/setuptools.egg-info': No such file or directory
error: externally-managed-environment× This environment is externally managed
╰─> To install Python packages system-wide, try apt installpython3-xyz, where xyz is the package you are trying toinstall.If you wish to install a non-Debian-packaged Python package,create a virtual environment using python3 -m venv path/to/venv.Then use path/to/venv/bin/python and path/to/venv/bin/pip. Makesure you have python3-full installed.If you wish to install a non-Debian packaged Python application,it may be easiest to use pipx install xyz, which will manage avirtual environment for you. Make sure you have pipx installed.See /usr/share/doc/python3.12/README.venv for more information.

根据提示,手工先安装python环境。

sudo apt install python3-dev python3-pip python3-pil python3-augeas python3-dbus

后来发现有手工安装的民工,改用官方提供的方法。

后来发现pip安装任何库都是报错,所以这个问题还是要解决。

 sudo apt install python3.12-venv

然后创建了新的虚拟环境(后来发现使用虚拟环境也不行)

再后来发现可以用这个参数解决:--break-system-packages

即安装命令:

sudo pip3 install  --break-system-packages ajenti-panel ajenti.plugin.ace ajenti.plugin.augeas ajenti.plugin.auth-users ajenti.plugin.core ajenti.plugin.dashboard ajenti.plugin.datetime ajenti.plugin.filemanager ajenti.plugin.filesystem ajenti.plugin.network ajenti.plugin.notepad ajenti.plugin.packages ajenti.plugin.passwd ajenti.plugin.plugins ajenti.plugin.power ajenti.plugin.services ajenti.plugin.settings ajenti.plugin.terminal

安装ajenti2的时候报错build ajenti-panel失败

Failed to build ajenti-panel
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (ajenti-panel)

还是要用sudo来安装,这个库需要sudo权限

安装ajenti2的时候报错cryptography

  Attempting uninstall: cryptography
    Found existing installation: cryptography 41.0.7
ERROR: Cannot uninstall cryptography 41.0.7, RECORD file not found. Hint: The package was installed by debian.

sudo apt search cryptography |grep 41

发现果然有python3-cryptography 41.0.7这个版本,python3-cryptography/noble-updates,noble-security,now 41.0.7-4ubuntu0.1 amd64 [installed,automatic]

删除

sudo apt remove python3-cryptography

安装ajenti2前更新pip和wheel报错

因为报错,就想着像cryptography那样顺便把wheel也一并删除

sudo apt remove python3-wheel

不行啊,删除wheel,pip也一起删除了。想自己装也不行:

sudo python3 -m ensurepip
ensurepip is disabled in Debian/Ubuntu for the system python.Python modules for the system python are usually handled by dpkg and apt-get.apt install python3-<module name>Install the python3-pip package to use pip itself.  Using pip together
with the system python might have unexpected results for any system installed
module, so use it on your own risk, or make sure to only use it in virtual
environments.

这不进入死胡同了吗? 

后来就决定不更新wheel 和pip这两个库了。

服务启动后登录网页报错:

2024-12-23T13:35:25Z <Greenlet at 0x7f38959a2700: _handle_and_close_when_done(<bound method StreamServer.wrap_socket_and_handle , <bound method StreamServer.do_close of <WSGIServer, (<gevent._socket3.socket [closed] at 0x7f3895f0036)> failed with SSLError

Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 908, in gevent._gevent_cgreenlet.Greenlet.run
  File "/usr/local/lib/python3.12/dist-packages/gevent/baseserver.py", line 34, in _handle_and_close_when_done
    return handle(*args_tuple)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/gevent/server.py", line 209, in wrap_socket_and_handle
    with _closing_socket(self.wrap_socket(client_socket, **self.ssl_args)) as ssl_socket:
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/aj/core.py", line 224, in <lambda>
    aj.server.wrap_socket = lambda socket, **args:context.wrap_socket(sock=socket, server_side=True)
                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/gevent/ssl.py", line 121, in wrap_socket
    return self.sslsocket_class(
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/gevent/ssl.py", line 319, in __init__
    raise x
  File "/usr/local/lib/python3.12/dist-packages/gevent/ssl.py", line 315, in __init__
    self.do_handshake()
  File "/usr/local/lib/python3.12/dist-packages/gevent/ssl.py", line 673, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: HTTP_REQUEST] http request (_ssl.c:1000)
2024-12-23T13:35:25Z <Greenlet at 0x7f38959a2700: _handle_and_close_when_done(<bound method StreamServer.wrap_socket_and_handle , <bound method StreamServer.do_close of <WSGIServer, (<gevent._socket3.socket [closed] at 0x7f3895f0036)> failed with SSLError
这个留待以后解决。

http://www.lryc.cn/news/510467.html

相关文章:

  • 在Python如何用Type创建类
  • Android学习19 -- NDK4--共享内存(TODO)
  • 《Cocos Creator游戏实战》非固定摇杆实现原理
  • RabbitMQ工作模式(详解 工作模式:简单队列、工作队列、公平分发以及消息应答和消息持久化)
  • 【VScode】第三方GPT编程工具-CodeMoss安装教程
  • 在JavaScript中,let 和 const有什么不同
  • Mysq学习-Mysql查询(4)
  • 安装torch-geometric库
  • Java数组深入解析:定义、操作、常见问题与高频练习
  • Docker-构建自己的Web-Linux系统-镜像webtop:ubuntu-kde
  • 【C语言练习(17)—输出杨辉三角形】
  • SpringMVC学习(二)——RESTful API、拦截器、异常处理、数据类型转换
  • React 第二十节 useRef 用途使用技巧注意事项详解
  • VIVO Java开发面试题及参考答案
  • C# Winfrom chart图 实例练习
  • iOS从Matter的设备认证证书中获取VID和PID
  • 带着国标充电器出国怎么办? 适配器模式(Adapter Pattern)
  • 破解海外业务困局:新加坡服务器托管与跨境组网策略
  • Mybatis-Plus快速入门
  • Chrome被360导航篡改了怎么改回来?
  • Coding(Jenkinsfile)+ Docker 自动化部署 Springboot —— 图文细节和一些注意事项说明
  • docker django uwsgi 报错记录
  • 数据分析思维(五):分析方法——假设检验分析方法
  • 【ES6复习笔记】集合Set(13)
  • 基础爬虫案例实战
  • 深度学习工作:从追求 SoTA 到揭示新现象
  • 学习记录—正则表达式-基本语法
  • 智慧农业物联网传感器:开启农业新时代
  • 普通人怎么入门学习并使用AI?
  • Java中处理if-else的几种高级方法