<commit_before>.. 

Development
===========
This sections describes the configuration of the development and runtime 
environment for the web shop.

Web server
----------
Instead of `Apache`_ the project is running on `Lighttpd`_. The reasons are
that Lighttpd provides fast setup, easy configuration, and better performance.
Lighttpd is running with `FastCGI`_.

The path of the web server is ``/var/www/lighttpd/`` and the SELinux
configuration are still defaults.

.. _Apache: http://apache.org/
.. _Lighttpd: http://www.lighttpd.net/
.. _FastCGI: http://www.fastcgi.com/drupal/

Database server
---------------
For persistence storage a `MySQL`_ data base is used. `phpMyAdmin` is available
under `/phpmyadmin/` on the web server, beside the command-line tools, for easy
administration.

.. _MySQL: http://www.mysql.com/
.. _phpMyAdmin: http://www.phpmyadmin.net

Versions
--------
The web shop is built with the below listed components and tested. Other
releases can be used and may work but this will not be tested. Probably it
will work with different releases. 

- Operating system: Fedora 19
- Kernel: 3.11.3-201.fc19.x86_64
- Lighttpd: 1.4.32
- PHP: 5.5.4
- MySQL: 5.5.33

Configuration management
------------------------
For the creation of reproducable and identical environment for the development
and the run-time across different systems `Ansible`_ is used as configuration
management solution. All needed steps of the installation are automated. The
configuration doesn't differentiate between local or remote installations. This
matters only for the deployment of the web content.

The configuration of Ansible itself (adding the system to ``/etc/ansible/hosts``
and copying the SSH keys) is not documented at this place. There are various
resources available, like `here`_. All playbooks are located in the folder
`devel`::

    $ sudo ansible-playbook setup.yml

The used group name in ``/etc/ansible/hosts`` is: **webshop**

For testing the deployment of new instances of the web shop, `short-virt`_ can
help. This simple bash script creates virtual machines without user interaction.
Requirements for this are installed libvirt tools and additional storage space
(ca. 8 GB) for the image.

For local development it's possbile to use an LXC container to save resources.::

    $ sudo ansible-playbook container.yml

To get everything running some additional steps (check the network inside the
container, generate keys, etc.) are needed. After you are done, check it::

    $ sudo ansible webshop -m setup

.. _Ansible: https://github.com/ansible/ansible
.. _here: https://github.com/fabaff/fedora-ansible/blob/master/README.md
.. _shop-virt: https://github.com/fabaff/ch.bfh.bti7054.w2013.p.shop/blob/master/devel/shop-virt

Git respository
---------------
All project relevante informations (Source code, templates, documentation, etc)
is located in a public `Git`_ repository on `Github`_.

https://github.com/fabaff/ch.bfh.bti7054.w2013.p.shop <commit_msg>update deployment<commit_after>.. 

Development
===========
This sections describes the configuration of the development and runtime 
environment for the web shop.

Web server
----------
Instead of `Apache`_ the project is running on `Lighttpd`_. The reasons are
that Lighttpd provides fast setup, easy configuration, and better performance.
Lighttpd is running with `FastCGI`_.

The path of the web server is ``/var/www/lighttpd/`` and the SELinux
configuration are still defaults.

.. _Apache: http://apache.org/
.. _Lighttpd: http://www.lighttpd.net/
.. _FastCGI: http://www.fastcgi.com/drupal/

Database server
---------------
For persistence storage a `MySQL`_ data base is used. `phpMyAdmin` is available
under `/phpmyadmin/` on the web server, beside the command-line tools, for easy
administration.

.. _MySQL: http://www.mysql.com/
.. _phpMyAdmin: http://www.phpmyadmin.net

Versions
--------
The web shop is built with the below listed components and tested. Other
releases can be used and may work but this will not be tested. Probably it
will work with different releases. 

- Operating system: Fedora 19
- Kernel: 3.11.4-201.fc19.x86_64
- Lighttpd: 1.4.32
- PHP: 5.5.4
- MySQL: 5.5.33

Configuration management
------------------------
For the creation of reproducable and identical environment for the development
and the run-time across different systems `Ansible`_ is used as configuration
management solution. All needed steps of the installation are automated. The
configuration doesn't differentiate between local or remote installations. This
matters only for the deployment of the web content.

The configuration of Ansible itself (adding the system to ``/etc/ansible/hosts``
and copying the SSH keys) is not documented at this place. There are various
resources available, like `here`_. All playbooks are located in the folder
`devel`::

    $ sudo ansible-playbook setup.yml

The used group name in ``/etc/ansible/hosts`` is: **webshop**

For testing the deployment of new instances of the web shop, `short-virt`_ can
help. This simple bash script creates virtual machines without user interaction.
Requirements for this are installed libvirt tools and additional storage space
(ca. 8 GB) for the image.

For local development it's possbile to use an LXC container to save resources.::

    $ sudo ansible-playbook container.yml

To get everything running some additional steps (check the network inside the
container, generate keys, etc.) are needed. After you are done, check it::

    $ sudo ansible webshop -m setup

.. _Ansible: https://github.com/ansible/ansible
.. _here: https://github.com/fabaff/fedora-ansible/blob/master/README.md
.. _shop-virt: https://github.com/fabaff/ch.bfh.bti7054.w2013.p.shop/blob/master/devel/shop-virt

Deployment
----------
For the simple deployment of the lastest version of the shop a playbook called
``deploy.yml`` is provided. This palybook put all files in place. ::

    $ sudo ansible-playbook deploy.yml

Git respository
---------------
All project relevante informations (Source code, templates, documentation, etc)
is located in a public `Git`_ repository on `Github`_.

https://github.com/fabaff/ch.bfh.bti7054.w2013.p.shop 
{'fraction_non_alphanumeric': 0.10814311154282014, 'fraction_numerical': 0.013922616156710378, 'mean_word_length': 3.7088414634146343, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 10, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1834765', 'n_tokens_mistral': 1841, 'n_tokens_neox': 1707, 'n_words': 743}