MikroBILL сервер на Linux — различия между версиями

Материал из MikroBILL
Перейти к: навигация, поиск
Строка 1: Строка 1:
 
;Introduction
 
;Introduction
This guide will describe how to setup up MikroBill as a Linux Service. That means MikroBill will automatically start up during boot like any other allowed service in your system does.
+
This guide will describe how to setup up MikroBILL as a Linux Service. That means MikroBILL will automatically start up during boot like any other allowed service in your system does.
  
 
* Next step 1 (Install Required Software)
 
* Next step 1 (Install Required Software)
  
 
;Software - Wine (Windows Emulator)
 
;Software - Wine (Windows Emulator)
:We are going to use Wine to run MikroBill windows executable (.exe) under Linux.
+
:We are going to use Wine to run MikroBILL windows executable (.exe) under Linux.
  
 
::Install Wine:
 
::Install Wine:
Строка 20: Строка 20:
  
 
;Software - Xvfb (X virtual framebuffer)
 
;Software - Xvfb (X virtual framebuffer)
As you can imagine, we are going to need a GUI to install MikroBill. However, we usually don 't have one in server environments, unless you have a desktop manager installed like Gnome, KDE, etc. I sometimes install fluxbox (a very small desktop environment) for this purposes. Well, this program will allow us to create a virtual (fake) X Server used to install MikroBill.
+
As you can imagine, we are going to need a GUI to install MikroBILL. However, we usually don 't have one in server environments, unless you have a desktop manager installed like Gnome, KDE, etc. I sometimes install fluxbox (a very small desktop environment) for this purposes. Well, this program will allow us to create a virtual (fake) X Server used to install MikroBILL.
  
 
''Debian 6''
 
''Debian 6''
Строка 76: Строка 76:
 
:: <pre># kill -9 1612</pre>
 
:: <pre># kill -9 1612</pre>
  
* Next step 3 (Install MikroBill Server)
+
* Next step 3 (Install MikroBILL Server)
  
 
: <pre># cd /srv/mikrobill/drive_c</pre>
 
: <pre># cd /srv/mikrobill/drive_c</pre>
Строка 86: Строка 86:
 
:: <pre># sudo chown -R root:root /srv/mikrobill</pre>
 
:: <pre># sudo chown -R root:root /srv/mikrobill</pre>
  
* Next step 4 (Setting up the MikroBill Service)
+
* Next step 4 (Setting up the MikroBILL Service)
  
 
''Debian 6''
 
''Debian 6''
Строка 96: Строка 96:
  
 
### BEGIN INIT INFO
 
### BEGIN INIT INFO
# Provides: MikroBill
+
# Provides: MikroBILL
 
# Required-Start: $remote_fs $syslog
 
# Required-Start: $remote_fs $syslog
 
# Required-Stop: $remote_fs $syslog
 
# Required-Stop: $remote_fs $syslog
 
# Default-Start: 2 3 4 5
 
# Default-Start: 2 3 4 5
 
# Default-Stop:
 
# Default-Stop:
# Short-Description: MikroBill Server
+
# Short-Description: MikroBILL Server
 
### END INIT INFO
 
### END INIT INFO
  
Строка 122: Строка 122:
 
start ()
 
start ()
 
