<para>SlapOS can be described as a cloud operating system in which "everything is a process" unlike Unix in which "everything is a file". If one has to manage thousands of servers with thousands of processes, hundred different applications in multiple different releases or versions, SlapOS can help you a lot by making the whole management process well specified, automated and under control.</para>
<para>The goal of this tutorial is to teach how to use SlapOS in the windows.
<para>The goal of this tutorial is to teach how to use SlapOS in the windows.</para>
<!--
<itemizedlist>
<listitem><para>First you need register an account in the slapos.org (refer to <xref linkend="ch_register_slapos_org"/>)</para></listitem>
<listitem><para>Then install SlapOS slave node in the windows (refer to <xref linkend="ch_install_slapos"/>)</para></listitem>
<listitem><para>Finally release software and create instanace of software in the SlapOS node (refer to <xreflinkend="ch_create_instance_wordpress"/>)</para></listitem>
<listitem><para>Finally enjoy slapos cloud in the Windows</para></listitem>
</itemizedlist>
</para>
-->
</chapter>
<!--
<chapter id="ch_register_slapos_org"><title>Registering in the slapos.org</title>
<para>Before we start, we need to register in VIFIB community Cloud. By doing so, we will obtain X509 certificate and key, make sure you store both of them to your local files. Take also note of the computer id, for example "COMP-161", store it somewhere. All of these are later needed for the installing process.</para>
<para>Refer to <ulinkurl="http://www.slapos.org/wiki/slapos-Wiki.Home/osoe-Lecture.SlapOS.Extended/developer-Installing.SlapOS.Slave.Node.Source"></ulink> in the section VIFIB Registration.</para>
<para>Then, we need to register your computer to slapos.org community Cloud. By doing so, we will obtain X509 certificate and key which are later needed for the configuration process.
<itemizedlist>
<listitem><para>Login to www.slapos.org. Go to the "My Space" area and then to the "My Servers" section. Click on the button "New Server". This button will lead you to a page where you can specify the name of your server.</para></listitem>
<listitem><para>Enter a self contained name to identify your server. Consider a name "VIFIB 19 Asus i7 for JB" rather than "My Server". This will help you find your server later on. Click on the "Add" button.</para></listitem>
<listitem><para>X509 key and certificate are generated. Certificates are not stored by slapos.org server. They will be lost if you do not save them : Do not close this web page yet as we are going to store the key and certificate in files in next step. </para>
<para>You can create 2 new files named as computer.key and computer.crt by Notepad or any editor your prefer, and save the content of certificate and key into both of files respectively.</para></listitem>
</itemizedlist>
</para>
<para>Refer to <ulink url="http://community.slapos.org/wiki/osoe-Lecture.SlapOS.Extended/developer-Running.SlapOS.on.your.computer"></ulink> in the section VIFIB Registration.</para>
</chapter>
-->
<chapterid="ch_install_slapos"><title>Installing SlapOS node in the Windows</title>
<para>At first, we need to sign up in VIFIB community Cloud by clicking here <ulinkurl="https://www.slapos.org/login_form"/></para>
<para>Then download the latest slapos windows installer from <ulinkurl="http://www.erp5.org/dists/installer"></ulink>, the filename of windows installer look like slapos-XXX-windows-x86-all-in-one.exe or slapos-XXX-windows.exe, XXX stands for version-release information. The all-in-one installer include all the files required by slapos node, so it can run in the computer which doesn't access internat; the later will download most of packages from internet and build, so it need more time than all-in-one installer. It's recommanded to use the former installer in case of slow or unstable internet even if the size of all-in-one installer is more than 100MB, compare of the latter which size is about 2MB.</para>
<para>Double click the installer, click Next, Next ...</para>
<para>At the final wizard page, click Install.</para>
<para>Waiting for everything done.</para>
<para>If you'd like to install slapos node from sources, refer to the chapter <xreflinkend="ch_generate_window_installer"/>.</para>
<chapter><title>Create slapos instance of Workpress in the Windows</title>
<para>After SlapOS has been installed successfully, you will find program group "SlapOS" which include the following entries:
Copy our cygwin inotifyx to download-cache/dist, so buildout will find it other than pypi.
</para>
<para>The common way to release a software is to login vifib website. But we haven't integrated this software.cfg into vifib, so we verify it in the local machine. It need a patch:
<para>Some dlls need to rebase in order to avoid fork issue in the Cygwin. Refer to <ulink url="http://cygwin.com/faq.html"></ulink> question 4.44 or search "rebase" in this page. First, exit all Cygwin processes and stop all Cygwin services.
<programlisting>
$ net stop cfgslapos
$ ps -ef | grep python2.7
# kill all these process which start by supervisord
$ exit
</programlisting>
If you install SlapOS node by MSI package, Click Start menu, select SlapOS program group, click Run rebaseall. Otherwise, download rebase-software.bat and save it in the cygwin root path.
Wait for a while, otherwise there is no partition assigned
$ bin/slapos node software
$ bin/slapos node instance
$ bin/slapos node start all
or
$ bin/slapos node start demoapp
$ bin/slapos node restart all
Recreate instance
$ bin/slapos node instance - -only_cp slappart9
$ bin/slapos request mydemoapp demoapp # not this, it request node in the cloud
Now, you can visit the demo in the browser by the url.
Refer to: http://community.slapos.org/wiki/osoe-Lecture.SlapOS.Extended/developer-Installing.SlapOS.Client
</para>
</chapter>
-->
<chapterid="ch_generate_window_installer"><title>Generating windows installer from sources</title>
<para>This chapter describes how to generate windows installer from sources.</para>
<section><title>Setting Up Cygwin</title>
<para>We need Cygwin environment in order to build slapos sources code in the Windows. </para>
<para>Go to <ulinkurl="http://cygwin.com/">"http://cygwin.com/"</ulink> and click on <ulinkurl="http://cygwin.com/setup.exe">"Install Cygwin Now!"</ulink>. This will download a GUI installer called setup.exe which can be run to download a complete cygwin installation via the internet. Follow the instructions on each screen to install Cygwin. </para>
<para>The Root Directory for Cygwin (default C:\cygwin) will become / within your Cygwin installation. You must have write access to the parent directory, and any ACLs on the parent directory will determine access to installed files.</para>
<para>By default, setup.exe will install only the packages in the Base category and their dependencies, resulting in a minimal Cygwin installation. We need choose the packages required by SlapOS, see <xreflinkend="appendix_cygwin_packages"/>. Since setup.exe automatically selects dependencies, be careful not to unselect any required packages.</para>
<para>Refer to: <ulinkurl="http://cygwin.com/cygwin-ug-net/setup-net.html"/></para>
<para>You can install cygwin in the command console either:
<para>Or you can install cygwin by command console, first you need download setup.exe from cygwin.com, save to D:\temp\setup.exe or somewhere else.
sed -e "s/Administrator:unused:500:/root:unused:0:/g")
$ echo $myaccount >> /etc/passwd
$ /usr/bin/cygserver-config --yes
$ /usr/bin/syslog-ng-config --yes
</programlisting>
Now double click the desktop icon "Cygwin" or run C:\cygwin\Cygwin.bat (Assume the cygwin root directory is C:\cygwin) to open a cygwin box. First configure tty, make the font bigger:
If you'd like to make the font of command box bigger
<programlisting>
root@JONDY ~
$ cd ~
$ cat <<EOF > .minttyrc
BoldAsFont=no
Font=Courier New
FontHeight=16
Scrollbar=none
EOF
</programlisting>
Then restart cygwin command box.
</para>
</section>
<section><title>Buildout SlapOS</title>
<para>Double click the desktop icon "Cygwin" or C:\cygwin\Cygwin.bat (Assume the cygwin root directory is C:\cygwin). A cygwin box will open, the following commands are typed in this box.
<section><title>Building SlapOS</title>
<para>Double click the desktop icon "Cygwin" to enter cygwin command box, the following commands are typed in this box.
Download openvpn windows installer, for example, openvpn-install-2.3.1-I001-i686.exe, use 7-zip or some other tools to pick up the driver files from the installer.
<programlisting>
Picking up tap-windows.exe from openvpn-install-2.3.1-I001-i686.exe\$TEMP\
Picking up devcon.exe from tap-windows.exe\bin\
Picking up all the files from tap-windows.exe\driver\
</programlisting>
Then generate user-guide.html from using-slapos-in-windows.xml, it requires xslt and dockbook, make sure these packages installed in the Cygwin
<programlisting>
$ cd /opt/git/slapos.package/windows/docs
# Before run make, be sure there is the file /usr/share/sgml/docbook/xsl-stylesheets/html/docbook.xsl, if not, find it first
$ find /usr -name docbook.xsl
# Then replace the old file name with this one in the Makefile, then run make
<para>We use Inno-Setup sripts to genarate microsoft installer, so we need install inno setup first. You can download the installer from <ulinkurl="http://www.innosetup.com"/>, then install inno-setup in you computer</para>
<para>Then click Start -> Inno Setup 5 -> Inno Setup Compiler, to open inno setup.</para>
<para>In the inno setup window, click File -> Open, select the script: /opt/git/slapos.package/windows/scripts/slapos-all-in-one.iss</para>
<para>In the section "Setup", there are some options:
<itemizedlist>
<listitem><para>OutputDir: the generated installer will be saved here</para></listitem>
<listitem><para>OutputBaseFilename: the prefix of output installer</para></listitem>
<listitem><para>SourceDir: it's a very important option. It's the root path of all the relative path in the section "Files"</para></listitem>
</itemizedlist>
In the section "Files", to be sure all the source files are exsiting in your computer, for example
Assum SourceDir in the section "Setup" is "D:\slapos", the builder will find "D:\slapos\images\slapos.ico" as the source, so this file should be exsited.
</para>
<para>Click menu Build -> Compile, then wait for the building process finished. You can check the installer in the OutputDir.</para>
<para>There is another script "slapos.iss", it used to build network installer. All-in-one installer will include all the files, so no internet access required. However network installer need internet connection to download the files and packages. It's remarkable smaller than all-in-one installer.</para>
</section>
<!--
<section><title>IPv6 Support</title>
<para>If native IPv6 is available, skip this section. Otherwise be sure you have installed IPv6 by the command:
<chapterid="ch_create_instance_wordpress"><title>Creating an instancee of Wordpress in the SlapOS</title>
<para>Copy our cygwin inotifyx to download-cache/dist, so buildout will find it other than pypi.
</para>
<para>The common way to release a software is to login vifib website. But we haven't integrated this software.cfg into vifib, so we verify it in the local machine. It need a patch:
<para>Some dlls need to rebase in order to avoid fork issue in the Cygwin. Refer to <ulinkurl="http://cygwin.com/faq.html"></ulink> question 4.44 or search "rebase" in this page. First, exit all Cygwin processes and stop all Cygwin services.
<programlisting>
$ net stop cfgslapos
$ ps -ef | grep python2.7
# kill all these process which start by supervisord
$ exit
</programlisting>
If you install SlapOS node by MSI package, Click Start menu, select SlapOS program group, click Run rebaseall. Otherwise, download rebase-software.bat and save it in the cygwin root path.