在没有 GUI 的服务器上运行 Smalltalk?

发布于 2024-08-25 15:16:16 字数 172 浏览 6 评论 0 原文

我有一个相当明显的问题 - 我想在生产服务器上运行 Smalltalk,而不使用图形界面。 VW 或 Pharo(甚至 Squeak)有可能做到这一点吗?

我有一个没有 X 的 VPS 托管,并且希望在 Smalltalk 上运行一些网站,同时使用成熟的 Smalltalk env(包括 GUI)在本地开发它们。

I've got rather distinct question - I'd like to run Smalltalk on a production server without using graphical interface. Is this possible with VW or Pharo (maybe even Squeak)?

I've got a VPS hosting without X and would like to have few websites running on Smalltalk, while developing them locally with full-blown Smalltalk env, including GUI.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

生死何惧 2024-09-01 15:16:16

是的,可以以“无头”方式部署 Pharo。只需发送 -headless 即可。示例:

#!/bin/sh

NOHUP="/usr/bin/nohup"
SQUEAK_VM="/usr/bin/squeakvm"
SQUEAK_OPTS="-mmap 100m -vm-sound-null -vm-display-X11 -headless"
SQUEAK="$SQUEAK_VM $SQUEAK_OPTS"
IMAGES_HOME="/home/miguel/squeak/images/azteca"
SCRIPTS_HOME="/home/miguel/squeak/scripts/azteca"
LOGS_HOME="/home/miguel/squeak/logs/azteca"
START_PORT=8080
END_PORT=8093


# Start the Magma image
echo "Starting Magma image"
$NOHUP $SQUEAK $IMAGES_HOME/magma.image $SCRIPTS_HOME/magma.st >> $LOGS_HOME/magma.nohup &

# Start the Seaside images
for PORT in `seq $START_PORT $END_PORT`; do
  echo "Starting Seaside image on port: $port"
  $NOHUP $SQUEAK $IMAGES_HOME/seaside.image $SCRIPTS_HOME/seaside.st
  port $PORT >> $LOGS_HOME/seaside.nohup &
done

通常部署一个运行 Seaside 的 PharoCore 映像,处于无头模式并运行 RFBServer(远程缓冲服务器),它实际上是一个 VNC 服务器。然后,您可以通过 VNC 客户端连接到该映像,并且可以像在本地一样浏览和使用 Smalltalk 映像。

我建议您阅读

http://miguel .leugim.com.mx/index.php/2009/09/18/deploying-seaside-applications/

或者新的海边书。

干杯

Yes, it is possible to deploy Pharo in a "headless" way. Just send the -headless and that's all. Example:

#!/bin/sh

NOHUP="/usr/bin/nohup"
SQUEAK_VM="/usr/bin/squeakvm"
SQUEAK_OPTS="-mmap 100m -vm-sound-null -vm-display-X11 -headless"
SQUEAK="$SQUEAK_VM $SQUEAK_OPTS"
IMAGES_HOME="/home/miguel/squeak/images/azteca"
SCRIPTS_HOME="/home/miguel/squeak/scripts/azteca"
LOGS_HOME="/home/miguel/squeak/logs/azteca"
START_PORT=8080
END_PORT=8093


# Start the Magma image
echo "Starting Magma image"
$NOHUP $SQUEAK $IMAGES_HOME/magma.image $SCRIPTS_HOME/magma.st >> $LOGS_HOME/magma.nohup &

# Start the Seaside images
for PORT in `seq $START_PORT $END_PORT`; do
  echo "Starting Seaside image on port: $port"
  $NOHUP $SQUEAK $IMAGES_HOME/seaside.image $SCRIPTS_HOME/seaside.st
  port $PORT >> $LOGS_HOME/seaside.nohup &
done

It is common to deploy a PharoCore image running Seaside, with in headless mode and running RFBServer (remote buffer server) which is actually a VNC server. Then, you can connect to that image trough a VNC client and you can browse and use the Smalltalk image as if it were locally.

I suggest you to read

http://miguel.leugim.com.mx/index.php/2009/09/18/deploying-seaside-applications/

Or the new seaside book.

Cheers

孤寂小茶 2024-09-01 15:16:16

正如不同编程语言的部署如何?

Smalltalk
部署 SqueakPharo Web 应用程序使用 SeasideApache httpd 在文档章节 使用 Apache 部署

As answered in How is the Deployment in different Programming Languages?:

Smalltalk:
Deploying a Squeak or Pharo web application using Seaside and Apache httpd is described in the documentation, chapter Deployment with Apache.

蓬勃野心 2024-09-01 15:16:16

