PageRenderTime 118ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/docs/installation/index.md

https://github.com/sifophp/sifo-instance-documentation
Markdown | 93 lines | 61 code | 32 blank | 0 comment | 0 complexity | 8117c2da712164acc3d1037b332716cb MD5 | raw file
  1. Installation
  2. ============
  3. > Install Sifo in 5 minutes. So to speak.
  4. In order to install Sifo you need to have at least an Apache/Nginx running with PHP. Depending on your needs
  5. a variety of other services can be needed, such as Mysql, Sphinx, Redis... etc. If you want to start playing
  6. with Sifo or if you intend to do local development first the most convenient way to work is install Sifo inside
  7. a Virtual Machine.
  8. ## Sifo requirements
  9. * PHP >= 5.3 (We use namespaces!)
  10. * PDO & SQLite3 (In order to [save executions debug](/API/Debug) and being able to recover them, we use a little database managed thanks to the PDO extension, do not worry, it [comes with the default PHP installation since 5.1](http://php.net/manual/en/intro.pdo.php) and the SQLite3 extension also [comes with the default installation since 5.3.0](http://php.net/manual/en/sqlite3.installation.php))
  11. ## Installation
  12. If you are comfortable with a terminal, this is the way to install Sifo. The installation of the Sifo framework basically consists in the following steps:
  13. * [Clone or download the project](#clone)
  14. * [Install the dependencies using composer](#composer)
  15. * [Configure the web server](#webserver)
  16. * [Create your project](#instance)
  17. Let's get started!
  18. ### Clone the app {#clone}
  19. Clone the `sifo-app` which is a sample application using Sifo for an easier start.
  20. git clone https://github.com/sifophp/sifo-app.git
  21. If you don't want to do it this way and prefer a ZIP file or tarball you can still visit the [download](/download) page and get a copy without git.
  22. ### Install dependencies {#composer}
  23. To install the dependencies (including SIFO itself) you need composer. If you have never installed it then:
  24. curl -sS https://getcomposer.org/installer | php
  25. mv composer.phar /usr/local/bin/composer
  26. Once composer is installed then you should be able to run composer:
  27. composer install
  28. ### Configure the web server {#webserver}
  29. This is the part where you tell your webserver where to point to, where the code is. To do so you need to create a VirtualHost in your server.
  30. Depending on the technology you use the procedure is different, we provide detailed instructions for Apache and Nginx.
  31. If you have a **shared hosting** where you can't tune your server configuration there are instructions too, but we can't
  32. cover all specific services so we used Webfaction as a sample.
  33. * [Apache configuration](/installation/apache-virtualhosts)
  34. * [Nginx configuration](/installation/nginx-virtualhosts)
  35. * [Shared hosting configuration](/installation/shared-hosting-webfaction)
  36. ## Create your project [recommended] {#instance}
  37. After downloading the code you should create your own `instance`, you can see the structure in one of the existing folders, although you can start playing with the existing code.
  38. #### Important note
  39. It is recommended that you start building your application with a **fake domain** that will be used for development.
  40. We usually use the fake top level domain `.local`, so if we want to create in the internet an app named `mywebapp.com` then
  41. we create the instance like `mywebapp.local`
  42. You'll need to add in your `/etc/hosts` (Linux and Mac) an entry `mywebapp.local` with the IP of the server. In case you
  43. are planning to have multiple and dynamic subdomains a DNS server is recommended (as we suggested with Vagrant installation).
  44. **Example of `hosts`**
  45. 192.168.1.1 mywebapp.local www.mywebapp.local
  46. At this point, if you have configured the web server pointing to the new instance you should be able to see the page
  47. [http://mywebapp.local](http://mywebapp.local)
  48. ## Download a pre-configured Vagrant box (virtual machine)
  49. Hold on to the seats, this is all you need to do to have Sifo running in your local machine inside a Virtual machine:
  50. * Download and install [Vagrant](http://www.vagrantup.com/) (do not be scared, this is a double-click installation)
  51. * Automatically download and install the machine by:
  52. Copy/paste:
  53. git clone --recursive git@bitbucket.org:obokaman/centos-6.3-lamp-with-vagrant-for-sifo.git vmSifo
  54. cd vmSifo
  55. vagrant up
  56. That's all. No kidding. These commands will download a [running Sifo via Vagrant](https://bitbucket.org/obokaman/centos-6.3-lamp-with-vagrant-for-sifo)
  57. Now to access the running site:
  58. * Add in your machine as *DNS server* the IP `192.168.33.10` (will resolve any .local or .vm domains)
  59. * Now sifo is accessible in [http://sifo.local](http://sifo.local)
  60. * Read this [README](https://bitbucket.org/obokaman/centos-6.3-lamp-with-vagrant-for-sifo) to understand how Vagrant works with Sifo
  61. * [Start coding your own project](#instance)