openSUSE:WebYaST Installation

Jump to: navigation, search

WebYaST installation version >= 0.3

Version 0.3 is much more simple than older versions. We have brought the two web servers (service/client) together. So only one HTTP server is needed now. Additional we have exchanged the old PolicyKit by the newer polkit in order keeping conform with the latest linux distribution.

Installation with one click ( the short story )

The simplest way is the one-click installation which is already installed on your openSuSE.

Installation

The YaST One-Click Install for WebYaST can be found at http://software.opensuse.org/package/webyast-base

In case you would like a system tray icon from which you can easily start/stop WebYaST, also install QWebYaST; http://software.opensuse.org/package/qwebyast?search_term=qwebyast

Starting and managing WebYaST

WebYaST is a web application which runs on ONE HTTP server on your system. For starting and managing this server there is a nice Qt-applet which can be started e.g. in KDE:

Qwebyast2.jpeg

After starting the WebYaST applet the WebYaST icon appears on the right edge of the frame :

Qwebyast-disabled.png WebYaST is disabled

Qwebyast-enabled.png WebYaST enabled

With the right mouse click you can manage WebYaST:

Qwebyast-2.jpeg

With this applet you can start WebYaST in your browser too. After accepting the GPG-key please login with your “root” account.

Installation and running from packages (RPM) ( the long story )

Installation

All Web-YaST packages have the prefix webyast-* which should be selected for installation. If you would like to use the WebYaST applet described above please install the package qwebyast too.

How to use WebYast

If you do not want to start WebYaST by the WebYaST applet you can also start WebYaST in a console:

rcwebyast start

Now you can use any browser and connect with 'http://<name of your computer>:54984' to your computer. The default rights of WebYaST are set to root only. So you can login with the root password of that machine.

Installation from source (GIT) ( the longest story )

This procedure works for a plain openSUSE 11.4 and above installations. The aim would be to run a WebYaST HTTP server with your local user, lets call him tux.

The source code should be based on the official GIT repository in order to keep up to date and in order checking in changes.

Installation

Change to user root in order to prepare your system:

su

Do not use "su -" or "su - root". So we keep the local user ENV.

Install needed packages with:

zypper ar http://download.opensuse.org/repositories/YaST:/Web:/WebYaST/openSUSE_11.4/ WebYaST
zypper in git make rubygem-rake rubygem-rails rubygem-rcov

Switch back to user tux and checkout the GIT repository into a directory with granted access rights.

git clone git://github.com/webyast/webyast.git
cd webyast

Switch back to root:

su

Preparing WebYaST environment:

rake system_check_packages[install]

This call checks if all needed packages are installed ( via the *.spec files). Zypper will be called for installing needed packages.

rake deploy_devel_all

Deploys all needed files and grants required access rights.

In order to have access from "outside" and getting system information please call:

rcSuSEfirewall2 stop
rccollect start

Starting and managing WebYaST

Switch back to user tux and start the WebYaST server:

cd webyast
start.sh

Now you can use any browser and connect with 'http://<name of your computer>:4984' to your computer. The default rights of WebYaST are set to root only. So you can login with the root password of that machine.

WebYaST installation version < 0.3 (openSUSE_12.1, SLES11)

Installation with one click ( the short story )

The simplest way is the one-click installation which is already installed on your openSUSE.

Installation

Just use a web browser (like firefox) with the url:


The browser will ask you to start the installation via the one-click installation. Start the installation and go through the installation workflow.

Starting and managing WebYaST

WebYaST is a web application which runs on two http servers on your system. For starting and managing these servers There is a nice Qt-applet which can be started e.g. in KDE:

Qwebyast2.jpeg

After starting the WebYaST applet the WebYaST icon appears on the right edge of the frame :

Qwebyast-disabled.png WebYaST is disabled

Qwebyast-enabled.png WebYaST enabled

With the right mouse click you can manage WebYaST:

Qwebyast-2.jpeg

With this applet you can start WebYaST in your browser too. After accepting the GPG-key please login with your “root” account.

Installation and running from packages (RPM) ( the long story )

