Open main menu

CDOT Wiki β

Changes

OPS705 Assignment 2

20 bytes added, 21:52, 29 March 2023
m
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''on the webserver VM. This is fine for that kind of setup, but in Elastic Beanstalk, changes made to static HTML or PHP ''are not saved it if 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.