Deploying a PHP/MySQL Application in Cloud (AWS) [closed] - php

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
How to deploy an application (in this case a PHP and MySQL based) in a multiple server environment. To be specific, the application is supposed to be deployed as per below mentioned configuration.
MySQL on Amazon RDS
Application (PHP) on 2 EC2 instances
MySQL part is obvious however I need some clarity on how to deploy the application on 2 servers. I understand that I probably need to setup the application on both EC2 instances and somehow AWS elastic load balancing will automatically balance the load.
Are there any specific configuration/code changes I need to make in the application to work in such an environment? In my case the application would be based on either Cake or Yii. Are they cloud ready by default? If not, what changes, if any, that are needed.
Essentially, I am looking for a guide or instructions which clarifies all such doubts and helps me deploy the application as per above mentioned configuration.

I'm using Capistrano when I deploy my Yii application into multiple ec2 instances.
I think the following article would help :
Deploy PHP Websites Using Capistrano (and Git) | Fred Wu's Blog
http://fredwu.me/post/720733257/deploy-php-websites-using-capistrano-and-git
Then, following would help, when you create your first config file of Capistrano for Yii.
deploy.rb
https://gist.github.com/kix/3913165

Related

How do I "patch" my website without the fear of breaking something? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm developing a website, and im doing it on its final destination domain, not on localhost, and its almost finished.
Now I've come to the point where I'm beginning to get worried about what I do when users start using the site and some problems occur, or maybe I want to add a features to the site.
Is there any best practices which will allow be to minimize risks ruinin website and customer UX during updates, how to do it correctly?
If your website is small and easy:
Create a development domain/subdomain
Code and test there
Record all database structure changes (do database changes on a db copy)
Record your actions you use to test your website
As soon as you are ready to release a new version there are two options:
Update db replica and switch domains
Turn main domain off, update code and db, turn on
If website is not that easy, there should be local development, testing, staging and production environments set up independendly. You dev, then you test what you did, then you copy and install your code on real data before pushing it live on production.
To track changes and easily deploy new version to each of environments there are many tools connected with version control systems like git
And there is a good answer on how to use dev-test-stage-production environments with git: git with development, staging and production branches
First of all you have to work on localhost, while developing any new feature, of fixing a bug.
I recommend you also to use GIT branches, so you can create a new branch to add feature of fix a bug.
After finish use GIT merge with your website master branch

Recommended Method to Deploy Different Configurations [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
within a PHP project, what would be the recommended way of creating configuration files and reading them within the app; configuration files that would be deployed with different content to staging vs. production servers for instance.
I would recommend looking at how the Symfony project injects Parameters for different systems. Symfony's Config Component can be installed as a standalone library and integrated with most projects.
A default parameters.yml.dist is distributed with the codebase but upon system install customised parameters.yml can either be generated manually on the command line or automatically using a deployment process. This avoids holding sensitive and mutable infrastructure information in your codebase.
Symfony Introduction to Parameters
Symfony Config Parameters Best Practices
Combining this with a docker & vagrant setup will enable configuration options to be mirrored across your environment platforms (production, development, testing). A good tutorial on doing this for PHP frameworks can be found here.

How to connect code base for a team of developers working on a project running on a VPS? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
What is the best way to connect a team of developers working on a project which runs on a VPS, We have Mac and windows development Environement and VPS is Based on CENT OS?
I am totally newbie at creating a shared codebase.
I am laravel, ionic, javascript, angular and node developer.
The ease of doing this is nearly zero when we have to continuously change code and multiple people have to update different script files on the Project from Mac and Windows development environment.
We use the later described technology, we want to connect to the servers and the code that is written should reflect on the servers. Right now we have to copy all the code and than paste it on the servers?
Should we go for SVN or GIT, and how to execute the Shared code base Environment?
Develop locally
You definitely have to go with git to synchronize your code between all developers.
Git will ease most of the synchronization / merging work. All you have to do is to get familiar with it and its workflow. I know it can seem a lot at first but since every company is using it, it's not a waste of time.
Each developer works on his own machine (localhost) and commits / pushes to git when it's working properly. Other developers pull the changes to get new updates from the other developers on the team.
Don't shy away from using branch system to work simultaneously on different features / part of you app and pull requests to review code of other developers.
Worry about deploying to the VPS later: setup your git repository (github, bitbucket) and work locally.
Deploy later
Then, once you've reached a working version of your app/website, you can push your code to the VPS server using git as well and make it available to all for testing. You have to have SSH access on it.

What are some efficient ways to set up my environment when working on a remote site? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Hello fellow Programmers,
I am still a relatively new programmer and have recently gotten my first on-campus programming position. I am the sole dev responsible for 8 domains as well as 3 small sized PHP web apps.
The campus has its web environment divided into staging and live servers -- we develop on the staging via SFTP and then push the updates to the live server through a web GUI.
I use Sublime Text 2 and the Sublime SFTP plugin currently for all my dev work (its my preferred editor). If I am just making an edit to a page I'll open that individual file via the ftp browser. If I am working on the PHP web app projects, I have the app directory mapped to a local folder so that when I save locally the file is auto-uploaded through Sublime SFTP.
I feel like this workflow is slow and sub-optimal. How can I improve my workflow for working with remote content? I'd love to set up a local environment on my machine as that would eliminate the constant SFTP upload/download, but as I said there are many sites and the space required for a local copy of the entire domain would be quite large and complex; not to mention keeping it updated with whatever the latest on the staging server is would be a nightmare.
Anyone know how I can improve my general web dev workflow from what I've described? I'd really like to cut out constantly editing over FTP but I'm not sure where to start other than ripping the entire directory and dumping it into XAMP.
Are you using source code control? If not, you should. I suggest using Git, for example hosted on Github.
For a simple setup like this you don't need to use any special deployment tools; you can also use Git for deployment.
Developing directly on the staging server is not a great idea. Try to set up a development environment environment on your laptop.
You can push from your development machine to Github. Then then on either staging or the live server you can connect via ssh and pull from Github.
This allows you you to use all the power of Git to create branches and tags and to rollback to an earlier version if you make a mistake.

Web Development Work flow using git [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm managing a team of 4 developers. We develop CMS based sites on a PHP / MySQL backend.
I want to improve the workflow. What i want:
Are there any services that host a git repo and sync it automatically with the servers?
Production server would be master branch
Testing server would be a different branch
we deal with many small sites and some large so we need workflow to be fast and agile
WHAT ABOUT THE DATABASE ? lol
(if anyone wants to add to the diagram PSD file can be found here: workflow.psd
I'd highly suggest using Beanstalk if you want something quick and easy to set up. It handles deployments very well. If you're looking at doing a bit more yourself (setting up the hooks and such) then another option would be github.
Please do not user Master as your production branch, master should never be production. A better workflow would be to have a Staging, Development, and Production branch / environment. Please see this guide about branching on Beanstalk's guides, it's pretty insightful.
As for keeping track of databases, if your framework / cms doesn't support database migration I'd highly suggest developing some form of migration / database version control in-house. You can also check out a framework like FuelPHP, which has migration built in. A nice little database version control system I found while poking around : dbv.php.

Categories