
Для запуска USDownloader на GUI-less (или, как говорят, headless) Linux server (в нашем случае это Ubuntu server 8.10) нужны 4 шага, самый сложный из которых - заставить корректно запускаться урезанную framebuffer версию иксов - Xvfb.
Итак, по пунктам:
1) - УСТАНОВКА XVFB, WINE и CABEXTRACT -
== Устанавливаем Xvfb, wine и cabextract:
sudo apt-get install xvfb wine cabextract
В силу того, что пакет xvfb не был выверен для работы с Ubuntu-server:
https://bugs.launchpad.net/ubuntu/+source/x...ver/+bug/294454
пока это компенсируется необходимостью поставить еще несколько пакетов:
Код:
sudo apt-get install xfs xfonts-scalable xfonts-100dpi
==Запускаем Xvfb
/usr/bin/X11/Xvfb :10.10 -screen 10 800x600x16 -ac -br -kb -c -fbdir /var/tmp/
$ cat /etc/X11/xorg.conf
# xorg.conf (X.Org X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type man xorg.conf at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg
Section InputDevice
Identifier Generic Keyboard
Driver kbd
Option XkbRules xorg
Option XkbModel pc105
Option XkbLayout us,ru
Option XkbVariant ,winkeys
Option XkbOptions grp:caps_toggle,grp_led:scroll
EndSection
Section InputDevice
Identifier Configured Mouse
Driver mouse
Option CorePointer
EndSection
Section Device
Identifier Intel Corporation 82845G/GL[Brookdale-G]/GE Chipset Int egrated Graphics Device
EndSection
Section Monitor
Identifier LG
EndSection
Section Screen
Identifier Default Screen
Device Intel Corporation 82845G/GL[Brookdale-G]/GE Chipset Integrated Graph ics Device
Monitor LG
DefaultDepth 16
SubSection Display
Viewport 0 0
Depth 16
Modes 800x600 640x480
EndSubSection
EndSection
Section ServerLayout
Identifier Default Layout
Screen Default Screen
EndSection
# xorg.conf (X.Org X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type man xorg.conf at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg
Section InputDevice
Identifier Generic Keyboard
Driver kbd
Option XkbRules xorg
Option XkbModel pc105
Option XkbLayout us,ru
Option XkbVariant ,winkeys
Option XkbOptions grp:caps_toggle,grp_led:scroll
EndSection
Section InputDevice
Identifier Configured Mouse
Driver mouse
Option CorePointer
EndSection
Section Device
Identifier Intel Corporation 82845G/GL[Brookdale-G]/GE Chipset Int egrated Graphics Device
EndSection
Section Monitor
Identifier LG
EndSection
Section Screen
Identifier Default Screen
Device Intel Corporation 82845G/GL[Brookdale-G]/GE Chipset Integrated Graph ics Device
Monitor LG
DefaultDepth 16
SubSection Display
Viewport 0 0
Depth 16
Modes 800x600 640x480
EndSubSection
EndSection
Section ServerLayout
Identifier Default Layout
Screen Default Screen
EndSection
$ cat /etc/X11/xserver/SecurityPolicy
version-1
# $Xorg: SecurityPolicy,v 1.3 2000/08/17 19:47:56 cpqbld Exp $
# The site policy fields are interpreted by the XC-QUERY-SECURITY-1
# authorization protocol. The values are arbitrary and site-specific.
# Refer to the Security Extension Specification for the usage of the policies.
#sitepolicy A
#sitepolicy B
#sitepolicy C
# Property access rules:
# property <property /> <window /> <permissions />
# <window /> ::= any | root | <propertyselector />
# <propertyselector /> ::= <property /> | <property />=<value />
# <permissions /> :== [ <operation /> | <action /> | <space /> ]*
# <operation /> :== r | w | d
# r read
# w write
# d delete
# <action /> :== a | i | e
# a allow
# i ignore
# e error
# Allow reading of application resources, but not writing.
property RESOURCE_MANAGER root ar iw
property SCREEN_RESOURCES root ar iw
# Ignore attempts to use cut buffers. Giving errors causes apps to crash,
# and allowing access may give away too much information.
property CUT_BUFFER0 root irw
property CUT_BUFFER1 root irw
property CUT_BUFFER2 root irw
property CUT_BUFFER3 root irw
property CUT_BUFFER4 root irw
property CUT_BUFFER5 root irw
property CUT_BUFFER6 root irw
property CUT_BUFFER7 root irw
# If you are using Motif, you probably want these.
property _MOTIF_DEFAULT_BINDINGS root ar iw
property _MOTIF_DRAG_WINDOW root ar iw
property _MOTIF_DRAG_TARGETS any ar iw
property _MOTIF_DRAG_ATOMS any ar iw
property _MOTIF_DRAG_ATOM_PAIRS any ar iw
# If you are running CDE you also need these
property _MOTIF_WM_INFO root arw
property TT_SESSION root irw
property WM_ICON_SIZE root irw
property SDT Pixel Set any irw
# The next two rules let xwininfo -tree work when untrusted.
property WM_NAME any ar
# Allow read of WM_CLASS, but only for windows with WM_NAME.
# This might be more restrictive than necessary, but demonstrates
# the <required property=property /> facility, and is also an attempt to
# say top level windows only.
property WM_CLASS WM_NAME ar
# These next three let xlsclients work untrusted. Think carefully
# before including these; giving away the client machine name and command
# may be exposing too much.
property WM_STATE WM_NAME ar
property WM_CLIENT_MACHINE WM_NAME ar
property WM_COMMAND WM_NAME ar
# To let untrusted clients use the standard colormaps created by
# xstdcmap, include these lines.
property RGB_DEFAULT_MAP root ar
property RGB_BEST_MAP root ar
property RGB_RED_MAP root ar
property RGB_GREEN_MAP root ar
property RGB_BLUE_MAP root ar
property RGB_GRAY_MAP root ar
# To let untrusted clients use the color management database created
# by xcmsdb, include these lines.
property XDCCC_LINEAR_RGB_CORRECTION root ar
property XDCCC_LINEAR_RGB_MATRICES root ar
property XDCCC_GRAY_SCREENWHITEPOINT root ar
property XDCCC_GRAY_CORRECTION root ar
# To let untrusted clients use the overlay visuals that many vendors
# support, include this line.
property SERVER_OVERLAY_VISUALS root ar
version-1
# $Xorg: SecurityPolicy,v 1.3 2000/08/17 19:47:56 cpqbld Exp $
# The site policy fields are interpreted by the XC-QUERY-SECURITY-1
# authorization protocol. The values are arbitrary and site-specific.
# Refer to the Security Extension Specification for the usage of the policies.
#sitepolicy A
#sitepolicy B
#sitepolicy C
# Property access rules:
# property <property /> <window /> <permissions />
# <window /> ::= any | root | <propertyselector />
# <propertyselector /> ::= <property /> | <property />=<value />
# <permissions /> :== [ <operation /> | <action /> | <space /> ]*
# <operation /> :== r | w | d
# r read
# w write
# d delete
# <action /> :== a | i | e
# a allow
# i ignore
# e error
# Allow reading of application resources, but not writing.
property RESOURCE_MANAGER root ar iw
property SCREEN_RESOURCES root ar iw
# Ignore attempts to use cut buffers. Giving errors causes apps to crash,
# and allowing access may give away too much information.
property CUT_BUFFER0 root irw
property CUT_BUFFER1 root irw
property CUT_BUFFER2 root irw
property CUT_BUFFER3 root irw
property CUT_BUFFER4 root irw
property CUT_BUFFER5 root irw
property CUT_BUFFER6 root irw
property CUT_BUFFER7 root irw
# If you are using Motif, you probably want these.
property _MOTIF_DEFAULT_BINDINGS root ar iw
property _MOTIF_DRAG_WINDOW root ar iw
property _MOTIF_DRAG_TARGETS any ar iw
property _MOTIF_DRAG_ATOMS any ar iw
property _MOTIF_DRAG_ATOM_PAIRS any ar iw
# If you are running CDE you also need these
property _MOTIF_WM_INFO root arw
property TT_SESSION root irw
property WM_ICON_SIZE root irw
property SDT Pixel Set any irw
# The next two rules let xwininfo -tree work when untrusted.
property WM_NAME any ar
# Allow read of WM_CLASS, but only for windows with WM_NAME.
# This might be more restrictive than necessary, but demonstrates
# the <required property=property /> facility, and is also an attempt to
# say top level windows only.
property WM_CLASS WM_NAME ar
# These next three let xlsclients work untrusted. Think carefully
# before including these; giving away the client machine name and command
# may be exposing too much.
property WM_STATE WM_NAME ar
property WM_CLIENT_MACHINE WM_NAME ar
property WM_COMMAND WM_NAME ar
# To let untrusted clients use the standard colormaps created by
# xstdcmap, include these lines.
property RGB_DEFAULT_MAP root ar
property RGB_BEST_MAP root ar
property RGB_RED_MAP root ar
property RGB_GREEN_MAP root ar
property RGB_BLUE_MAP root ar
property RGB_GRAY_MAP root ar
# To let untrusted clients use the color management database created
# by xcmsdb, include these lines.
property XDCCC_LINEAR_RGB_CORRECTION root ar
property XDCCC_LINEAR_RGB_MATRICES root ar
property XDCCC_GRAY_SCREENWHITEPOINT root ar
property XDCCC_GRAY_CORRECTION root ar
# To let untrusted clients use the overlay visuals that many vendors
# support, include this line.
property SERVER_OVERLAY_VISUALS root ar
== Устанавливаем текущий дисплей
export DISPLAY=:10.10
проверяем
echo $DISPLAY
==Добиваемся корректной работы Xvfb (как минимум - wine-приложения не завершаются с критической ошибкой).
В моем случае - выдаваемые некритичные ошибки Xvfb и wine (типа недоступных шрифтов и т.п.) не вызывают падения USDownloader
Для проверки, запускаем, например
wine notepad.exe &
Проверяем
ps -C notepad.exe
2) - УСТАНОВКА IES4LINUX -
Следуем инструкциям отсюда (в принципе, достаточен только шаг №6)
You have to enable universe packages first. It is also recommended that you use the official winehq ubuntu package:
1) Open a terminal
2) Open /etc/apt/sources.list
sudo gedit /etc/apt/sources.list
3) Uncomment (or add) following lines:
deb http://us.archive.ubuntu.com/ubuntu edgy universe
4) Add this line:
deb http://wine.budgetdedicated.com/apt edgy main
5) Close gedit. Update and install wine and cabextract:
wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install wine cabextract
6) Download IEs 4 Linux and install
wget http://www.tatanka.com.br/ies4linux/downlo...x-latest.tar.gz
tar zxvf ies4linux-latest.tar.gz
cd ies4linux-*
./ies4linux
1) Open a terminal
2) Open /etc/apt/sources.list
sudo gedit /etc/apt/sources.list
3) Uncomment (or add) following lines:
deb http://us.archive.ubuntu.com/ubuntu edgy universe
4) Add this line:
deb http://wine.budgetdedicated.com/apt edgy main
5) Close gedit. Update and install wine and cabextract:
wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install wine cabextract
6) Download IEs 4 Linux and install
wget http://www.tatanka.com.br/ies4linux/downlo...x-latest.tar.gz
tar zxvf ies4linux-latest.tar.gz
cd ies4linux-*
./ies4linux
3) - УСТАНОВКА WINDOWS SCRIPTING HOST (запуск .VBS) -
== Загружаем скрипт автоматической доустановки в wine различных компонентов windozz (спасибо подвижничеству Dan Kegel, dank@kegel.com)
http://kegel.com/wine/winetricks
Правим скрипт - убираем с помощью переключателя /Q все выскакивающие в процессе установки окна Accept license terms и т.п.:
было>
try $WINE $WINETRICKS_CACHE/vc6redistsetup_enu.exe /T:&#96;$WINE winepath -w $WINETRICKS_TMP&#96; /c $WINETRICKS_QUIET
стало>
try $WINE $WINETRICKS_CACHE/vc6redistsetup_enu.exe /T:&#96;$WINE winepath -w $WINETRICKS_TMP&#96; /c /Q
было>
$WINE $WINETRICKS_CACHE/vcredist.exe || true
стало>
$WINE $WINETRICKS_CACHE/vcredist.exe /Q || true
было>
try $WINE $WINETRICKS_CACHE/WindowsXP-Windows2000-Script56-KB917344-x86-enu.exe $WINETRICKS_QUIET
стало>
try $WINE $WINETRICKS_CACHE/WindowsXP-Windows2000-Script56-KB917344-x86-enu.exe /Q
== Устанавливаем Windows Scripting Host (необходим для запуска скриптов .vbs в USD)
./winetricks -v wsh56
4) - УСТАНОВКА И НАСТРОЙКА USDownloader -
== Загружаем актуальную portable сборку USD от blackmanos (это придется делать в браузере, т.к. сборка выложена на файлообменниках)
http://blackmanos.org.ru/files/sborka_blackmanos_portable.exe
Распаковывыем сборку в windoze, переносим содержимое Linux в отдельную папку (у меня это ~/.wine/drive_c/usd)
== Создаем виндовс диск u: в виде ссылки на папку, куда USD будет сохранять закачанные файлы (в моем случае - это папка /mm/usd):
cd ~/.wine/dosdevices
ln -s -T /mm/usd u:
ln -s -T /mm/usd u:
== Правим соответствующие пути в файле USDownloader.ini (заодно поменяем дефолтный язык на английский - чтобы проще было логи читать)
[Main]
SelectLang=1
Language=USDownloader.eng.lng
SaveTo=u:
SaveToItems=u:
...
DefaultSaveToFolder=u:
SelectLang=1
Language=USDownloader.eng.lng
SaveTo=u:
SaveToItems=u:
...
DefaultSaveToFolder=u:
== Там же (USDownloader.ini) прописываем запуск web-сервера USD
[WebServer]
Enabled=1
Address=0.0.0.0
Port=8088
Login=YOURLOGIN
Password=YOURPASSWORD
Form.AddLink.Width=400
Form.AddLink.URL.Height=200
Form.AddLink.Descr.Height=100
Enabled=1
Address=0.0.0.0
Port=8088
Login=YOURLOGIN
Password=YOURPASSWORD
Form.AddLink.Width=400
Form.AddLink.URL.Height=200
Form.AddLink.Descr.Height=100
YOURLOGIN и YOURPASSWORD, естественно, прописываем свои. Не забудьте открыть в firewall указанный вами здесь порт (8088) на подключения извне (к нему вы и будете коннектиться браузером для управления USD).
== Запускаем USDownloader
wine C:usdUSDownloader.exe &
Проверяем, появился ли такой процесс в системе:
ps -C USDownloader.exe
== Заходим браузером на сервер USD
Внимание! У вас нет прав для просмотра скрытого текста.
Проверяем работу - ставим закачку в USD, параллельно смотрим лог:
tail -f ~/.wine/drive_c/usd/USDownloader.log
Закачка с depositfiles работает - похоже, что скрипты vbs-автоматизации выполняются корректно.
Вроде бы, все.
Статья найдена на просторах интернета если кто найдет её автора пусть стукнет мне в асю поставлю ссылку на оф. статью.
Вопросы мне можете не задавать думаю не смогу ответить сам не ставил под линуксом, меня дома винда устраивает.
Новость отредактировал: Funt - 22 июля 2010







































