{"id":7,"date":"2015-11-04T22:53:56","date_gmt":"2015-11-04T22:53:56","guid":{"rendered":"http:\/\/blog.paranoidprofessor.com\/?p=7"},"modified":"2016-07-14T20:39:24","modified_gmt":"2016-07-14T20:39:24","slug":"wordpress-from-scratch-part-i","status":"publish","type":"post","link":"https:\/\/blog.paranoidprofessor.com\/index.php\/2015\/11\/04\/wordpress-from-scratch-part-i\/","title":{"rendered":"WordPress from scratch &#8211; part I"},"content":{"rendered":"<p>To install WordPress to your server the following steps need to be performed.<\/p>\n<ul>\n<li>download WordPress<\/li>\n<li>unpack WordPress<\/li>\n<li>create database for WordPress<\/li>\n<li>setup WordPress configuration<\/li>\n<li>run install script<\/li>\n<\/ul>\n<p>One of the preconditions is that either mySQL or MariaDB, PHP and Apache web server are already installed on your server.<\/p>\n<h3>From a command prompt<\/h3>\n<p>It is possible to go to the WordPress with your browser and download the most current version of WordPress.<\/p>\n<p><b><em><code>https:\/\/wordpress.org\/download\/<\/code><\/em><\/b><\/p>\n<p>This isn&#8217;t a bad solution if the computer you are browsing the Internet with also happens to be your web server. A better solution would be to have a dedicated server (or virtual server) and to download the software directly to it.<\/p>\n<p>On linux the wget command can be used to retrieve a file if we know where it is located. Those nice folks at WordPress have made this very easy by always having the most current version available under the name latest.tar.gz or latest.zip.<\/p>\n<p><b><em><code>wget http:\/\/wordpress.org\/latest.tar.gz<\/code><\/em><\/b><\/p>\n<p>The file can be unpacked with the following command.<\/p>\n<p><b><em><code>tar zxvf latest.tar.gz<\/code><\/em><\/b><\/p>\n<p>This will unzip the file into the wordpress subdirectory in the current working directory.\u00a0 The zip file should be unpacked into the directory of the web server. On Debian this is \/var\/www\/html.<\/p>\n<p>WordPress will be unpacked into the wordpress directory.\u00a0 This is fine if you want your blog to be prefixed with wordpress.<\/p>\n<p><b><em><code>http:\/\/www.example.com\/wordpress<\/code><\/em><\/b><\/p>\n<p>If your intend to only run wordpress, you can move the contents to the root directory.<\/p>\n<p><b><em><code>mv wordpress\/* .<\/code><\/em><\/b><\/p>\n<p>WordPress stores users, posts, comments, and links in the database.\u00a0 It is necessary to create a database, user and grant privileges to the database for the user. In order to do that, you need to log into the database as the owner (root).<br \/>\n<b><em><code><br \/>\nmysql -u&lt;root user&gt; -p&lt;root password&gt;<br \/>\ncreate user 'max'@'localhost' identified by 'supersecret' ;<br \/>\ncreate database fishwrapper ;<br \/>\ngrant all privileges on fishwrapper.* to max@localhost;<br \/>\n<\/code><\/em><\/b><\/p>\n<p>Before quitting it is best to switch to the database to verify that it is properly created and then exit mysql.<\/p>\n<p><b><em><code>use fishwrapper;<br \/>\nexit<\/code><\/em><\/b><\/p>\n<p>Before WordPress can be installed the configuration file needs to be properly setup. WordPress provides a sample configuration file called <b>wp-config-sample.php<\/b>. This file needs to be copied to <b>wp-config.php<\/b> and then changed to contain the database setup for your environment.<\/p>\n<p>The database name, user and password need to be updated to contain the new user and database information. It is possible to leave the host set to localhost.<br \/>\n<b><em><code><br \/>\ndefine('DB_NAME', 'database_name_here');<br \/>\ndefine('DB_USER', 'username_here');<br \/>\ndefine('DB_PASSWORD', 'password_here');<br \/>\ndefine('DB_HOST', 'localhost');<br \/>\n<\/code><\/em><\/b><\/p>\n<p>There is one more little section in this file that contains eight keys which are used for cookies. It is not actually necessary to change these phrases but a good idea.<br \/>\n<b><em><code><br \/>\ndefine('AUTH_KEY', 'put your unique phrase here');<br \/>\ndefine('SECURE_AUTH_KEY', 'put your unique phrase here');<br \/>\ndefine('LOGGED_IN_KEY', 'put your unique phrase here');<br \/>\ndefine('NONCE_KEY', 'put your unique phrase here');<br \/>\ndefine('AUTH_SALT', 'put your unique phrase here');<br \/>\ndefine('SECURE_AUTH_SALT', 'put your unique phrase here');<br \/>\ndefine('LOGGED_IN_SALT', 'put your unique phrase here');<br \/>\ndefine('NONCE_SALT', 'put your unique phrase here');<br \/>\n<\/code><\/em><\/b><\/p>\n<p>Not only is it a good idea, it is super simple to get values for these keys. Simply visit the WordPress link below and it will generate the values which can simply be copied and pasted directly into the configuration file.<\/p>\n<p><a href=\"https:\/\/api.wordpress.org\/secret-key\/1.1\/salt\/\" target=\"_blank\">https:\/\/api.wordpress.org\/secret-key\/1.1\/salt\/<\/a><\/p>\n<p>The final step is just to run the install script from WordPress. From the web browser, simply run the script.<\/p>\n<p><b><em><code>http:\/\/www.example.com\/wordpress\/wp-admin\/install.php<\/code><\/em><\/b><\/p>\n<p>The installation script will only ask for a few pieces of information.<br \/>\n<b><em><code><br \/>\nsite title<br \/>\ndb user<br \/>\ndb password<br \/>\nemail address<br \/>\nallow search engines to search this site checkbox<br \/>\n<\/code><\/em><\/b><\/p>\n<p>This final step takes a couple of seconds.\u00a0 Once this is done the site is available.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To install WordPress to your server the following steps need to be performed. download WordPress unpack WordPress create database for WordPress setup WordPress configuration run install script One of the preconditions is that either mySQL or MariaDB, PHP and Apache &hellip; <a href=\"https:\/\/blog.paranoidprofessor.com\/index.php\/2015\/11\/04\/wordpress-from-scratch-part-i\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10,3],"tags":[26,17,28],"_links":{"self":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts\/7"}],"collection":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/comments?post=7"}],"version-history":[{"count":4,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts\/7\/revisions"}],"predecessor-version":[{"id":110,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts\/7\/revisions\/110"}],"wp:attachment":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/media?parent=7"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/categories?post=7"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/tags?post=7"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}