Quick install script for Codeanywhere PHP Container. Quick download and install of MODX Revolution.
Simply copy and paste the below script into your SSH terminal. This is intended for a Codeanywhere container which uses a standard user 'cabox', Apache running as www-data, and a 'workspace' directory acting as your web root.
wget https://raw.githubusercontent.com/jaredfhealy/codeanywhere-modx-install/main/ca-install.sh \
&& chmod +x ca-install.sh \
&& ./ca-install.sh \
&& rm ca-install.sh
- This will download the install shell script with 'wget'
- It will modify the script so it can be executed
- Then the install script itself is run
- And after completion, it removes itself
At point 3 above, the install script does the following:
- Prompts you for 3 inputs:
- Modx Version: Defaulted to the latest at this time [2.8.1]
- Database Name: Defaulted to 'cabox'
- Database User: Defaulted to 'cabox'
- Database Password: Defaulted to 'cabox'
- For any of the parameters, hit enter to accept the defaults.
- NOTE: This is intended as a quick development instance that is not "always on" and does not have a high risk of attack.
- It then changes directories to the ~/workspace directory just in case this is executed from elsewhere.
- Next we download the specified version from the modx s3 releases
- Unzip all files and move to the web root "workspace"
- Remove the temporary directory and zip file download
- Create the database, user, and grant privileges
- Copy the ht.access files to .htaccess in root, /core/ and /manager/ to allow frienly URLs and prevent core from being web accessible.
- Prompt if you want to run the CLI install. If you hit enter to accept the default 'Y', it will proceed to the next step, otherwise we end here.
- Launch the included Modx cli-install.php process
- Enter the same values that you specified above for Database, Username, and Password.
- Create the desired Admin username/password
- Accept default parameters or adjust as needed
- Set the default unmask value for apache2 to 002
- This allows both the Codeanywhere editor and Modx to create and write to files since the cabox user is in the www-data group.