diff --git a/_images/deployment/cloudways/db-info.png b/_images/deployment/cloudways/db-info.png new file mode 100644 index 00000000000..5d24c7856a7 Binary files /dev/null and b/_images/deployment/cloudways/db-info.png differ diff --git a/_images/deployment/cloudways/http_url.png b/_images/deployment/cloudways/http_url.png new file mode 100644 index 00000000000..380e37acb07 Binary files /dev/null and b/_images/deployment/cloudways/http_url.png differ diff --git a/_images/deployment/cloudways/launch-server.png b/_images/deployment/cloudways/launch-server.png new file mode 100644 index 00000000000..e3250bade69 Binary files /dev/null and b/_images/deployment/cloudways/launch-server.png differ diff --git a/_images/deployment/cloudways/master-credentials.png b/_images/deployment/cloudways/master-credentials.png new file mode 100644 index 00000000000..5a5d0582006 Binary files /dev/null and b/_images/deployment/cloudways/master-credentials.png differ diff --git a/_images/deployment/cloudways/mysql-access.png b/_images/deployment/cloudways/mysql-access.png new file mode 100644 index 00000000000..b45f6b926a0 Binary files /dev/null and b/_images/deployment/cloudways/mysql-access.png differ diff --git a/_images/deployment/cloudways/select-application.png b/_images/deployment/cloudways/select-application.png new file mode 100644 index 00000000000..6de8e6d4a51 Binary files /dev/null and b/_images/deployment/cloudways/select-application.png differ diff --git a/_images/deployment/cloudways/select-provider.png b/_images/deployment/cloudways/select-provider.png new file mode 100644 index 00000000000..172c09287e2 Binary files /dev/null and b/_images/deployment/cloudways/select-provider.png differ diff --git a/_images/deployment/cloudways/select-server-location.png b/_images/deployment/cloudways/select-server-location.png new file mode 100644 index 00000000000..263a021aca7 Binary files /dev/null and b/_images/deployment/cloudways/select-server-location.png differ diff --git a/_images/deployment/cloudways/select-server-size.png b/_images/deployment/cloudways/select-server-size.png new file mode 100644 index 00000000000..09f537a1aee Binary files /dev/null and b/_images/deployment/cloudways/select-server-size.png differ diff --git a/_images/deployment/cloudways/server-management.png b/_images/deployment/cloudways/server-management.png new file mode 100644 index 00000000000..00a7495f743 Binary files /dev/null and b/_images/deployment/cloudways/server-management.png differ diff --git a/_images/deployment/cloudways/server-timezone-1.png b/_images/deployment/cloudways/server-timezone-1.png new file mode 100644 index 00000000000..2d26a887c04 Binary files /dev/null and b/_images/deployment/cloudways/server-timezone-1.png differ diff --git a/_images/deployment/cloudways/symfony-7.png b/_images/deployment/cloudways/symfony-7.png new file mode 100644 index 00000000000..cdab6e08da3 Binary files /dev/null and b/_images/deployment/cloudways/symfony-7.png differ diff --git a/_images/deployment/cloudways/symfony-8.png b/_images/deployment/cloudways/symfony-8.png new file mode 100644 index 00000000000..ac3491116a0 Binary files /dev/null and b/_images/deployment/cloudways/symfony-8.png differ diff --git a/_images/deployment/cloudways/symfony-home.png b/_images/deployment/cloudways/symfony-home.png new file mode 100644 index 00000000000..a9b1b530ddd Binary files /dev/null and b/_images/deployment/cloudways/symfony-home.png differ diff --git a/_images/deployment/cloudways/symfony-installed.png b/_images/deployment/cloudways/symfony-installed.png new file mode 100644 index 00000000000..f7ca2bd11bb Binary files /dev/null and b/_images/deployment/cloudways/symfony-installed.png differ diff --git a/deployment/cloudways.rst b/deployment/cloudways.rst new file mode 100644 index 00000000000..a156d0b295a --- /dev/null +++ b/deployment/cloudways.rst @@ -0,0 +1,159 @@ +.. index:: + single: Deployment; Deploying to Cloudways Cloud Servers + +Deploying to Cloudways +====================== + +Cloudways is a managed hosting provider for PHP based applications. This step by +step article describes how to install Symfony on Cloudways servers and how to +deploy Symfony applications using Git and SSH. + +Step 1: Prepare your Server and Application +------------------------------------------- + +`Sign up`_ or login to your **Cloudways account** and create a new server by +selecting PHP Stack from the **Select your Application** drop-down. Also, name +your application, server and project accordingly. + +.. image:: /_images/deployment/cloudways/select-application.png + :alt: Select PHP Stack in Drop down + +Step 2: Select a Cloud Provider +----------------------------- + +Now select your favorite cloud provider. You can select any one from the five +providers to install Symfony. + +.. image:: /_images/deployment/cloudways/select-provider.png + :alt: Select cloud Provider + +Step 3: Select Server Size & Location +------------------------------------- + +In the **Server Size** field, scale the server as your requirement (**1GB** +is the minimum recommended size for Symfony applications). + +.. image:: /_images/deployment/cloudways/select-server-size.png + :alt: Select server size + +Keeping the latency difference in mind, now select your server location in the +**Location** field. + +.. image:: /_images/deployment/cloudways/select-server-location.png + :alt: Select server location + +To launch your server, click on the **Launch** button at the bottom right side +of the page. + +.. image:: /_images/deployment/cloudways/launch-server.png + :alt: launch server + +Step 4: Server Timezone +----------------------- + +Once the server is completely launched, set the server timezone, because Symfony +requires to define a valid timezone for PHP. Under **Server Management**, go to +**Settings & Packages.** + +.. image:: /_images/deployment/cloudways/server-management.png + :alt: server management tab + +In the **Basic** tab you can see **PHP Timezone.** Change the server timezone to the +appropriate value according to your location. + +.. image:: /_images/deployment/cloudways/server-timezone-1.png + :alt: Select server timezone + +Step 5: SSH Terminal +-------------------- + +After changing the server timezone, in **Server Management** click on **Launch SSH +Terminal** under **Master Credentials** where you can find your login +credentials for SSH Terminal. + +.. image:: /_images/deployment/cloudways/master-credentials.png + :alt: Cloudways Master Credentials + +Login to SSH with your Master Credentials. + +.. image:: /_images/deployment/cloudways/symfony-7.png + :alt: login to SSH + +Since the application folder contains an ``index.php`` file by default, remove it +from your ``public_html/`` directory executing the ``rm -Rf *`` command. + +Step 6: Symfony Installation +---------------------------- + +Now in your ``public_html/`` directory, run the following command to install +Symfony 3 on your server: + +.. code-block:: terminal + + $ composer create-project symfony/framework-standard-edition your_project_name "3.1.*" + +This command will create a Symfony project in ``public_html/``. You can also +change the version number to install any other Symfony version. + +Step 7: DB Information and Finishing Project Installation +--------------------------------------------------------- + +Now Symfony will start downloading to your server. During downloading, it will +ask for your database information. + +.. image:: /_images/deployment/cloudways/db-info.png + :alt: database information + +You can find out your DB information under **Application Management** go to +**Access detail** and see MySQL Access. + +.. image:: /_images/deployment/cloudways/mysql-access.png + :alt: database information + +After providing database information, you will see the following screen which +means that Symfony has been installed successfully. + +.. image:: /_images/deployment/cloudways/symfony-installed.png + :alt: Final Symfony Installation + +Step 7: Running in Browser +-------------------------- + +After a successful installation, in **Application Management** go to **Access +detail** and copy your Application URL. + +.. image:: /_images/deployment/cloudways/mysql-access.png + :alt: database information + +Open your favorite web browser and access to the "Symfony Welcome page" using +the following URL: http://your_staging_url/web + +This is how the Symfony Welcome page should look like: + +.. image:: /_images/deployment/cloudways/symfony-home.png + :alt: symfony homepage + +Finally your Symfony project is ready for development. + +Deploying From GitHub +====================== + +You can also deploy Symfony applications from GitHub. First, copy the HTTP URL +of the repository: + +.. image:: /_images/deployment/cloudways/http_url.png + :alt: symfony homepage + +Then, open the SSH terminal on Cloudways using Master Credentials as shown in +Step 5. Move to your project folder and run the clone command: + +.. code-block:: terminal + + $ cd application/{your app folder}/public_html + $ git clone https://github.com/username/your-repository.git + +After a successful deployment, change your database credentials in +**parameters.yml**. You can find your database credentials in **Access details** +as stated in step 7. + +.. _`Sign up`: https://platform.cloudways.com/signup