{"id":3735,"date":"2019-07-21T18:59:45","date_gmt":"2019-07-21T15:59:45","guid":{"rendered":"https:\/\/kifarunix.com\/?p=3735"},"modified":"2024-03-12T07:33:12","modified_gmt":"2024-03-12T04:33:12","slug":"install-wordpress-5-with-nginx-on-debian-10-buster","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-wordpress-5-with-nginx-on-debian-10-buster\/","title":{"rendered":"Install WordPress 5 with Nginx on Debian 10 Buster"},"content":{"rendered":"\n

In this guide, we are going to learn how to install WordPress<\/a> 5 with Nginx on Debian 10 Buster.<\/p>\n\n\n\n

Are you using WordPress and looking for a professional WordPress website builder? Look no further since Elementor can help you create beautiful pages<\/a>.<\/p>\n\n\n\n

Installing WordPress 5 with Nginx on Debian 10 Buster<\/h2>\n\n\n\n

Run system update<\/h3>\n\n\n\n
apt update\napt upgrade<\/code><\/pre>\n\n\n\n

Install LAMP Stack on Debian 10 Buster<\/h3>\n\n\n\n

In order to run WordPress, you need to have either LEMP or LAMP stack installed already. You use LEMP stack if you want to run WordPress 5 with Nginx. If you want to use Apache, you need to use LAMP stack.<\/p>\n\n\n\n

To install LEMP stack on Debian 10 Buster, follow the link below;<\/p>\n\n\n\n

Install LEMP Stack on Debian 10 Buster<\/a><\/p>\n\n\n\n

Create WordPress Database and User<\/h3>\n\n\n\n

This guide uses MariaDB 10 for WordPress Database. If you need to use MySQL 8, see the link below on how to install MySQL 8 on Debian 10 Buster.<\/p>\n\n\n\n

Install MySQL 8 on Debian 10 Buster<\/a><\/p>\n\n\n\n

Login to your database server and create WordPress database and a privileged database user.<\/p>\n\n\n\n

mysql -u root -p<\/code><\/pre>\n\n\n\n
create database kifarunixdemo;\ncreate user demouser@localhost identified by 'Str0nGPassword';\ngrant all privileges on kifarunixdemo.* to demouser@localhost;\nflush privileges;\nquit<\/code><\/pre>\n\n\n\n

Install Extra PHP Extensions<\/h3>\n\n\n\n

While installing LEMP stack as in the link above, a few PHP modules were installed. To install other required php extensions, execute the command below;<\/p>\n\n\n\n

apt install php-curl php-gd php-intl php-mbstring php-soap php-xml php-xmlrpc php-zip<\/code><\/pre>\n\n\n\n

Configure Nginx<\/h3>\n\n\n\n

While configuring LEMP stack, you might have created an Nginx configuration file for your site. However, for the purposes of this demo, we are going to create a demo configuration file under, \/etc\/nginx\/sites-available\/<\/strong> as shown below.<\/p>\n\n\n\n

vim \/etc\/nginx\/sites-available\/kifarunix-demo<\/code><\/pre>\n\n\n\n

Next, put the content below on the configuration file. Besure to make appropriate adjustments.<\/p>\n\n\n\n

server {\n\tlisten 80;\n\troot \/var\/www\/html\/kifarunix-demo;\n\tserver_name kifarunix-demo.com;\n\n\tlocation \/ {\n\t    index\tindex.php index.html;\n\t    try_files\t$uri $uri\/ \/index.php?$args;\n\t}\t\n\n\tlocation ~ \\.php$ {\n\t\tinclude snippets\/fastcgi-php.conf;\n\t\tfastcgi_pass unix:\/run\/php\/php7.3-fpm.sock;\n\t\tfastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;\n\t}\n}<\/code><\/pre>\n\n\n\n

Save the configuration file and enable you site configuration by creating a symbolic link to the enabled sites directory.<\/p>\n\n\n\n

ln -s \/etc\/nginx\/sites-available\/kifarunix-demo \/etc\/nginx\/sites-enabled\/<\/code><\/pre>\n\n\n\n

Verify Nginx configuration.<\/p>\n\n\n\n

nginx -t<\/code><\/pre>\n\n\n\n
nginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok\nnginx: configuration file \/etc\/nginx\/nginx.conf test is successful<\/code><\/pre>\n\n\n\n

Reload Nginx<\/p>\n\n\n\n

systemctl reload nginx<\/code><\/pre>\n\n\n\n

Download WordPress 5<\/h3>\n\n\n\n

Download the latest WordPress archive by running the command below;<\/p>\n\n\n\n

wget https:\/\/wordpress.org\/latest.tar.gz -P \/tmp<\/code><\/pre>\n\n\n\n

Once the download is done, extract WordPress to your web root directory, \/var\/www\/html\/kifarunix-demo<\/strong>, in this demo.<\/p>\n\n\n\n

mkdir \/var\/www\/html\/kifarunix-demo<\/code><\/pre>\n\n\n\n
tar xzf \/tmp\/latest.tar.gz --strip-components=1 -C \/var\/www\/html\/kifarunix-demo<\/code><\/pre>\n\n\n\n

Configure WordPress<\/h3>\n\n\n\n

Copy the sample WordPress configuration file and rename it as follows.<\/p>\n\n\n\n

cp \/var\/www\/html\/kifarunix-demo\/wp-config{-sample,}.php<\/code><\/pre>\n\n\n\n

Next, you need to set the database connection settings and authentication keys and Salts.<\/p>\n\n\n\n

The database connection details (database, database user and password) are created above while configuring the database.<\/p>\n\n\n\n

The Authentication Keys and Salts can be generated by running the command below;<\/p>\n\n\n\n

curl -s https:\/\/api.wordpress.org\/secret-key\/1.1\/salt\/<\/code><\/pre>\n\n\n\n
define('AUTH_KEY',         '|WYo279FcL.j_ G$DOn;TXsH\/wP=[$[1i^+~`|;!w|!KIa1$R5`D,0<V5prPa;m4');\ndefine('SECURE_AUTH_KEY',  'ojU%olj}N`1<DgV_F?P=Xrc[z|j*TH@Ll+.Xh>=V|FM*K`@C^RWSPv{V.\/k){s ]');\ndefine('LOGGED_IN_KEY',    't[8x41+V0D>_jO4=#g*u{o|?Hy_$A(u?@-`0G5R6-n$i;Q=u!8+:0tT\/5:Q=8<Vg');\ndefine('NONCE_KEY',        'z}yPWE]g=uo1Ex0rPS3S~kQ1A#.yBHi5W h^P)i}>;_[P`Zx,B%d5}.{q>ZPMmLu');\ndefine('AUTH_SALT',        'MA) ~|J?G!X)uI+k@yT(*mUZBWsQiNPS]*^x-<cp+DYA=J:N]7O+t_rU(^)@+kqv');\ndefine('SECURE_AUTH_SALT', 'Zjl&O}$qz|f(sRSe%ZT*@SkCg.`Sm\/e0Z\/CEW<|vRwOl}qbR!nzA-D>X%eKGcV2E');\ndefine('LOGGED_IN_SALT',   'GBp!7=U*T~#-%Ly?FnS$qgYEzGnX1w3!Bo_ ]$o]EDj{wh,fe1NJK9VkI_n ;hTD');\ndefine('NONCE_SALT',       'fdTm,$h?vjzLS(yMKj!rR]0aZ*f(Q(\/t|cS|;o)%{GqCK4IxG-+fyL_Yan~ns4XF');<\/code><\/pre>\n\n\n\n

Do NOT copy the Keys above<\/strong>. Be sure to use your own unique keys and salts.<\/p>\n\n\n\n

Hence, open the WordPress configuration file and edit it as shown below;<\/p>\n\n\n\n

vim \/var\/www\/html\/kifarunix-demo\/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', 'kifarunixdemo' );\n\n\/** MySQL database username *\/\ndefine( 'DB_USER', 'demouser' );\n\n\/** MySQL database password *\/\ndefine( 'DB_PASSWORD', 'Str0nGPassword' );\n\n\/** MySQL hostname *\/\ndefine( 'DB_HOST', 'localhost' );\n\n\/** Database Charset to use in creating database tables. *\/\ndefine( 'DB_CHARSET', 'utf8' );\n\n\/** The Database Collate type. Don't change this if in doubt. *\/\ndefine( 'DB_COLLATE', '' );\n...<\/code><\/pre>\n\n\n\n

Replace this;<\/p>\n\n\n\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...<\/code><\/pre>\n\n\n\n

With (generated above);<\/p>\n\n\n\n

define('AUTH_KEY',         '|WYo279FcL.j_ G$DOn;TXsH\/wP=[$[1i^+~`|;!w|!KIa1$R5`D,0<V5prPa;m4');\ndefine('SECURE_AUTH_KEY',  'ojU%olj}N`1<DgV_F?P=Xrc[z|j*TH@Ll+.Xh>=V|FM*K`@C^RWSPv{V.\/k){s ]');\ndefine('LOGGED_IN_KEY',    't[8x41+V0D>_jO4=#g*u{o|?Hy_$A(u?@-`0G5R6-n$i;Q=u!8+:0tT\/5:Q=8<Vg');\ndefine('NONCE_KEY',        'z}yPWE]g=uo1Ex0rPS3S~kQ1A#.yBHi5W h^P)i}>;_[P`Zx,B%d5}.{q>ZPMmLu');\ndefine('AUTH_SALT',        'MA) ~|J?G!X)uI+k@yT(*mUZBWsQiNPS]*^x-<cp+DYA=J:N]7O+t_rU(^)@+kqv');\ndefine('SECURE_AUTH_SALT', 'Zjl&O}$qz|f(sRSe%ZT*@SkCg.`Sm\/e0Z\/CEW<|vRwOl}qbR!nzA-D>X%eKGcV2E');\ndefine('LOGGED_IN_SALT',   'GBp!7=U*T~#-%Ly?FnS$qgYEzGnX1w3!Bo_ ]$o]EDj{wh,fe1NJK9VkI_n ;hTD');\ndefine('NONCE_SALT',       'fdTm,$h?vjzLS(yMKj!rR]0aZ*f(Q(\/t|cS|;o)%{GqCK4IxG-+fyL_Yan~ns4XF');<\/code><\/pre>\n\n\n\n

Save the configuration and quit.<\/p>\n\n\n\n

The WordPress configuration files should be owned the Web Server user. In this guide, we are using the default web server user, www-data<\/strong>. <\/p>\n\n\n\n

chown -R www-data:www-data \/var\/www\/html\/kifarunix-demo<\/code><\/pre>\n\n\n\n

Finalize WordPress installation on Debian 10 Buster<\/h3>\n\n\n\n

The backend setup is done. Now to complete the installation of WordPress, navigate the browser and access WordPress using the address, http:\/\/<server-domain_OR_IP><\/strong>.<\/p>\n\n\n

\n
\"Install<\/a><\/figure><\/div>\n\n\n

Choose the installation language and proceed.<\/p>\n\n\n\n

Next, set your Site title, username, password, email address and whether or not to allow search engines to index your website.<\/p>\n\n\n

\n
\"configuring<\/a><\/figure><\/div>\n\n\n

Once you done, click install WordPress.<\/p>\n\n\n\n

A WordPress successful installation with login prompt opens up. Click login and supply your username\/email and password.<\/p>\n\n\n\n

\"WordPress<\/a><\/figure>\n\n\n\n

After successful authentication, you will land on WordPress dashboard.<\/p>\n\n\n\n

\"WordPress<\/a><\/figure>\n\n\n\n

There you go. You have successfully installed WordPress 5 with Nginx on Debian 10 Buster.<\/p>\n\n\n\n

Other Tutorials;<\/h3>\n\n\n\n

Install WordPress 5 with Nginx on Fedora 30\/Fedora 29<\/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 and Use WPScan WordPress Vulnerability Scanner Ubuntu 18.04<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

In this guide, we are going to learn how to install WordPress 5 with Nginx on Debian 10 Buster. Are you using WordPress and looking<\/p>\n","protected":false},"author":1,"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":[1039,229,1047,1048],"class_list":["post-3735","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","category-wordpress","tag-debian-10-buster","tag-nginx","tag-wordpress","tag-wordpress-5-2-2","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\/3735"}],"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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=3735"}],"version-history":[{"count":7,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3735\/revisions"}],"predecessor-version":[{"id":21171,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3735\/revisions\/21171"}],"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=3735"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=3735"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=3735"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}