Installation

A build service project is located here

Repositories with up to date packages is located here

As some additional packages (e.g. nginx) are needed which are not on openSUSE 11.3 you should add a repositories ( e.g. factory ) in order to provide these packages. Current version need only ruby extension repository.

Web-YaST core contains following packages:

  • server side (running on managed system)
    • webyast-base-ws (core service)
  • client side (serving html pages to a browser)
    • webyast-base-ui (the web client)

On top of that, modules can be added which provide management functionality:

  • webyast-*-ws (web service plugins)
  • webyast-*-ui (web client plugins modules)

See the complete list of packages for details on available packages and modules.

All other needed packages (ruby-rpam, rubygem-gettext, yast2-core with newer version,...) are located in this repository too and will be installed due the dependencies of the yast2-web* packages.


How to use the YaST-Webservice

Starting and access

After you have installed these packages you can start the YaST-Webservice-Server with

rcyastws start

The server is running as “localhost:4984″ with which you can connect with a web browser:

http://localhost:4984

This “pure” web page shows the available modules which can be used via the REST interface.

Configuration

Additional configuration stuff like

  • setup Hostname and Port
  • setup HTTPS connection
  • granting permissions for an single user

can be found here in the configuration part.

NOTE: This has already been done while the RPM-package installation.


How to use the YaST-Webclient

After you have started the YaST-Webservice-Server you also can start the YaST-Webclient:

rcyastwc start

Now you can use any browser and connect with 'https://<name of your computer>:54984' to your computer. The default rights of the YaST Webservice are set to root only. So you can login with the root password of that machine.


Testsuite Subpackages

WebYaST testsuite files are packaged into separate *-testsuite subpackages. These packages are not needed at runtime (for normal WebYaST use) and therefore they should not be installed by default.

These packages only provide the ability to verify some (ideally all) functions of WebYaST itself.

How to run the tests (under a non-root user):

 # change the directory to the selected WebYaST plugin (or the main application)
 cd /srv/www/yast/vendor/plugins/<plugin_to_test>
 # set the location of the main application directory
 export RAILS_PARENT=/srv/www/yast
 # set the path to testing DB (any writable location for the current user)
 export TEST_DB_PATH=~/webyast_test.sqlite3
 # set the test mode
 export RAILS_ENV=test
 # create the testing DB
 rake db:create
 rake db:schema:load
 # and finally run the tests
 rake

When testing is finished the testing DB file (~/webyast_test.sqlite3 in this case) can be safely removed.

Note: Because the log file is not accessible for unprivileged users all log messages are be printed on the console. This includes also simulated errors which are used to test some unexpected situations, therefore when an error message is printed it does not mean that there is a problem. The actual result is the summary printed in color (if the current terminal supports colors), e.g.:

57 tests, 88 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications

If there is an error the message is printed either in red or yellow color.


Installation from source (GIT) ( the logest story )

Install the WebYaST REST Service component

See REST service for technical implementation details. This page is about installing from source and enabling yastws (and root) to run it.

The packaged WebYaST rest-service uses https and lighttpd as http server - deployment of these features is not covered by this document.

Download the source code

git clone git://gitorious.org/opensuse/yast-rest-service.git

WebYaST is now on Gitorious and has its own developers group. Commenting other people code is really easy on Gitorious and lots of communication takes place this way.

Even though deploying from sources is pretty straightforward, getting the right packages is not.

Getting the "right" packages

This procedure works for openSUSE 11.1, 11.2 and SLE11 installations.

Ruby on Rails

Add repository with proper version of ruby on rails (2.3.4) . WebYaST is picky about rails version in the tradition of many other rails applications.

zypper addrepo http://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_11.1/ "openSUSE:Tools"

And install rails rubygem

zypper in rubygem-rails-2_3
Other needed packages

We are installing yast-rest-service from source, but we still need some other packages from YaST:Web project.

zypper addrepo http://download.opensuse.org/repositories/YaST:/Web/openSUSE_11.2 "YaST:Web"
zypper in rubygem-rcov rubygem-sqlite3 rubygem-test-unit ruby-rpam ruby-dbus ruby-polkit collectd rubygem-static_record_cache