不要忘记,还有专门为服务器上的无头操作而设计的 Smalltalk 环境,例如:

  • GNU Smalltalk (Unix 脚本风格,免费软件)
  • GemStone/S (应用程序服务器风格,专有,但小型免费安装)

Pharo 的具体设计目标之一是将开发环境与核心映像分离,以便更容易部署,但我不知道这项工作已经取得了多大的进展,也不知道它是否还包括完全删除 GUI。

我不确定 VisualWorks,但如果他们有无头模式,我不会感到惊讶。

在左边的字段中,有些人认为 Ruby 是“Unix 服务器的 Smalltalk”。当然,Ruby 是一种与 Smalltalk 截然不同且不太美观的语言。

您是否尝试过在 Seaside 邮件列表?他们必须一直处理这些事情。例如,Avi Bryant 的公司 Smallthought Systems 运行 DabbleDB流行 Squeak。

Don't forget that there are also Smalltalk environments that are specifically designed for headless operation on a server, e.g.:

  • GNU Smalltalk (Unix scripting style, Free Software)
  • GemStone/S (App Server style, Proprietary but gratis for small installations)

One of the specific design goals of Pharo is to divorce the development environment from the core image, for easier deployment, however I don't know how far this effort has come nor whether it also includes removing the GUI entirely.

I'm not sure about VisualWorks, but I wouldn't be surprised if they had a headless mode.

A little bit further out in left field, some people consider Ruby to be "Smalltalk for the Unix server". Although, of course Ruby is a much different and much less beautiful language than Smalltalk.

Have you tried asking on the Seaside mailing lists? They must deal with this stuff all the time. Avi Bryant's company Smallthought Systems, for example, runs both DabbleDB and trendly off Squeak.

生死何惧 2024-09-01 15:16:16

如果我在 VPS 上有 root 访问权限,我会亲自安装 Xvnc,它不会在服务器上增加太多的臃肿程度,而且使用 GUI 管理 Squeak 和 Pharo 会容易得多。

您可以通过让 Squeak 占据整个屏幕来在其自己的 Xvnc 显示中启动每个 Squeak 实例,而无需依赖窗口管理器。

您只需要最少的 X 支持文件。在无头 Ubuntu 上,apt-get installightvncserver 仅提取 19.8 Mb 的软件包。与 RFBServer 不同的是,它只适用于任何 Squeak/Pharo 图像。


我是这样做的:

为每个虚拟机启动一个 Xvnc 会话。您可以根据需要拥有任意数量的显示器。显示 :0 在 VNC 端口 5900 上运行,显示 :1 在 5901 上运行,依此类推。

在显示器上 statrt Xvnc :0

Xvnc :0 -nolisten tcp -geometry 1024x726 -depth 24 &

然后在该显示器上启动 Squeak

squeak -display :0 -- ~/fullscreen.st  &

屏幕大小调整 Squeak

"fullscreen.st"
ScreenController new fullScreenOn

关于安全性的说明

fullscreen.st 是一个简单的 Smalltalk 启动脚本,可根据 默认 Xvnc 接受没有密码的连接,因此我建议您至少采取以下预防措施之一。

  • 强制 Xvnc 侦听环回。为此,我使用 LD_PRELOAD 技巧 与此类似 并使用 ssh 端口进行连接转发。
  • 阻止防火墙上的端口
  • 阅读 -rfbauth 参数来设置 Xvnc 密码身份验证。

If I had root access on the VPS I would personally install Xvnc it doesn't add too much bloat on the server and it's much easier to manage Squeak and Pharo with a GUI.

You can launch each Squeak instance in it's own Xvnc display without relying on a Window Manager by having Squeak take up the whole screen.

You need only minimal X support files. On an headless Ubuntu apt-get install tightvncserver pulls only 19.8 Mb of packages. And unlike RFBServer it will just work with any Squeak/Pharo image.


Here's how I do this:

For each VM launch an Xvnc session. You can have as many displays as you need. Display :0runs on the VNC port 5900, display :1on 5901 and so on.

To statrt Xvnc on display :0

Xvnc :0 -nolisten tcp -geometry 1024x726 -depth 24 &

Then launch Squeak on that display

squeak -display :0 -- ~/fullscreen.st  &

fullscreen.st is a simple Smalltalk statup script that adjusts Squeak to the size of the screen

"fullscreen.st"
ScreenController new fullScreenOn

A note on security

By default Xvnc accept connections without a password so I suggest you take at least one of the following precautions.

  • Forces Xvnc to listen on loopback. I use an LD_PRELOAD trick similar to this for that purpose and connect using ssh port forwarding.
  • Block the port on your firewall
  • Read on the -rfbauth argument to setup Xvnc password authentication.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文