{"id":3001,"date":"2019-06-24T22:46:48","date_gmt":"2019-06-24T19:46:48","guid":{"rendered":"https:\/\/kifarunix.com\/?p=3001"},"modified":"2024-03-11T22:55:43","modified_gmt":"2024-03-11T19:55:43","slug":"install-wordpress-5-with-nginx-on-fedora-30-fedora-29","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-wordpress-5-with-nginx-on-fedora-30-fedora-29\/","title":{"rendered":"Install WordPress 5 with Nginx on Fedora 30\/Fedora 29"},"content":{"rendered":"\n<p>We are going to demonstrate how to install WordPress 5 with Nginx on Fedora 30\/Fedora 29.<\/p>\n\n\n\n<p>Are you using WordPress and looking for a professional WordPress website builder platform? Look no further since&nbsp;<a href=\"https:\/\/trk.elementor.com\/8uczdzzsxgza-webcreatorsred\" target=\"_blank\" rel=\"noreferrer noopener\">Elementor can help you create beautiful pages<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing WordPress 5 with Nginx on Fedora<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Prerequisites<\/h3>\n\n\n\n<p>Update your system packages.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf update\ndnf upgrade<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Install LEMP Stack on Fedora 30\/Fedora 29<\/h4>\n\n\n\n<p>Installation of LEMP stack on Fedora 30\/Fedora 29 has been covered in our previous guide. See the link below.<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-lemp-stack-with-mysql-8-on-fedora-30-fedora-29\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Install LEMP Stack with MySQL 8 on Fedora 30\/Fedora 29<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Install Required PHP Extensions<\/h3>\n\n\n\n<p>Assuming you followed the guide above on setting up LEMP stack, you need to run the command below to install other required PHP modules.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install php-cli php-json php-opcache php-xml php-gd php-curl<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Configure MySQL<\/h3>\n\n\n\n<p>WordPress requires a database on which it can store the configurations and the data. Hence, login to MySQL as root user and create WordPress user and database as shown below.<\/p>\n\n\n\n<p>Login to MySQL<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql -u root -p<\/code><\/pre>\n\n\n\n<p>Next, create WordPress Database<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>create database wordpressdemo;<\/code><\/pre>\n\n\n\n<p>Create WordPress database user. Note that in MySQL 8, you cannot create user with <strong>GRANT<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>create user wpdemo@localhost identified by 'StrongP@33#';<\/code><\/pre>\n\n\n\n<p>Grant all privileges to WordPress user on WordPress database<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>grant all privileges on wordpressdemo.* to wpdemo@localhost;<\/code><\/pre>\n\n\n\n<p>Reload Privileges tables<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>flush privileges;<\/code><\/pre>\n\n\n\n<p>Enable MySQL 8 native passwords by editing the <strong>\/etc\/my.conf<\/strong> and uncommenting the line, <strong>default-authentication-plugin=mysql_native_password<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>vim \/etc\/my.conf<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>default-authentication-plugin=mysql_native_password<\/code><\/pre>\n\n\n\n<p>Restart MySQL<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl restart mysqld<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install WordPress 5 on Fedora 30\/Fedora 29<\/h3>\n\n\n\n<p>WordPress can be installed directly from Fedora 30\/29 repos. However, the available version may not up-to-date. You can check it by running the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf provides wordpress<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Last metadata expiration check: 0:19:41 ago on Mon 24 Jun 2019 06:32:18 PM EAT.\nwordpress-5.2.1-1.fc30.noarch : Blog tool and publishing platform\nRepo        : updates\nMatched from:\nProvide    : wordpress = 5.2.1-1.fc30<\/code><\/pre>\n\n\n\n<p>As you can see, the available version is <strong>5.2.1<\/strong> while the latest version 5.2.2. Therefore, to install the latest version, download WordPress archive from the <a rel=\"noreferrer noopener\" aria-label=\"downloads page (opens in a new tab)\" href=\"https:\/\/wordpress.org\/download\/\" target=\"_blank\">downloads page<\/a>. You can simply use the <strong>wget<\/strong> command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget https:\/\/wordpress.org\/latest.tar.gz<\/code><\/pre>\n\n\n\n<p>Next, extract WordPress archive contents<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>tar xzf latest.tar.gz -C \/tmp<\/code><\/pre>\n\n\n\n<p>Copy the extracted WordPress contents to Nginx Web Server root directory.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>rsync -avP \/tmp\/wordpress\/ \/usr\/share\/nginx\/html\/kifarunix-demo.com<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Configure WordPress<\/h3>\n\n\n\n<p>Open WordPress configuration file and set the database connection details. Rename the sample configuration file and edit it as follows.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>cp \/usr\/share\/nginx\/html\/kifarunix-demo.com\/wp-config-sample.php \/usr\/share\/nginx\/html\/kifarunix-demo.com\/wp-config.php<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>vim \/usr\/share\/nginx\/html\/kifarunix-demo.com\/wp-config.php<\/code><\/pre>\n\n\n\n<p>Replace the <strong>DB_NAME, DB_USER, DB_PASSWORD<\/strong> with your values.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>...\n\/\/ ** MySQL settings - You can get this info from your web host ** \/\/\n\/** The name of the database for WordPress *\/\ndefine( 'DB_NAME', 'wordpressdb' );\n\n\/** MySQL database username *\/\ndefine( 'DB_USER', 'wpuser' );\n\n\/** MySQL database password *\/\ndefine( 'DB_PASSWORD', 'StrongP@33#' );\n\n\/** MySQL hostname *\/\ndefine( 'DB_HOST', 'localhost' );\n\n\/** Database Charset to use in creating database tables. *\/\ndefine( 'DB_CHARSET', 'utf8' );\n...<\/code><\/pre>\n\n\n\n<p>After that, you need to define how WordPress will write to filesystem. Hence, put the line below just after the database configurations.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><code>define('FS_METHOD', 'direct');<\/code><\/pre>\n\n\n\n<p>Next, generate authentication unique keys and salts. You can simply generate the keys and salts from WordPress Secret-Key service as follows;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>curl -s https:\/\/api.wordpress.org\/secret-key\/1.1\/salt\/<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>define('AUTH_KEY',         'B|#MIfD#LtT8].r0$gj&#91;|&amp;kn:?1r9=@,6fHeP(#u{Kg&lt;q#E}4yuo$goGmF*qxv{}');\ndefine('SECURE_AUTH_KEY',  '&lt;@v!aDzv+I65qI!om67Bc4QA=Wfb|HLr0XhZT;6nVS+`t{&amp;8PI}y}kJ6U&#91;#Hm-x_');\ndefine('LOGGED_IN_KEY',    'JF*T}IXf=8tqx&gt;+}Ao9N#z}UX8_Ms_o&lt;-E6SJ#^z?  ^{8$&amp;H 8H+&lt;a+1$&#91;{$&amp;p+');\ndefine('NONCE_KEY',        'ah6{N4;Ms+CZfeU87+@Z_PO&gt;W`?$^+2Jcvo=hV`e}v}u5+;hPyqw&lt;2b;qyHkXOs$');\ndefine('AUTH_SALT',        ']&#91;WrFF`:-.#+}dEJQ.;Q%sl( RiY7:m(-&#91;.sDd3dh|o8S+q&gt;?ak&#91;g6ltHo^V5|]5');\ndefine('SECURE_AUTH_SALT', ')o|KHA^,~yH7S9-!vSS@vD&#91;Al;ep$&lt;$a$*emlV+h)l?T+Gc.a!LWZC {DZ buO&#91;B');\ndefine('LOGGED_IN_SALT',   '$-W+\/bVu&#91;vkBeWrtu:R-6&amp;cf{]N%z,PBomOP&gt;R=lqCOEt%v]Y&gt;}b]wGp(\/yza=ux');\ndefine('NONCE_SALT',       ' VV(UM||}r]G:4#XT;T9:*$@&gt;&#91;`v(m.N383u8pEJ-w*2&gt;h#mh5v`Kc9@}5c:Tc$]');<\/code><\/pre>\n\n\n\n<p>Within the <strong>wp-config.php<\/strong>, replace the following lines with the above.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>...\n * @since 2.6.0\n *\/\ndefine( 'AUTH_KEY',         'put your unique phrase here' );\ndefine( 'SECURE_AUTH_KEY',  'put your unique phrase here' );\ndefine( 'LOGGED_IN_KEY',    'put your unique phrase here' );\ndefine( 'NONCE_KEY',        'put your unique phrase here' );\ndefine( 'AUTH_SALT',        'put your unique phrase here' );\ndefine( 'SECURE_AUTH_SALT', 'put your unique phrase here' );\ndefine( 'LOGGED_IN_SALT',   'put your unique phrase here' );\ndefine( 'NONCE_SALT',       'put your unique phrase here' );\n\n\/**#@-*\/\n...<\/code><\/pre>\n\n\n\n<p>Your configuration should look like;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>...\n * @since 2.6.0\n *\/\n\/**\n * define( 'AUTH_KEY',         'put your unique phrase here' );\n * define( 'SECURE_AUTH_KEY',  'put your unique phrase here' );\n * define( 'LOGGED_IN_KEY',    'put your unique phrase here' );\n * define( 'NONCE_KEY',        'put your unique phrase here' );\n * define( 'AUTH_SALT',        'put your unique phrase here' );\n * define( 'SECURE_AUTH_SALT', 'put your unique phrase here' );\n * define( 'LOGGED_IN_SALT',   'put your unique phrase here' );\n * define( 'NONCE_SALT',       'put your unique phrase here' );\n *\/\ndefine('AUTH_KEY',         'B|#MIfD#LtT8].r0$gj&#91;|&amp;kn:?1r9=@,6fHeP(#u{Kg&lt;q#E}4yuo$goGmF*qxv{}');\ndefine('SECURE_AUTH_KEY',  '&lt;@v!aDzv+I65qI!om67Bc4QA=Wfb|HLr0XhZT;6nVS+`t{&amp;8PI}y}kJ6U&#91;#Hm-x_');\ndefine('LOGGED_IN_KEY',    'JF*T}IXf=8tqx&gt;+}Ao9N#z}UX8_Ms_o&lt;-E6SJ#^z?  ^{8$&amp;H 8H+&lt;a+1$&#91;{$&amp;p+');\ndefine('NONCE_KEY',        'ah6{N4;Ms+CZfeU87+@Z_PO&gt;W`?$^+2Jcvo=hV`e}v}u5+;hPyqw&lt;2b;qyHkXOs$');\ndefine('AUTH_SALT',        ']&#91;WrFF`:-.#+}dEJQ.;Q%sl( RiY7:m(-&#91;.sDd3dh|o8S+q&gt;?ak&#91;g6ltHo^V5|]5');\ndefine('SECURE_AUTH_SALT', ')o|KHA^,~yH7S9-!vSS@vD&#91;Al;ep$&lt;$a$*emlV+h)l?T+Gc.a!LWZC {DZ buO&#91;B');\ndefine('LOGGED_IN_SALT',   '$-W+\/bVu&#91;vkBeWrtu:R-6&amp;cf{]N%z,PBomOP&gt;R=lqCOEt%v]Y&gt;}b]wGp(\/yza=ux');\ndefine('NONCE_SALT',       ' VV(UM||}r]G:4#XT;T9:*$@&gt;&#91;`v(m.N383u8pEJ-w*2&gt;h#mh5v`Kc9@}5c:Tc$]');\n\/**#@-*\/\n...<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Configure Nginx<\/h3>\n\n\n\n<p>Create your site Nginx server block.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>vi \/etc\/nginx\/conf.d\/wp.kifarunix-demo.com.conf<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>server {\n    listen       80 default_server;\n    server_name  wp.kifarunix-demo.com;\n    root         \/usr\/share\/nginx\/html\/kifarunix-demo.com;\n    \n    access_log \/var\/log\/nginx\/access_wp.kifarunix-demo.com;\n    error_log \/var\/log\/nginx\/error_wp.kifarunix-demo.com;\n\n    index   index.php;\n\n    location \/ {\n        try_files    $uri $uri\/ \/index.php?$args;\n    }\n    location ~ \\.php$ {\n        fastcgi_pass unix:\/run\/php-fpm\/www.sock;\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n        include fastcgi_params;\n        fastcgi_index index.php;\n    }\n    error_page 404 \/404.html;\n        location = \/40x.html {\n    }\n\n    error_page 500 502 503 504 \/50x.html;\n        location = \/50x.html {\n    }\n}<\/code><\/pre>\n\n\n\n<p>Next, set the ownership of your site Nginx configuration to <strong>nginx<\/strong> user.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>chown -R nginx:nginx \/usr\/share\/nginx\/html\/kifarunix-demo.com<\/code><\/pre>\n\n\n\n<p>If SELinux is running, execute the following commands to allow Nginx connect to DB, send mail and access WordPress configuration files.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>setsebool -P httpd_can_network_connect_db=1<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>setsebool -P httpd_can_sendmail=1<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>chcon -Rt httpd_sys_content_t \/usr\/share\/nginx\/html\/kifarunix-demo.com\/<\/code><\/pre>\n\n\n\n<p>Restart Nginx<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl restart nginx<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Finalize WordPress Setup<\/h3>\n\n\n\n<p class=\"has-text-align-left\">Login to your WordPress and finalize your setup.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/06\/wordpress-setup-with-mysql8.png\"><img loading=\"lazy\" decoding=\"async\" width=\"747\" height=\"674\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/06\/wordpress-setup-with-mysql8.png\" alt=\" install WordPress 5 with Nginx on Fedora 30\/Fedora 29\" class=\"wp-image-3412\" title=\"\"><\/a><\/figure>\n\n\n\n<p>Next, login to your WordPress.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/06\/login-to-wordpress.png\"><img loading=\"lazy\" decoding=\"async\" width=\"779\" height=\"399\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/06\/login-to-wordpress.png\" alt=\" install WordPress 5 on Fedora 30\/Fedora 29\" class=\"wp-image-3413\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/06\/login-to-wordpress.png 779w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/06\/login-to-wordpress-768x393.png 768w\" sizes=\"(max-width: 779px) 100vw, 779px\" \/><\/a><\/figure>\n\n\n\n<p>And there you go.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/06\/wordpress-5-dashboard.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1352\" height=\"655\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/06\/wordpress-5-dashboard.png\" alt=\"WordPress 5 dashboard\" class=\"wp-image-3414\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/06\/wordpress-5-dashboard.png 1352w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/06\/wordpress-5-dashboard-768x372.png 768w\" sizes=\"(max-width: 1352px) 100vw, 1352px\" \/><\/a><\/figure>\n\n\n\n<p>You have successfully installed wordpress 5 with Nginx and MySQL 8 on Fedora 30\/Fedora 29. Enjoy.<\/p>\n\n\n\n<p>You can also check our other articles by following the links below;<\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-use-wpscan-wordpress-vulnerability-scanner-ubuntu-18-04\/\" target=\"_blank\">How to Install and Use WPScan WordPress Vulnerability Scanner Ubuntu 18.04<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-wordpress-5-0-with-apache-on-fedora-29-fedora-28\/\" target=\"_blank\">Install WordPress 5.0 with Apache on Fedora 29\/Fedora 28<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/how-to-install-lamp-linux-apache-mysql-php-stack-on-fedora-28-29\/\" target=\"_blank\">How To Install LAMP (Linux, Apache, MySQL, PHP) Stack on Fedora 28\/29<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/how-to-install-lamp-stack-apachemariadb-php-7-2-on-ubuntu-18-04-lts\/\" target=\"_blank\">How to Install LAMP Stack (Apache,MariaDB, PHP 7.2) on Ubuntu 18.04 LTS<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-lamp-stack-on-fedora-30\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Install LAMP Stack on Fedora 30<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are going to demonstrate how to install WordPress 5 with Nginx on Fedora 30\/Fedora 29. Are you using WordPress and looking for a professional<\/p>\n","protected":false},"author":2,"featured_media":12497,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,292],"tags":[924,1010,999,229,293],"class_list":["post-3001","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","category-wordpress","tag-fedora-30","tag-lemp-stack","tag-mysql-8","tag-nginx","tag-wordpress-5-0","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3001"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=3001"}],"version-history":[{"count":10,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3001\/revisions"}],"predecessor-version":[{"id":21157,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3001\/revisions\/21157"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/12497"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=3001"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=3001"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=3001"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}