Collectd is needed for gathering data for the Status module, so it's kind of optional. To set it up run

insserv collectd
rccollectd start

Mocha rubygem (needed for running tests) and Gettext are available in the devel:languages:ruby:extensions project. YaST2 DBUS client and server are part of openSUSE (SLE).

zypper addrepo http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions/openSUSE_11.2 "devel:languages:ruby:extensions"
zypper in rubygem-mocha rubygem-gettext_rails yast2-dbus-client yast2-dbus-server rubygem-http_accept_language
YaST packages update

Some YaST modules had to be enhanced to handle WebYaST calls. These updates are available in the YaST:Web project, but the update is not straightforward because of a bug in zypper (bnc#522223). Even "zypper in -r REPO package" does not work. We have to find exact versions of packages and give them to zypper on the command line

zypper search -r "YaST:Web" -s yast2-users

or find all of the versions with one search

zypper search -r "YaST:Web" -s yast2

and then install (update) all of them using the versions we found.

zypper in yast2-users-2.17.28.2 yast2-2.17.70.1 yast2-storage-lib-2.17.78 yast2-storage-2.17.78 \
  yast2-registration-branding-openSUSE-2.17.28 yast2-registration-2.17.28 yast2-pkg-bindings-2.17.38 \
  yast2-network-2.17.78.1 yast2-country-data-2.17.34.2 yast2-country-2.17.34.2

Webservice rake tasks

WebYaST developers put all general purpose rake tasks into a single rubygem - webyast-rake-tasks. We install them by

cd yast-rest-service/webservice-tasks
rake package-local
sudo gem install package/webyast-rake-tasks-<version>.gem
cd -

Installing the gem needs to be done as root, insert version matching the created gem above.


Rest service deployment

After all the package updating trouble, deploying rest-service is fairly easy. This will gather policies of all modules and give root permission to use them. Also it will migrate the database and create necessary directories and configuration files, which some modules need.

cd yast-rest-service
sudo rake deploy_devel_all
cd -

Deployment needs to be done as root, since it creates/modifies files in the /etc/ directory.


Start HTTP server

To run the rest-service server as yastws user from the command line, we enter

cd yast-rest-service/webservice
su yastws
script/server -p 4984

Port 4984 is a IANA registered port number.

Skipping base system setup

When we are running Webyast for the first time, the system will take us to a "wizard", which consists of several modules. One of them is also "register SLE" module, which cannot be successfully used on openSUSE. Therefore this line has to be used to skip basesystem setup:

touch /var/lib/yastws/basesystem/finish

Installing the WebYaST web client component

This page is about installing from source.

The packaged WebYaST web-service uses https and lighttpd as http server - deployment of these features is not covered by this document.

Download the source

git clone git://gitorious.org/opensuse/yast-web-client.git

WebYaST is now on Gitorious and has its own developers group. Commenting other people code is really easy on Gitorious and lots of communication takes place this way.

Install needed packages

To generate CSS dynamically from .sass files is rubygem-haml required

zypper in rubygem-haml

Web client rake tasks

Updates stylesheets if necessary from their Sass templates.

rake sass:update 

In order to reduce the size and number of HTTP connections the CSS files should be compressed and bundled together.

cd webclient
rake css:min

The same should be done for javascript files

cd webclient
rake js:base

Status module:

cd ..
cd /plugins/status
rake js:status 

Users module

cd yast-web-client/plugins/users
rake js:users 

Web client deployment

Deploying web-client itself is fairly easy. This will build gettext translations (.po => .mo) and also migrate the database.

cd yast-web-client
rake deploy_devel_all
cd -

openSUSE 11.2 or later

You may encounter problems with gettext when running deploy_devel_all. Instead on OS11.2 or later run:

cd yast-web-client/webclient
rake db:migrate
cd -

Start HTTP server

We can run web-client as any user. To run the web-client server from the command line, enter

cd yast-web-client/webclient
script/server -p 54984

Port 54984 is a IANA registered port number.