{"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
We are going to demonstrate how to install WordPress 5 with Nginx on Fedora 30\/Fedora 29.<\/p>\n\n\n\n
Are you using WordPress and looking for a professional WordPress website builder platform? Look no further since Elementor can help you create beautiful pages<\/a>.<\/p>\n\n\n\n Update your system packages.<\/p>\n\n\n\n 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 Install LEMP Stack with MySQL 8 on Fedora 30\/Fedora 29<\/a><\/p>\n\n\n\n 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 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 Login to MySQL<\/p>\n\n\n\n Next, create WordPress Database<\/p>\n\n\n\n Create WordPress database user. Note that in MySQL 8, you cannot create user with GRANT<\/strong>.<\/p>\n\n\n\n Grant all privileges to WordPress user on WordPress database<\/p>\n\n\n\n Reload Privileges tables<\/p>\n\n\n\n Enable MySQL 8 native passwords by editing the \/etc\/my.conf<\/strong> and uncommenting the line, default-authentication-plugin=mysql_native_password<\/strong>.<\/p>\n\n\n\n Restart MySQL<\/p>\n\n\n\n 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 As you can see, the available version is 5.2.1<\/strong> while the latest version 5.2.2. Therefore, to install the latest version, download WordPress archive from the downloads page<\/a>. You can simply use the wget<\/strong> command.<\/p>\n\n\n\n Next, extract WordPress archive contents<\/p>\n\n\n\n Copy the extracted WordPress contents to Nginx Web Server root directory.<\/p>\n\n\n\n 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 Replace the DB_NAME, DB_USER, DB_PASSWORD<\/strong> with your values.<\/p>\n\n\n\n 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 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 Within the wp-config.php<\/strong>, replace the following lines with the above.<\/p>\n\n\n\n Your configuration should look like;<\/p>\n\n\n\n Create your site Nginx server block.<\/p>\n\n\n\n Next, set the ownership of your site Nginx configuration to nginx<\/strong> user.<\/p>\n\n\n\n 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 Restart Nginx<\/p>\n\n\n\n Login to your WordPress and finalize your setup.<\/p>\n\n\n\n Next, login to your WordPress.<\/p>\n\n\n\n And there you go.<\/p>\n\n\n\n You have successfully installed wordpress 5 with Nginx and MySQL 8 on Fedora 30\/Fedora 29. Enjoy.<\/p>\n\n\n\n You can also check our other articles by following the links below;<\/p>\n\n\n\n How to Install and Use WPScan WordPress Vulnerability Scanner Ubuntu 18.04<\/a><\/p>\n\n\n\n Install WordPress 5.0 with Apache on Fedora 29\/Fedora 28<\/a><\/p>\n\n\n\n How To Install LAMP (Linux, Apache, MySQL, PHP) Stack on Fedora 28\/29<\/a><\/p>\n\n\n\n How to Install LAMP Stack (Apache,MariaDB, PHP 7.2) on Ubuntu 18.04 LTS<\/a><\/p>\n\n\n\nInstalling WordPress 5 with Nginx on Fedora<\/h2>\n\n\n\n
Prerequisites<\/h3>\n\n\n\n
dnf update\ndnf upgrade<\/code><\/pre>\n\n\n\n
Install LEMP Stack on Fedora 30\/Fedora 29<\/h4>\n\n\n\n
Install Required PHP Extensions<\/h3>\n\n\n\n
dnf install php-cli php-json php-opcache php-xml php-gd php-curl<\/code><\/pre>\n\n\n\n
Configure MySQL<\/h3>\n\n\n\n
mysql -u root -p<\/code><\/pre>\n\n\n\n
create database wordpressdemo;<\/code><\/pre>\n\n\n\n
create user wpdemo@localhost identified by 'StrongP@33#';<\/code><\/pre>\n\n\n\n
grant all privileges on wordpressdemo.* to wpdemo@localhost;<\/code><\/pre>\n\n\n\n
flush privileges;<\/code><\/pre>\n\n\n\n
vim \/etc\/my.conf<\/code><\/pre>\n\n\n\n
default-authentication-plugin=mysql_native_password<\/code><\/pre>\n\n\n\n
systemctl restart mysqld<\/code><\/pre>\n\n\n\n
Install WordPress 5 on Fedora 30\/Fedora 29<\/h3>\n\n\n\n
dnf provides wordpress<\/code><\/pre>\n\n\n\n
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
wget https:\/\/wordpress.org\/latest.tar.gz<\/code><\/pre>\n\n\n\n
tar xzf latest.tar.gz -C \/tmp<\/code><\/pre>\n\n\n\n
rsync -avP \/tmp\/wordpress\/ \/usr\/share\/nginx\/html\/kifarunix-demo.com<\/code><\/pre>\n\n\n\n
Configure WordPress<\/h3>\n\n\n\n
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
vim \/usr\/share\/nginx\/html\/kifarunix-demo.com\/wp-config.php<\/code><\/pre>\n\n\n\n
...\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
define('FS_METHOD', 'direct');<\/code><\/pre>\n\n\n\n
curl -s https:\/\/api.wordpress.org\/secret-key\/1.1\/salt\/<\/code><\/pre>\n\n\n\n
define('AUTH_KEY', 'B|#MIfD#LtT8].r0$gj[|&kn:?1r9=@,6fHeP(#u{Kg<q#E}4yuo$goGmF*qxv{}');\ndefine('SECURE_AUTH_KEY', '<@v!aDzv+I65qI!om67Bc4QA=Wfb|HLr0XhZT;6nVS+`t{&8PI}y}kJ6U[#Hm-x_');\ndefine('LOGGED_IN_KEY', 'JF*T}IXf=8tqx>+}Ao9N#z}UX8_Ms_o<-E6SJ#^z? ^{8$&H 8H+<a+1$[{$&p+');\ndefine('NONCE_KEY', 'ah6{N4;Ms+CZfeU87+@Z_PO>W`?$^+2Jcvo=hV`e}v}u5+;hPyqw<2b;qyHkXOs$');\ndefine('AUTH_SALT', '][WrFF`:-.#+}dEJQ.;Q%sl( RiY7:m(-[.sDd3dh|o8S+q>?ak[g6ltHo^V5|]5');\ndefine('SECURE_AUTH_SALT', ')o|KHA^,~yH7S9-!vSS@vD[Al;ep$<$a$*emlV+h)l?T+Gc.a!LWZC {DZ buO[B');\ndefine('LOGGED_IN_SALT', '$-W+\/bVu[vkBeWrtu:R-6&cf{]N%z,PBomOP>R=lqCOEt%v]Y>}b]wGp(\/yza=ux');\ndefine('NONCE_SALT', ' VV(UM||}r]G:4#XT;T9:*$@>[`v(m.N383u8pEJ-w*2>h#mh5v`Kc9@}5c:Tc$]');<\/code><\/pre>\n\n\n\n
...\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
...\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[|&kn:?1r9=@,6fHeP(#u{Kg<q#E}4yuo$goGmF*qxv{}');\ndefine('SECURE_AUTH_KEY', '<@v!aDzv+I65qI!om67Bc4QA=Wfb|HLr0XhZT;6nVS+`t{&8PI}y}kJ6U[#Hm-x_');\ndefine('LOGGED_IN_KEY', 'JF*T}IXf=8tqx>+}Ao9N#z}UX8_Ms_o<-E6SJ#^z? ^{8$&H 8H+<a+1$[{$&p+');\ndefine('NONCE_KEY', 'ah6{N4;Ms+CZfeU87+@Z_PO>W`?$^+2Jcvo=hV`e}v}u5+;hPyqw<2b;qyHkXOs$');\ndefine('AUTH_SALT', '][WrFF`:-.#+}dEJQ.;Q%sl( RiY7:m(-[.sDd3dh|o8S+q>?ak[g6ltHo^V5|]5');\ndefine('SECURE_AUTH_SALT', ')o|KHA^,~yH7S9-!vSS@vD[Al;ep$<$a$*emlV+h)l?T+Gc.a!LWZC {DZ buO[B');\ndefine('LOGGED_IN_SALT', '$-W+\/bVu[vkBeWrtu:R-6&cf{]N%z,PBomOP>R=lqCOEt%v]Y>}b]wGp(\/yza=ux');\ndefine('NONCE_SALT', ' VV(UM||}r]G:4#XT;T9:*$@>[`v(m.N383u8pEJ-w*2>h#mh5v`Kc9@}5c:Tc$]');\n\/**#@-*\/\n...<\/code><\/pre>\n\n\n\n
Configure Nginx<\/h3>\n\n\n\n
vi \/etc\/nginx\/conf.d\/wp.kifarunix-demo.com.conf<\/code><\/pre>\n\n\n\n
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
chown -R nginx:nginx \/usr\/share\/nginx\/html\/kifarunix-demo.com<\/code><\/pre>\n\n\n\n
setsebool -P httpd_can_network_connect_db=1<\/code><\/pre>\n\n\n\n
setsebool -P httpd_can_sendmail=1<\/code><\/pre>\n\n\n\n
chcon -Rt httpd_sys_content_t \/usr\/share\/nginx\/html\/kifarunix-demo.com\/<\/code><\/pre>\n\n\n\n
systemctl restart nginx<\/code><\/pre>\n\n\n\n
Finalize WordPress Setup<\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n
<\/a><\/figure>\n\n\n\n
<\/a><\/figure>\n\n\n\n