{
 
{
         echo -n 'Starting MikroBill virtual display: '
+
         echo -n 'Starting MikroBILL virtual display: '
 
         Xvfb $virtual_display -screen 0 1152x720x16 &> /dev/null &
 
         Xvfb $virtual_display -screen 0 1152x720x16 &> /dev/null &
 
         echo $! > $xvfb_pidfile
 
         echo $! > $xvfb_pidfile
 
         echo 'ok'
 
         echo 'ok'
         echo -n 'Starting MikroBill Server: '
+
         echo -n 'Starting MikroBILL Server: '
 
         sleep 5
 
         sleep 5
 
         wine 'c:\mikrobill\MikroBILL.exe' /SERVER &> /dev/null &
 
         wine 'c:\mikrobill\MikroBILL.exe' /SERVER &> /dev/null &
Строка 135: Строка 135:
 
stop ()
 
stop ()
 
{
 
{
         echo -n 'Stopping MikroBill Server: '
+
         echo -n 'Stopping MikroBILL Server: '
 
         kill $(cat $wine_pidfile)
 
         kill $(cat $wine_pidfile)
 
         rm -f $wine_pidfile
 
         rm -f $wine_pidfile
 
         sleep 5
 
         sleep 5
 
         echo 'ok'
 
         echo 'ok'
         echo -n 'Stopping MikroBill virtual display: '
+
         echo -n 'Stopping MikroBILL virtual display: '
 
         kill $(cat $xvfb_pidfile)
 
         kill $(cat $xvfb_pidfile)
 
         rm -f $xvfb_pidfile
 
         rm -f $xvfb_pidfile
Строка 174: Строка 174:
  
 
# chkconfig: - 50 20
 
# chkconfig: - 50 20
# description: MikroBill Server
+
# description: MikroBILL Server
  
# processname: mikrobill
+
# processname: MikroBILL
  
 
action=${1}
 
action=${1}
Строка 198: Строка 198:
 
start ()
 
start ()
 
{
 
{
echo -n 'Starting MikroBill virtual display:'
+
echo -n 'Starting MikroBILL virtual display:'
 
Xvfb $virtual_display -screen 0 1152x720x16 &> /dev/null &
 
Xvfb $virtual_display -screen 0 1152x720x16 &> /dev/null &
 
echo $! > $xvfb_pidfile
 
echo $! > $xvfb_pidfile
 
success
 
success
 
echo
 
echo
echo -n 'Starting MikroBill Server:'
+
echo -n 'Starting MikroBILL Server:'
 
sleep 5
 
sleep 5
 
wine 'c:\mikrobill\MikroBILL.exe' /SERVER &> /dev/null &
 
wine 'c:\mikrobill\MikroBILL.exe' /SERVER &> /dev/null &
Строка 214: Строка 214:
 
stop ()
 
stop ()
 
{
 
{
echo -n 'Stopping MikroBill Server:'
+
echo -n 'Stopping MikroBILL Server:'
 
kill $(cat $wine_pidfile)
 
kill $(cat $wine_pidfile)
 
rm -f $wine_pidfile
 
rm -f $wine_pidfile
Строка 220: Строка 220:
 
success
 
success
 
echo
 
echo
echo -n 'Stopping MikroBill virtual display:'
+
echo -n 'Stopping MikroBILL virtual display:'
 
kill $(cat $xvfb_pidfile)
 
kill $(cat $xvfb_pidfile)
 
rm -f $xvfb_pidfile
 
rm -f $xvfb_pidfile
Строка 253: Строка 253:
  
  
* Next step 5 (First start MikroBill Server)
+
* Next step 5 (First start MikroBILL Server)
  
 
''Debian 6/CentOS 5''
 
''Debian 6/CentOS 5''
  
Start Mikrobill Server.
+
Start MikroBILL Server.
 
: <pre># sudo service mikrobill start</pre>
 
: <pre># sudo service mikrobill start</pre>
 
or  
 
or  
Строка 271: Строка 271:
 
:: C:\windows\system32\explorer.exe /desktop
 
:: C:\windows\system32\explorer.exe /desktop
  
* Next step 6 (Stop MikroBill Server)
+
* Next step 6 (Stop MikroBILL Server)
 
''Debian 6/CentOS 5''
 
''Debian 6/CentOS 5''
  
Stop Mikrobill Server finish the installation process.
+
Stop MikroBILL Server finish the installation process.
 
: <pre># sudo service mikrobill stop</pre>
 
: <pre># sudo service mikrobill stop</pre>
 
or  
 
or  
 
: <pre># sudo /etc/init.d/mikrobill stop</pre>
 
: <pre># sudo /etc/init.d/mikrobill stop</pre>
  
* Next step 7 (Final start MikroBill Server)
+
* Next step 7 (Final start MikroBILL Server)
: Let's make the final launch Mikrobill Server.
+
: Let's make the final launch MikroBILL Server.
 
''Debian 6/CentOS 5''
 
''Debian 6/CentOS 5''
:Start Mikrobill Server.
+
:Start MikroBILL Server.
 
: <pre># sudo service mikrobill start</pre>
 
: <pre># sudo service mikrobill start</pre>
 
or  
 
or  
Строка 288: Строка 288:
  
 
;NB!
 
;NB!
:Now you can join the MikroBill server using MikroREMOTE.exe
+
:Now you can join the MikroBILL server using MikroREMOTE.exe
:After the computer restarts, the MikroBill service will start automatically.
+
:After the computer restarts, the MikroBILL service will start automatically.
 
:Next, you can configure the web server and using other database servers or webhosting.
 
:Next, you can configure the web server and using other database servers or webhosting.
  

Версия 09:50, 21 февраля 2020

Introduction

This guide will describe how to setup up MikroBILL as a Linux Service. That means MikroBILL will automatically start up during boot like any other allowed service in your system does.

  • Next step 1 (Install Required Software)
Software - Wine (Windows Emulator)
We are going to use Wine to run MikroBILL windows executable (.exe) under Linux.
Install Wine:
Go to Official Website WineHQ, select your OS.
Next, follow the instructions and install Wine
https://wiki.winehq.org/Download

CentOS 5

You will need to add <RepoForge repository>
# sudo wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
# sudo rpm -i rpmforge-release-0.5.2-2.el5.rf.i386.rpm
# sudo yum update
Software - Xvfb (X virtual framebuffer)

As you can imagine, we are going to need a GUI to install MikroBILL. However, we usually don 't have one in server environments, unless you have a desktop manager installed like Gnome, KDE, etc. I sometimes install fluxbox (a very small desktop environment) for this purposes. Well, this program will allow us to create a virtual (fake) X Server used to install MikroBILL.

Debian 6

# sudo apt-get install xvfb

CentOS 5

# sudo yum install xorg-x11-server-Xvfb
Software - X11VNC (X to VNC)

This will allow us to manage the virtual framebuffer display created with Xfvb from our desktop computer using VNC protocol.

Debian 6

# sudo apt-get install x11vnc

CentOS 5

# sudo yum install x11vnc
  • Next step 2 (Install Wine Container)

Debian 6/CentOS 5

Creating a Virtual Display with Xvfb.
# Xvfb :1 -screen 0 1152x720x16 &
Enabling VNC access to the Virtual Display.
# x11vnc -display :1  -bg -forever
Starting Wine envelope installation.
# export DISPLAY=:1
# export WINEPREFIX=/srv/mikrobill
# export WINEARCH=win32
# wine uninstaller
!NB
Download NET. Framework 4.0 Extendet from site http://mikro-bill.com/files/dotnetfx40.exe
Copy dotnetfx40.exe to directory (/srv/mikrobill/drive_c/)
Download Free VNC Client from site https://www.realvnc.com/en/connect/download/viewer/windows/
Start VNC Client from your Windows PC and connect to the server via ip address.
If there is a proposal to install Wine-Mono or Gecko, select refuse or click close.
* In window "If available - select from list (wine-mono) and Remove".
* Next press 'Install' select (dotnetfx40.exe) from drive "C:", finish the installation process.
* After installation, you can remove installer (dotnetfx40.exe).
Find process Xvfb :1 -screen 0 1152x720x16
# ps fax
(My process has now pid:1612)
Kill this process use command:
# kill -9 (pid)
I did it like this
# kill -9 1612
  • Next step 3 (Install MikroBILL Server)
# cd /srv/mikrobill/drive_c
# mkdir mikrobill

Download latest MikroBILL and unzip all files in to root directory:(/srv/mikrobill/drive_c/mikrobill)

Set root privileges.
# sudo chown -R root:root /srv/mikrobill
  • Next step 4 (Setting up the MikroBILL Service)

Debian 6

Create the file /etc/init.d/mikrobill:
# sudo nano /etc/init.d/mikrobill
Paste this bash code
#!/bin/bash

### BEGIN INIT INFO
# Provides: MikroBILL
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: MikroBILL Server
### END INIT INFO

action=${1}

# ----------------------------------------------
# User Options
# ----------------------------------------------
xvfb_pidfile='/var/run/mikrobill-xvfb.pid'
wine_pidfile='/var/run/mikrobill-wine.pid'
virtual_display=':1'
mikrobill_path='/srv/mikrobill'
# ----------------------------------------------

export DISPLAY=$virtual_display
export WINEPREFIX=$mikrobill_path
export WINEARCH=win32
export WINEDEBUG=-all

start ()
{
        echo -n 'Starting MikroBILL virtual display: '
        Xvfb $virtual_display -screen 0 1152x720x16 &> /dev/null &
        echo $! > $xvfb_pidfile
        echo 'ok'
        echo -n 'Starting MikroBILL Server: '
        sleep 5
        wine 'c:\mikrobill\MikroBILL.exe' /SERVER &> /dev/null &
        echo $! > $wine_pidfile
        echo 'ok'
}

stop ()
{
        echo -n 'Stopping MikroBILL Server: '
        kill $(cat $wine_pidfile)
        rm -f $wine_pidfile
        sleep 5
        echo 'ok'
        echo -n 'Stopping MikroBILL virtual display: '
        kill $(cat $xvfb_pidfile)
        rm -f $xvfb_pidfile
        echo 'ok'
}

case "$action" in
        start)
                start
        ;;

        stop)
                stop
        ;;

        *)
                echo "Usage: $0 {start|stop}"
        ;;
esac

# -----------------------------------------------------------------------
Installing an executable file.
# sudo chmod +x /etc/init.d/mikrobill
Enable the service:
# sudo /usr/lib/insserv/insserv mikrobill

CentOS 5

Create the file /etc/init.d/mikrobill
# sudo nano /etc/init.d/mikrobill
Paste this bash code
#!/bin/bash

# chkconfig: - 50 20
# description: MikroBILL Server

# processname: MikroBILL

action=${1}

. /etc/rc.d/init.d/functions

# ----------------------------------------------
# User Options
# ----------------------------------------------
xvfb_pidfile='/var/run/mikrobill-xvfb.pid'
wine_pidfile='/var/run/mikrobill-wine.pid'
virtual_display=':1'
mikrobill_path='/srv/mikrobill'
# ----------------------------------------------

export DISPLAY=$virtual_display
export WINEPREFIX=$mikrobill_path
export WINEARCH=win32
export WINEDEBUG=-all

start ()
{
	echo -n 'Starting MikroBILL virtual display:'
	Xvfb $virtual_display -screen 0 1152x720x16 &> /dev/null &
	echo $! > $xvfb_pidfile
	success
	echo
	echo -n 'Starting MikroBILL Server:'
	sleep 5
	wine 'c:\mikrobill\MikroBILL.exe' /SERVER &> /dev/null &
	echo $! > $wine_pidfile
	success
	touch /var/lock/subsys/mikrobill
	echo
}

stop ()
{
	echo -n 'Stopping MikroBILL Server:'
	kill $(cat $wine_pidfile)
	rm -f $wine_pidfile
	sleep 5
	success
	echo
	echo -n 'Stopping MikroBILL virtual display:'
	kill $(cat $xvfb_pidfile)
	rm -f $xvfb_pidfile
	success
	rm -f /var/lock/subsys/mikrobill
	echo
}

case "$action" in
	start)
		start
	;;

	stop)
		stop
	;;

	*)
		echo "Usage: $0 {start|stop}"
	;;
esac

# -----------------------------------------------------------------------
Installing an executable file.
# sudo chmod +x /etc/init.d/mikrobill
Enable the service:
# sudo chkconfig --add mikrobill
# sudo chkconfig mikrobill on


  • Next step 5 (First start MikroBILL Server)

Debian 6/CentOS 5

Start MikroBILL Server.

# sudo service mikrobill start

or

# sudo /etc/init.d/mikrobill start

Check if the server is working stably.

# ps fax
c:\mikrobill\MikroBILL.exe /SERVER
/usr/bin/wineserver
C:\windows\system32\services.exe
C:\windows\system32\winedevice.exe MountMgr
C:\windows\system32\plugplay.exe
C:\windows\system32\explorer.exe /desktop
  • Next step 6 (Stop MikroBILL Server)

Debian 6/CentOS 5

Stop MikroBILL Server finish the installation process.

# sudo service mikrobill stop

or

# sudo /etc/init.d/mikrobill stop
  • Next step 7 (Final start MikroBILL Server)
Let's make the final launch MikroBILL Server.

Debian 6/CentOS 5

Start MikroBILL Server.
# sudo service mikrobill start

or

# sudo /etc/init.d/mikrobill start
NB!
Now you can join the MikroBILL server using MikroREMOTE.exe
After the computer restarts, the MikroBILL service will start automatically.
Next, you can configure the web server and using other database servers or webhosting.
Сделал дело - выпей винишка.
Без труда не попьешь винишка с утра.
7 раз отмерь, один раз выпей винишка.
Будет день - будет винишко.
В семье не без винишка.

С автором статьи можно связаться через WhatsApp или Telegram (+372 56 942-223)