0230.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Installing WordPress on Debian</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Browser Based,Home Lab,Home Lab Ideas,Install Guide,Self-Hosted,Web Based,Web Based Tools,FOSS,Free Open Source Software,Free Software,How To Install WordPress On Linux,Open Source Software,Open-Source,Web Server,Web Server Administration,Web Server Administrator,WordPress,WordPress Installation Guide,LAMP,MySQL,MariaDB,Linux,Debian,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Installing WordPress on Debian">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="08/13/2022 09:24:31 AM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Installing WordPress on Debian</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <ol>
  26. <li>Log into the Debian device</li>
  27. <li>Run the following commands in a terminal:
  28. <div class="codeBlock"># update repositories and install any available software updates<br />
  29. sudo apt update<br />
  30. sudo apt upgrade -y<br />
  31. # install Apache HTTPD and MySQL<br />
  32. sudo apt-get install apache2 mariadb-server mariadb-client curl<br />
  33. # install PHP components<br />
  34. sudo apt&nbsp;install php php-mysql php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip<br />
  35. # configure the MySQL database<br />
  36. sudo su<br />
  37. mysql_secure_installation</div>
  38. </li>
  39. <li>Press Enter to login as root</li>
  40. <li>Type Y and press Enter to set a root password, type the password twice to confirm</li>
  41. <li>Type Y and press Enter to remove anonymous users</li>
  42. <li>Type Y and press Enter to disallow root login remotely</li>
  43. <li>Type Y and press Enter to remove the test database</li>
  44. <li>Type Y and press Enter to reload privilege tables</li>
  45. <li>Run the following command to login into MySQL:
  46. <div class="codeBlock">mysql -u root -p</div>
  47. </li>
  48. <li>Authenticate with the root password set earlier</li>
  49. <li>Run the following commands to create the WordPress&nbsp;database and database user
  50. <div class="codeBlock">CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;<br />
  51. GRANT ALL ON wordpress.* TO &#39;wordpress_user&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;W0rdPr3ss!!&#39;;<br />
  52. FLUSH PRIVILEGES;<br />
  53. EXIT;<br />
  54. exit</div>
  55. </li>
  56. <li>Continue with the following commands to download and extract WordPress&nbsp;in the Apache webroot
  57. <div class="codeBlock"># download latest wordpress version<br />
  58. sudo wget https://wordpress.org/latest.tar.gz<br />
  59. # extract latest.tar.gz<br />
  60. sudo mkdir /var/www/wordpress<br />
  61. sudo tar xzvf latest.tar.gz --directory /var/www<br />
  62. # create a new wordpress.conf file to configure the site<br />
  63. sudo nano /etc/apache2/sites-available/wordpress.conf</div>
  64. </li>
  65. <li>Paste the following configuration into wordpress.conf
  66. <p>Alias /wordpress &quot;/var/www/wordpress/&quot;<br />
  67. &lt;Directory /var/www/wordpress/&gt;<br />
  68. &nbsp; &nbsp; AllowOverride All<br />
  69. &lt;/Directory&gt;</p>
  70. </li>
  71. <li>Press CTRL+O, Enter, CTRL+X to write the changes to wordpress.conf</li>
  72. <li>Continue with the following commands to enable the site and restart Apache:
  73. <div class="codeBlock"># enable the Wordpress site and required PHP modules<br />
  74. sudo a2ensite wordpress<br />
  75. sudo a2enmod rewrite<br />
  76. # create a .htaccess file<br />
  77. sudo touch /var/www/wordpress/.htaccess<br />
  78. # copy the sample wordpress config<br />
  79. sudo cp /var/www/wordpress/wp-config-sample.php /var/www/wordpress/wp-config.php<br />
  80. # create an upgrade directory<br />
  81. sudo mkdir /var/www/wordpress/wp-content/upgrade<br />
  82. # set the owner of the new wordpress directory to www-data<br />
  83. sudo chown -R www-data:www-data /var/www/wordpress<br />
  84. # change additional permissions<br />
  85. sudo find /var/www/wordpress/ -type d -exec chmod 750 {} \;<br />
  86. sudo find /var/www/wordpress/ -type f -exec chmod 640 {} \;<br />
  87. # generate secure secret keys, copy the output for use shortly<br />
  88. curl -s https://api.wordpress.org/secret-key/1.1/salt/<br />
  89. # edit wp-config.conf<br />
  90. sudo nano /var/www/wordpress/wp-config.php</div>
  91. </li>
  92. <li>Press CTRL+W and search for&nbsp;define(&#39;AUTH_KEY&#39;</li>
  93. <li>Paste the secure secret keys generated earlier, overwriting the template</li>
  94. <li>Press CTRL+W and search for&nbsp;define(&#39;DB_NAME&#39;</li>
  95. <li>Update the database name, username and password</li>
  96. <li>Press CTRL+W and search for define(&#39;FS_METHOD&#39;</li>
  97. <li>Set the value to &#39;direct&#39;</li>
  98. <li>Press CTRL+O, Enter, CTRL+X to write the changes to wp-config.conf</li>
  99. <li>Continue the setup by running the following commands in terminal
  100. <div class="codeBlock"># restart apache2 service<br />
  101. sudo systemctl restart apache2</div>
  102. </li>
  103. <li>Open a web browser and navigate to http://DNSorIP/wordpress</li>
  104. <li>The Wordpress setup screen should be displayed</li>
  105. <li>Select a language &gt; Click Continue</li>
  106. <li>Create a site title and WordPress login &gt; Click Install WordPress</li>
  107. <li>When the installation completes, login with the WordPress credentials created in the previous step</li>
  108. <li>Welcome to your very own, self-hosted WordPress installation</li>
  109. </ol> </div>
  110. </div>
  111. </body>
  112. </html>