Open main menu

CDOT Wiki β

Changes

OPS705 Assignment 2

No change in size, 21:42, 29 March 2023
Task 3: Wordpress Source Code Modification
= Task 3: Wordpress Source Code Modification =
'''Explanation:''' From your work with Wordpress in Assignment 1, you know you can simply upload the source code and the first time you load the webpage, you'll be asked for database connector information. However, Elastic Beanstalk applications are meant to be disposable. In A1, when you were adding that database connector info, it was being saved in a file called ''wp-config.php''. This is fine for that kind of setup, but in Elastic Beanstalk, changes made to static HTML or PHP ''are not saved it the Beanstalk application restarts'', which it will do often. Whenever the application restarts, it will load from the source zip file. If you did as in A1, you'd have to constantly re-enter your DB connector info every time you started up your Learner Lab environment.
 
We ''could'' add the DB connector info to '''wp-config.php''' manually before we upload the source code, but there's a much better way. We use environment variables to allow us to put all the info in the Elastic Beanstalk application wizard. That way, every time the application restarts and reloads from the source code zip, it'll then read our connector information from AWS. Read below for details and steps.
== Download and Unzip - Local Computer ==
== Modify Wordpress Configuration File ==
'''Explanation:''' From your work with Wordpress in Assignment 1, you know you can simply upload the source code and the first time you load the webpage, you'll be asked for database connector information. However, Elastic Beanstalk applications are meant to be disposable. In A1, when you were adding that database connector info, it was being saved in a file called ''wp-config.php''. This is fine for that kind of setup, but in Elastic Beanstalk, changes made to static HTML or PHP ''are not saved it the Beanstalk application restarts'', which it will do often. Whenever the application restarts, it will load from the source zip file. If you did as in A1, you'd have to constantly re-enter your DB connector info every time you started up your Learner Lab environment.
 
We ''could'' add the DB connector info to '''wp-config.php''' manually before we upload the source code, but there's a much better way. We use environment variables to allow us to put all the info in the Elastic Beanstalk application wizard. That way, every time the application restarts and reloads from the source code zip, it'll then read our connector information from AWS. Read below for details and steps.
=== Duplicate and Open Configuration File ===