{"id":6,"date":"2015-04-28T17:40:12","date_gmt":"2015-04-28T17:40:12","guid":{"rendered":"https:\/\/staff.fnwi.uva.nl\/b.terwijn\/?page_id=6"},"modified":"2017-03-21T18:48:45","modified_gmt":"2017-03-21T18:48:45","slug":"wordpress-install","status":"publish","type":"page","link":"https:\/\/staff.fnwi.uva.nl\/b.terwijn\/wordpress-install\/","title":{"rendered":"WordPress Install"},"content":{"rendered":"<p>This page describes WordPress installation on the\u00a0staff.fnwi.uva.nl server. Because it involves personal websites no official support can be given, but feel free to ask questions if you experience problems. You are required to update WordPress when updates are available in the Dashboard panel to avoid security risks on the server.<br \/>\n<code><br \/>\n<strong># login<\/strong><br \/>\nssh &lt;UVANETID&gt;@staff.fnwi.uva.nl<\/p>\n<p><strong># rename the existing website dir<\/strong><br \/>\nmv WWW WWW_`date +%Y-%m-%d-%H:%M:%S`<br \/>\numask_old=`umask`<br \/>\numask 002 # this sets group-write permission and sgid bit<br \/>\nmkdir WWW<br \/>\numask $umask_old<br \/>\ncd WWW<\/p>\n<p><strong># get latest version of wordpress<\/strong><br \/>\nwget https:\/\/wordpress.org\/latest.zip<br \/>\nunzip latest.zip<br \/>\ncp -r wordpress\/* .\/ \u00a0 \u00a0 # trick to set group to 'apache'<br \/>\nrm -rf wordpress<\/p>\n<p><strong># getting some essential plugins<\/strong><br \/>\ncd wp-content\/plugins<br \/>\n<strong># database plugin so we don't require a MySQL account<\/strong><br \/>\n<strong> # download: https:\/\/wordpress.org\/plugins\/sqlite-integration\/ (use latest version!)<\/strong><br \/>\nwget https:\/\/downloads.wordpress.org\/plugin\/sqlite-integration.1.8.1.zip<br \/>\nunzip sqlite-integration.1.8.1.zip<br \/>\ncp .\/sqlite-integration\/db.php ..<br \/>\n<strong># enable ssh connection to install\/update themes,plugins and upgrade wordpress<\/strong><br \/>\n<strong> # download: https:\/\/wordpress.org\/plugins\/ssh-sftp-updater-support\/ (use latest version!)<\/strong><br \/>\nwget https:\/\/downloads.wordpress.org\/plugin\/ssh-sftp-updater-support.0.5.zip<br \/>\nunzip ssh-sftp-updater-support.0.5.zip<\/p>\n<p><strong># create some dirs<\/strong><br \/>\nmkdir -p ..\/tmp\/<br \/>\nmkdir -p ..\/uploads\/<br \/>\nmkdir -p ..\/upgrade\/<br \/>\n<strong># create dir where the database is stored in<\/strong><br \/>\nmkdir -p $HOME\/wordpress-db<br \/>\nchmod g+w $HOME\/wordpress-db<\/p>\n<p><strong># commands to write 'wp-config-sample.php' to 'wp-config.php', the <\/strong><br \/>\n<strong># main wordpress configuration file<\/strong><br \/>\n<strong># normally done by hand but this saves time<\/strong><br \/>\ncd ..\/..\/<br \/>\nlinenr=`grep -nr \"define('DB_COLLATE'\" wp-config-sample.php | cut -d : -f 1`<br \/>\nhead -n $linenr wp-config-sample.php &gt; wp-config.php<br \/>\necho \"\" &gt;&gt; wp-config.php<br \/>\necho \"\/\/ using sqlite database instead of mysql\" &gt;&gt; wp-config.php<br \/>\necho \"define('DB_FILE', 'sqlite.db');\" &gt;&gt; wp-config.php<br \/>\necho \"define('DB_DIR', '$HOME\/wordpress-db');\" &gt;&gt; wp-config.php<br \/>\necho \"define('WP_TEMP_DIR', ABSPATH . 'wp-content\/tmp\/');\" &gt;&gt; wp-config.php<br \/>\nlinenr2=`grep -nr \"define('AUTH_KEY',\" wp-config-sample.php | cut -d : -f 1`<br \/>\nlinenr2=`expr $linenr2 - 1`<br \/>\nlinenr=`expr $linenr + 1`<br \/>\nsed -n \"$linenr,${linenr2}p\" wp-config-sample.php &gt;&gt; wp-config.php<br \/>\nwget https:\/\/api.wordpress.org\/secret-key\/1.1\/salt<br \/>\ncat salt &gt;&gt; wp-config.php<br \/>\nrm salt<br \/>\necho \"\" &gt;&gt; wp-config.php<br \/>\nlinenr=`grep -nr \"\/**#\\@-\" wp-config-sample.php | cut -d : -f 1`<br \/>\ntail --lines=+$linenr wp-config-sample.php &gt;&gt; wp-config.php<\/p>\n<p><strong># this creates the 'fix_wp-content' script as workaround for setting proper group, <\/strong><br \/>\n<strong># group-write permission, and sgid bit on all files and directories in wp_content<\/strong><br \/>\n<strong># run this script when experiencing problems when uploading or updating <\/strong><br \/>\n<strong># and when all is ok remove the\u00a0'wp-content_remove_when_all_ok*' dir afterwards<\/strong><br \/>\necho '#!\/bin\/bash' &gt; fix_wp-content<br \/>\necho \"#Script to set group-write bit, SGID bit and set owner to $USER.apache recursively for dir wp-content\" &gt;&gt; fix_wp-content<br \/>\necho \"#\" &gt;&gt; fix_wp-content<br \/>\necho \"umask 002\" &gt;&gt; fix_wp-content<br \/>\necho \"find wp-content\/ -type d -exec mkdir tmp_{} \\; -exec bash -c \\\"cp {}\/* tmp_{}\/ 2&gt; \/dev\/null\\\" \\;\" &gt;&gt; fix_wp-content<br \/>\necho \"mv wp-content wp-content_remove_when_all_ok_\\`date +%Y-%m-%d-%H:%M:%S\\`\" &gt;&gt; fix_wp-content<br \/>\necho \"mv tmp_wp-content wp-content\" &gt;&gt; fix_wp-content<br \/>\nchmod +x fix_wp-content<\/p>\n<p><strong># now run the workaround script to fix 'wp-content'<\/strong><br \/>\nbash fix_wp-content<br \/>\n<strong># check if all is ok, for example the new 'wp-content' dir should have<\/strong><br \/>\n<strong># approximately the same size as the old:<\/strong><br \/>\ndu -s wp-content*<br \/>\n<strong># When all ok remove the 'wp-content_remove_when_all_ok*' dir<\/strong><br \/>\n<strong># (to save disk space) at your own responsibility using:<\/strong><br \/>\n# rm -rf wp-content_remove_when_all_ok*<\/p>\n<p><strong># now open this link in your webbrowser and follow the instructions:<br \/>\n# where &lt;YOUR-EMAIL-NAME&gt; is the name in your @uva.nl email address<\/strong><br \/>\nhttps:\/\/staff.fnwi.uva.nl\/&lt;YOUR-EMAIL-NAME&gt;\/wp-admin\/install.php<\/p>\n<p><strong># after logging in to your website activate 'ssh-sftp-updater-support' plugin<\/strong><br \/>\n- click 'Dashboard' (pull-down menu right from \"W\" top left)<br \/>\n- click 'Plugins'<br \/>\n- click 'Activate' of ssh-sftp-updater-support<\/p>\n<p><strong># test install other plugin<\/strong><br \/>\n- click 'Plugins'<br \/>\n- click 'Add new'<br \/>\n- search 'disable comments' (prevents people from leaving comments on website)<br \/>\n- click 'Install Now' of 'Disable Comments' plugin<br \/>\n- use ssh connection with:<br \/>\nhostname: staff.fnwi.uva.nl<br \/>\nusername: &lt;UVANETID&gt;<br \/>\npassword: &lt;UVANETID-PASSWORD&gt;<br \/>\nConnection Type: ssh2<br \/>\n- click 'activate'<br \/>\n- click 'settings'<br \/>\n- click 'Everywhere'<br \/>\n- click 'Save Changes'<br \/>\n<strong><br \/>\n# if this works uploading and updating works<br \/>\n# in case of later problems first run the 'fix_wp-content' workaround script above<\/strong><br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This page describes WordPress installation on the\u00a0staff.fnwi.uva.nl server. Because it involves personal websites no official support can be given, but feel free to ask questions if you experience problems. You are required to update WordPress when updates are available in the Dashboard panel to avoid security risks on the server. # login ssh &lt;UVANETID&gt;@staff.fnwi.uva.nl # [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/staff.fnwi.uva.nl\/b.terwijn\/wp-json\/wp\/v2\/pages\/6"}],"collection":[{"href":"https:\/\/staff.fnwi.uva.nl\/b.terwijn\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/staff.fnwi.uva.nl\/b.terwijn\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/staff.fnwi.uva.nl\/b.terwijn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/staff.fnwi.uva.nl\/b.terwijn\/wp-json\/wp\/v2\/comments?post=6"}],"version-history":[{"count":28,"href":"https:\/\/staff.fnwi.uva.nl\/b.terwijn\/wp-json\/wp\/v2\/pages\/6\/revisions"}],"predecessor-version":[{"id":409,"href":"https:\/\/staff.fnwi.uva.nl\/b.terwijn\/wp-json\/wp\/v2\/pages\/6\/revisions\/409"}],"wp:attachment":[{"href":"https:\/\/staff.fnwi.uva.nl\/b.terwijn\/wp-json\/wp\/v2\/media?parent=6"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}