Skip to content

Added deployment Steps on Cloudways #7433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added _images/deployment/cloudways/db-info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/deployment/cloudways/launch-server.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/deployment/cloudways/mysql-access.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/deployment/cloudways/select-provider.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/deployment/cloudways/symfony-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/deployment/cloudways/symfony-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/deployment/cloudways/symfony-home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
138 changes: 138 additions & 0 deletions deployment/cloudways.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
.. 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prepare Your Server and Application

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we really add the step numbers in the headlines? This will require a lot of work when steps are not necessary any more in the future or new steps are to be added.

-------------------------------------------

`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 Cloud Provider
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Select a Cloud Provider

-----------------------------

Now select your favorite cloud provider. You can select any one from the five
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we just write "Select your favorite cloud provider from the list of available providers."? This way we won't have to update the article every time a new provider gets added.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xabbuh there is no plan to add more providers yet. so I am changing the line as you say.

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 **Basic** tab you can see **PHP Timezone.** Change the server timezone to the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In 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 server timezone, in **Server Management** click on **Launch SSH
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[...] changing the server [...]

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 a ``index.php`` fie by default, remove it
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[...] an index.php file [...]

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_application_url/your_project_directory/web
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks wrong to me that you store your entire project in the publicly accessible document root. Is this really the way to go with Cloudways?

Copy link
Author

@shahroznawaz shahroznawaz Feb 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it should be http://your_staging_url/web. i am updating it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But that would still mean that all your project files will be publicly available.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xabbuh No only Web directory is Publicly accessible. Rest are Private.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I don't understand why I should append the /web path.


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.

.. _`Sign up`: https://platform.cloudways.com/signup