Part 1: Linux, Web server and Database
Now we see how to setup the development environment. First download Linux (for ex. Linux Mint www.linuxmint.com/download.php) and install on Pen Drive following this tutorial www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows.
You may wish to install it as the second OS on your PC, see the manual www.everydaylinuxuser.com/2014/07/how-to-install-linux-mint-alongside.html.
When the Linux is up and running,
the first to do is to upgrade it to the final release
Statring with shell
What is "the shell" and why bother? The shell is a program that takes your commands from the keyboard and gives them to the operating system to perform. Nowadays, we have graphical user interfaces (GUIs) in addition to command line interfaces (CLIs) such as the shell. To open one simply click "Menu" and type "terminal"
So why bother? 95% of servers is running Linux, most of them are headless -- without GUI!
So as we've seen before simple command like this one
upgrades the entire operating system, or installs the web server
APT, the Advanced Packaging Tool, provide rapid, practical, and efficient way to install packages that would manage dependencies automatically and take care of their configuration files while upgrading.
Upgrade all installed packages
Upgrade all installed packages and tell APT to use "smart" conflict resolution system, and it will attempt to upgrade the most important packages as kernel etc.
Search available package
Search for installed package
GIT is a distributed revision control system with an emphasis on speed, data integrity, and support for distributed, non-linear workflows.
Git was initially designed and developed by Linus Torvalds for Linux kernel development in 2005, and has since become the most widely adopted version control system for software development.
GitHub is a web-based Git repository hosting service, which offers all of the distributed revision control and source code management (SCM) functionality of Git as well as adding its own features.
GitHub for Mac And Windows
GitHub offers very handy utilities for Mac and Windows that enables managing repositories via graphical interface.
Editors and IDE
For Web development there is a big choice of editors and IDE-s available. Let's consider some of them
Sublime Text is a sophisticated text editor for code, markup and prose. You'll love the slick user interface, extraordinary features and amazing performance.
Please install Apache web server and create "Hello world" page.
Install GIT. Register un account su GitHub and Install the GIT Gui.
Please install MySQL server, MySQL PHPMyAdmin and MySQL Workbench. Create test database.
Clone repository https://github.com/ccoenraets/wine-cellar-php and configure Apache and MySQL to run application.
- Create new Droplet Ubuntu 14.04 x64 on DigitalOcean
- install apache2 and mysql: digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-14-04
- permit path rewrite
- clone repository into cellar folder
Exercise 6 (advanced, requires knowledge of basics of NodeJS e NPM)
Install Ghost Blogging platfowm https://github.com/TryGhost/Ghost and create one post
- Installation for all platforms http://support.ghost.org/installation/
- Or alternatively, cofigure with DigitalOcean (create new Droplet Ubuntu 12.04.5 x64) digitalocean.com/community/tutorials/how-to-host-ghost-with-nginx-on-digitalocean
Part 2: RESTful Web Services
At first install
Apache web server, we suppose Ubuntu 14.04 installed on server,
Then let's assume the name of the website is
example.com, so we configure Apache to serve content for this website from the folder
And put the
Create corresponding folders
and enable the website
then reload conf
Here we'll see how to create a simple PHP web service with the help of Composer. Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you.
now clone the source code
Switch to the folder of the project
And switch to "Hello world" branch
and configure dependences
The latter will create folder
vendor in current folder, that will contains all PHP libraries that our project will depend on.
To run the application just simply switch to
and start built-in web server on
Note, the built-in web server is available only for version of
Now open browser on
http://localhost:8080/hello/world or try it via
Project Learning NoSQL e PHP
Project Learning NoSQL e PHP, https://github.com/moiseevigor/learning-nosql-php, contains a number of branches.
After previous step we find ourselves at
You need to explore the project in the following order
hello-world: basic routing and functionality
controllers: introduction of Controller and advanced routing
models: introduction of Models and Doctrine ORM
To switch between branches you need to execute
After every switch you need to update libraries with