{"id":19,"date":"2014-10-12T17:02:24","date_gmt":"2014-10-12T17:02:24","guid":{"rendered":"http:\/\/adrhc.go.ro\/wordpress\/?p=19"},"modified":"2018-02-28T17:01:28","modified_gmt":"2018-02-28T15:01:28","slug":"install-configure-wordpress","status":"publish","type":"post","link":"https:\/\/adrhc.go.ro\/blog\/install-configure-wordpress\/","title":{"rendered":"Install &#038; configure wordpress"},"content":{"rendered":"<pre class=\"brush:bash shell\">\r\n#Install & configure wordpress:\r\ncd \/i-data\/md0\/www\/pages\r\nrm -r wordpress\r\nwget https:\/\/wordpress.org\/latest.zip\r\nunzip latest.zip && rm -r latest.zip\r\nchown -R nobody:nobody \/i-data\/md0\/www\/pages\/wordpress\/\r\n\r\nmysql -p\r\nCREATE DATABASE wordpress CHARACTER SET utf8;\r\nGRANT ALL ON wordpress.* TO 'wordpress'@'%' IDENTIFIED BY 'wordpress' WITH GRANT OPTION;\r\nFLUSH PRIVILEGES;\r\nexit;\r\n\r\n# SQL optimizations:\r\n#\r\n# SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes'\r\nADD INDEX `autoload` (`autoload`);\r\n#\r\n# SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID FROM wp_posts  \r\n# WHERE 1=1  AND wp_posts.post_type = 'post' \r\n# AND (wp_posts.post_status = 'publish')  \r\n# ORDER BY wp_posts.post_date DESC LIMIT 10, 10;\r\nADD INDEX `type_status_date` (`post_type` ASC, `post_status` ASC, `post_date` ASC);\r\n#\r\n# SELECT ID, post_name, post_parent, post_type FROM wp_posts \r\n# WHERE post_name IN ('pyload-setup') AND post_type IN ('page','attachment');\r\nALTER TABLE `wordpress`.`wp_posts` \r\nDROP INDEX `post_name` ,\r\nADD INDEX `post name type` (`post_name`(191) ASC, `post_type` ASC);\r\n#\r\n# SELECT wp_posts.* FROM wp_posts WHERE 1=1  AND wp_posts.post_parent = 19  \r\n# AND wp_posts.post_type = 'revision' AND ((wp_posts.post_status = 'inherit'))  \r\n# ORDER BY wp_posts.post_date DESC, wp_posts.ID DESC;\r\nALTER TABLE `wordpress`.`wp_posts` \r\nDROP INDEX `post_parent` ,\r\nADD INDEX `post_parent_type_status` (`post_parent` ASC, `post_type` ASC, `post_status` ASC);\r\n\r\n#Use https:\/\/adrhc.go.ro\/wordpress\/wp-admin\/theme-editor.php to edit.\r\n#Comment in \/i-data\/md0\/www\/pages\/wordpress\/wp-content\/themes\/twentyfourteen\/style.css any:\r\n\tmax-width: 1260px;\r\n\tmax-width: 474px;\r\n#Modify \/i-data\/md0\/www\/pages\/wordpress\/wp-content\/themes\/twentyfourteen\/style.css to this:\r\n\t.page-content {\r\n\t\tbackground-color: #fff;\r\n\t\t\/*padding: 12px 10px 0;*\/\r\n\t}\r\n\t.site-content .entry-header {\r\n\t\tbackground-color: #fff;\r\n\t\t\/*padding: 0 10px 12px;*\/\r\n\t}\r\n\t.content-area {\r\n\t\t\/*padding-top: 48px;*\/\r\n\t}\r\n\t@media screen and (min-width: 846px) {\r\n\t\t.content-area,\r\n\t\t.content-sidebar {\r\n\t\t\t\/*padding-top: 72px;*\/\r\n\t\t\tpadding-top: 5px;\r\n\t\t}\r\n\t\/*p {\r\n\t\tmargin-bottom: 24px;\r\n\t}*\/\r\n\tpre {\r\n\t\tborder: 1px solid rgba(0, 0, 0, 0.1);\r\n\t\t-webkit-box-sizing: border-box;\r\n\t\t-moz-box-sizing:    border-box;\r\n\t\tbox-sizing:         border-box;\r\n\t\t\/*margin-bottom: 24px;*\/\r\n\t\tmax-width: 100%;\r\n\t\toverflow: auto;\r\n\t\tpadding: 12px;\r\n\t\twhite-space: pre;\r\n\t\twhite-space: pre-wrap;\r\n\t\tword-wrap: break-word;\r\n\t}\r\n\t.site-content footer.entry-meta {\r\n\t\t\/*margin: 24px auto 0;*\/\r\n\t\tmargin: 0 auto 10px;\r\n\t\tpadding: 0 10px;\r\n\t}\r\n\t.hentry {\r\n\t\t\/*margin: 0 auto 48px;*\/\r\n\t\tmax-width: 672px;\r\n\t}\r\n\t.list-view .site-content .hentry {\r\n\t\tborder-top: 1px solid rgba(0, 0, 0, 0.1);\r\n\t\t\/*padding-top: 48px;*\/\r\n\t\tpadding-top: 10px;\r\n\t}\r\n\r\n#Use notepadd++ for these below to edit.\r\n#Modify \/i-data\/md0\/www\/pages\/wordpress\/wp-content\/themes\/twentyfourteen\/css\/editor-style.css to this:\r\n\thtml .mceContentBody {\r\n\t\tfont-size: 100%;\r\n\t\t\/*max-width: 474px;*\/\r\n\t}\r\n#Modify \/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-includes\/css\/editor.min.css to this:\r\n\t.wp-editor-container{clear:both;width:100%!important}\r\n\r\n#Use https:\/\/adrhc.go.ro\/wordpress\/wp-admin\/theme-editor.php to edit.\r\n#Modify \/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-content\/themes\/twentyfourteen\/header.php and add:\r\n&lt;link rel=\"shortcut icon\" type=\"image\/x-icon\" href=\"\/wordpress\/favicon.ico\">\r\ncp -v \/i-data\/60cb70cf\/www\/pages\/resources\/wordpress_favicon.ico \/i-data\/60cb70cf\/www\/pages\/wordpress\r\n#Add following in your theme\u2019s functions.php file, or into a custom plugin:\r\n#\/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-content\/themes\/twentyfourteen\/functions.php:\r\nfunction show_favicon() {\r\n\techo '&lt;link href=\"\/wordpress\/favicon.ico\" rel=\"icon\" type=\"image\/x-icon\">';\r\n}\r\nadd_action('admin_head', 'show_favicon');\r\n\r\n#syntaxhighlighter text wrap (but lines number won't show ok)\r\ngrep -A 3 -B 3 -r \"syntaxhighlighter table td.code .line\" \/i-data\/md0\/www\/pages\/wordpress\/wp-content\/plugins\/syntax-highlighter-mt\/styles\/*.css\r\nfind \/i-data\/md0\/www\/pages\/wordpress\/wp-content\/plugins\/syntax-highlighter-mt\/styles -name \"*.css\" -exec sed -i s\/\"syntaxhighlighter table td\\.code \\.line [\\{]\"\/\"syntaxhighlighter table td.code .line {white-space: pre-wrap \\!important;word-wrap: break-word \\!important;\"\/ {} \\;\r\n\r\n#Modify wordpress\/wp-config.php:\r\ndefine( 'DISALLOW_FILE_EDIT', true ); -> disables the Plugin and Theme editor \r\n\/\/ define( 'DISALLOW_FILE_MODS', true ); -> disables the Plugin and Theme Update and Installation\r\ndefine('DB_NAME', 'wordpress'); -> The name of the database for WordPress\r\n\r\n#Disable redirect for index.php to \/ by modifying\r\n#\/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-includes\/canonical.php:\r\n\/\/ add_action('template_redirect', 'redirect_canonical');\r\n...\r\n\/\/ add_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );\r\n\r\n#Plugins to install:\r\n#Akismet\r\n#OPcache Dashboard\r\n#WP Content Filter\r\n#WP-ServerInfo\r\n#Syntax Highlighter MT\r\n\r\n#APCu Object Cache Backend -> plugin as drop-in (don't install; it logging you off continuously)\r\nmv -v \/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-content\/plugins\/apcu\/object-cache.php \/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-content\r\n\r\n#Advanced Caching -> plugin as drop-in (don't install it, it's obsolete, 7 years old)\r\nmv -v \/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-content\/plugins\/advanced-caching\/advanced-caching.php \/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-content\r\n\r\n#Plugin WP APC Panel (dupa patch-urile de jos il copii in \/public\/wp-apc-panel-apc.php)\r\ncp -v \/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-content\/plugins\/wp-apc-panel\/include\/apc.php \/i-data\/60cb70cf\/www\/pages\/public\/wp-apc-panel-apc.php\r\n#ERROR1:\r\n\tPHP Notice:  Undefined index: page in \/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-content\/plugins\/wp-apc-panel\/wp_apc_panel.php on line 30\r\n#SOLUTION1:\r\n\t\/*\r\n\t\techo '&lt;div name****>';\r\n\t\techo 'is_user_logged_in = ' . is_user_logged_in() . '&lt;br>';\r\n\t\techo 'in_array = ' . in_array( 'administrator', $user->roles ) . '&lt;br>';\r\n\t\tvar_dump($_GET);\r\n\t\techo '&lt;br>';\r\n\t\techo 'array_key_exists = ' . array_key_exists('page', $_GET) . '&lt;br>';\r\n\t\techo 'page = ' . isset( $_GET['page'] );\r\n\t\techo '&lt;\/div>';\r\n\t*\/\r\n\tif( is_user_logged_in() &&\t\t\t\t-> existing line\r\n\t\tin_array( 'administrator', $user->roles ) &&\t-> existing line\r\n\t\tisset( $_GET['page'] ) &&\r\n\t\t$_GET['page'] == 'wp-apc-panel-page' &&\t\t-> existing line\r\n#ERROR2:\r\n\tNotice: Undefined index: expunges in \/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-content\/plugins\/wp-apc-panel\/include\/apc.php on line 832\r\n\tNotice: Undefined index: expunges in \/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-content\/plugins\/wp-apc-panel\/include\/apc.php on line 853\r\n\tNotice: Undefined index: expunges in \/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-content\/plugins\/wp-apc-panel\/include\/apc.php on line 866\r\n#SOLUTION2 (modify \/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-content\/plugins\/wp-apc-panel\/include\/apc.php):\r\n\tNotice: Undefined index: expunges in \/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-content\/plugins\/wp-apc-panel\/include\/apc.php on line 832\r\n\t\t$locking_type = isset($cache['locking_type']) ? $cache['locking_type'] : 'no';\r\n\t\techo &lt;&lt;&lt;EOB\r\n\t\t\t&lt;tr class=tr-0>&lt;td class=td-0>Shared Memory&lt;\/td>&lt;td>{$mem['num_seg']} Segment(s) with $seg_size \r\n\t\t&lt;br\/> ({$cache['memory_type']} memory, $locking_type locking)\r\n\tNotice: Undefined index: expunges in \/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-content\/plugins\/wp-apc-panel\/include\/apc.php on line 853,\r\n\tNotice: Undefined index: expunges in \/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-content\/plugins\/wp-apc-panel\/include\/apc.php on line 866\r\n\t\t$cache_expunges = isset($cache['expunges']) ? $cache['expunges'] : '0';\r\n\t\t$cache_user_expunges = isset($cache_user['expunges']) ? $cache_user['expunges'] : '0';\r\n\t\techo &lt;&lt;&lt;EOB\r\n\t\t\t...\r\n\t\t\t&lt;div class=\"info div1\">&lt;h2>File Cache Information&lt;\/h2>\r\n\t\t\t...\r\n\t\t\t&lt;tr class=tr-1>&lt;td class=td-0>Cache full count&lt;\/td>&lt;td>$cache_expunges&lt;\/td>&lt;\/tr>\r\n\t\t\t...\r\n\t\t\t&lt;tr class=tr-1>&lt;td class=td-0>Cache full count&lt;\/td>&lt;td>$cache_user_expunges&lt;\/td>&lt;\/tr>\r\n#ERROR3:\r\n\tNotice: Undefined index: filename in \/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-content\/plugins\/wp-apc-panel\/include\/apc.php on line 1131\r\n#SOLUTION3:\r\n\t} else {\r\n\t\t$entry_fieldname = isset($entry[$fieldname]) ? $entry[$fieldname] : 'no ' . $fieldname;\r\n\t\t$list[$k.$entry_fieldname]=$entry;\r\n\t\t\/\/ $list[$k.$entry[$fieldname]]=$entry;\r\n\t}\r\n#ERROR4:\r\n\tNotice: Undefined index: filename in \/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-content\/plugins\/wp-apc-panel\/include\/apc.php on line 1150\r\n#SOLUTION4:\r\n\t$entry_fieldname = isset($entry[$fieldname]) ? $entry[$fieldname] : 'no ' . $fieldname;\r\n\tif(!$MYREQUEST['SEARCH'] || preg_match($MYREQUEST['SEARCH'], $entry_fieldname) != 0) {  \r\n        \t$field_value = htmlentities(strip_tags($entry_fieldname,''), ENT_QUOTES, 'UTF-8');\r\n#ERROR5:\r\n\tNotice: Undefined index: mtime in \/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-content\/plugins\/wp-apc-panel\/include\/apc.php on line 1158\r\n#SOLUTION5:\r\n\t$entry_mtime = isset($entry['mtime']) ? date(DATE_FORMAT,$entry['mtime']) : '-';\r\n\t...\r\n\t  '&lt;td class=\"td-n center\">',date(DATE_FORMAT,$entry['access_time']),'&lt;\/td>',\r\n\t  '&lt;td class=\"td-n center\">',$entry_mtime,'&lt;\/td>',\r\n#ERROR6:\r\n\tNotice: Undefined index: filename in \/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-content\/plugins\/wp-apc-panel\/include\/apc.php on line 1264\r\n#SOLUTION6:\r\n\tforeach($cache[$scope_list[$MYREQUEST['SCOPE']]] as $entry) {\t\t-> existing line\r\n\t\t$n = isset($entry['filename']) ? dirname($entry['filename']) : '-';\r\n\t\tif ($MYREQUEST['AGGR'] > 0) {\t\t\t\t\t\t\t\t\t-> existing line\r\n#ERROR7:\r\n\tUndefined index: filename in \/i-data\/60cb70cf\/www\/pages\/wordpress\/wp-content\/plugins\/wp-apc-panel\/include\/apc.php on line 1154\r\n#SOLUTION7:\r\n\t$entry_fieldkey = isset($entry[$fieldkey]) ? md5($entry[$fieldkey]) : '';\r\n\techo\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t-> existing line\r\n\t  '&lt;tr class=tr-',$i%2,'>',\t\t\t\t\t\t\t\t\t\t-> existing line\r\n\t  \"&lt;td class=td-0>&lt;a href=\\\"$MY_SELF&OB=\",$MYREQUEST['OB'],\"&SH=\",$entry_fieldkey,\"\\\">\",$field_value,'&lt;\/a>&lt;\/td>',\t\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#Install &#038; configure wordpress: cd \/i-data\/md0\/www\/pages rm -r wordpress wget https:\/\/wordpress.org\/latest.zip unzip latest.zip &#038;&#038; rm -r latest.zip chown -R nobody:nobody \/i-data\/md0\/www\/pages\/wordpress\/ mysql -p CREATE DATABASE wordpress CHARACTER SET utf8; GRANT ALL ON wordpress.* TO &#8216;wordpress&#8217;@&#8217;%&#8217; IDENTIFIED BY &#8216;wordpress&#8217; WITH GRANT [&hellip;]<\/p>\n<div class=\"link-more\"><a href=\"https:\/\/adrhc.go.ro\/blog\/install-configure-wordpress\/#more-19\" class=\"more-link\">Continue reading &#10142; <span class=\"screen-reader-text\">Install &#038; configure wordpress<\/span><\/a><\/div>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-19","post","type-post","status-publish","format-standard","hentry","category-configuration"],"_links":{"self":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/19","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/comments?post=19"}],"version-history":[{"count":0,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/19\/revisions"}],"wp:attachment":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/media?parent=19"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/categories?post=19"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/tags?post=19"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}