server side browser

后端 未结 2 1183
忘掉有多难
忘掉有多难 2021-02-08 23:54

I was wondering if it is possible to run a browser (specifically a browser engine) on the server side. I do not just mean to render a page but to keep a browser open for some ti

2条回答
  •  无人及你
    2021-02-09 00:40

    Yes, it it very possible to run a web browser on a server. Ubuntu Server, for example can run firefox by simply installing firefox and xserver.

    $ sudo apt-get install firefox
    $ sudo apt-get install xserver-xorg
    

    Then to get firefox running type:

    $ X
    

    This will leave you with a blank screen because there are no applications running on the display yet. You need to shift back to a new terminal with Ctrl-Alt-F2. Ctrl-Alt-F1 holds the X process now.

    Login to the new terminal and set the environment’s display variable to :0 and launch firefox.

    $ export DISPLAY=:0
    $ firefox &
    

    Firefox should now be running, but you'll notice it's got some quirks to it. If you decide that you want to go forward with this you should install a window manager. I'd go with a lightweight tiling window manager and run firefox and whatever other applications need graphical output within that window manager.

提交回复
热议问题