P2Pvalue / p2pvalue-website-code

Source code of the main P2Pvalue website (http://p2pvalue.eu/). Powered by Drupal (https://www.drupal.org).
GNU General Public License v2.0
2 stars 2 forks source link

Deploy new version #6

Closed drozas closed 9 years ago

drozas commented 9 years ago

This is a list of tasks to deploy the new version of the site to the CRESS server.

drozas commented 9 years ago

TO-DO

drozas commented 9 years ago

E-mail sent: Dear all,

We are working on an update of the main P2Pvalue website (http://p2pvalue.eu/) to include a video and audio podcast, as well as some other minor fixes. In order to speed up the process, we will be working directly with a local version using a current dump of the database (which includes contents + configuration), and then send it for deployment to the production server, so we don't need to repeat the configuration again, and keeping the production site online. Therefore, please let us know if you are planning to add new contents (e.g. a new blog post) during the forthcoming days, so we can track them down and re-import it into the new version.

We will send you a new e-mail informing you once the new version of the website has been deployed. Apologies for any possible inconveniences.

Kind Regards,

David

drozas commented 9 years ago

TO-DO:

drozas commented 9 years ago

Done and sent (extract):

Please, find below the steps. I have already created a backup of the DB in the production site (automatic backups are also created daily via cron).

Remove all the files from the p2pvalue directory server with the exception of the following (e.g. by moving them to a temporary folder, and deleting the whole site from the root):
    sites/default/settings.php
    sites/default/files (including all subfolders and site within it).
Deploy the new version of the code (you can download it from: https://github.com/P2Pvalue/p2pvalue-website-code/archive/master.zip)
Restore back the settings and files folder to its previous place:
    sites/default/settings.php
    sites/default/files (including all subfolders and site within it).
Create a new .htaccess file in the sites/default/files folder, with the following content:

Turn off all options we don't need.

Options None Options +FollowSymLinks

Set the catch-all handler to prevent scripts from being executed.

SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 <Files *>

Override the handler again if we're run later in the evaluation list.

SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003

If we know how to do it safely, disable the PHP engine entirely.

php_flag engine off
Create a new .htaccess file in the sites/default/files/private folder, with the following content:

Turn off all options we don't need.

Options None Options +FollowSymLinks

Set the catch-all handler to prevent scripts from being executed.

SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 <Files *>

Override the handler again if we're run later in the evaluation list.

SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003

If we know how to do it safely, disable the PHP engine entirely.

php_flag engine off

Deny from all

Connect with the P2Pvalue website database, and delete all the tables (I use drush for this, but I am not sure what is exactly installed in the CRESS server, so that is the reason I do not specify the commands).
Import the attached dump into the clean database (P2PValue_local_to_deploy-1423234374-2015-02-06T14-52-54.tar.gz). Again, I use drush for this, but I am not sure what is exactly installed in the CRESS server.
Increase the max_file_size and other parameters in the php.ini (either in the site or globally), to allow a bigger size to upload the video files (Chris estimated that the maximum should be around 500MB). I am not sure where this file is located in Mac (this might help - http://topicdesk.com/faqs/os-x-server-web-services-faq/83-how-can-i-change-the-maximum-file-upload-size-for-php-applications), but the changes could be as follows:

Change upload limits

php_value memory_limit 512M php_value post_max_size 512M php_value upload_max_filesize 512M php_value max_execution_time 600

Reboot Apache (to ensure the new values for PHP are set).

And that should be all!

To ensure all the changes are properly done, login into the site as administrator (your account has an admin role) and:
    Flush all caches: http://www.p2pvalue.eu/p2pvalue-website-code/admin/config/development/performance
    Check the status report (should be similar to the one I attached in a couple of screenshots): http://www.p2pvalue.eu/admin/reports/status (the error regarding the video.js library can be ignored, since it is configured to get it directly from a CDN).
Since the deployment process has been done from the scratch, there should not be any issue with the permissions. However, in case there are any, please follow the instructions at https://www.drupal.org/node/244924 (Linux servers - adapting the commands to Mac), as you did in previous deployments.
drozas commented 9 years ago

TO-DO: