• Home
  • WordPress
  • web Hosting
    • Free hosting
    • Cheap Hosting
    • comparison cloud , vps, shared, wordpress
    • managed wordpress hosting
    • managed cloud hosting
  • page Speed
  • Deals
  • Services
  • About

RAaz Kumar .com

wordpress tutorials seo hosting etc


install wordpress on ubuntu nginx lemp command line apache debian

install wordpress on ubuntu command line for nginx and apache lamp & lemp stack.

prerequisites install WordPress on ubuntu

installed lemp server i.e lnixu, nginx mysql, php-fpm
a.create database
part 1: use Shell script to install WordPress
Part 2: & add database details
Part 3: configure nginx server block for new website root directory
Part 4: access installation from website browser /wp-install.php or /wp-admin/
also check clone wordpress on linux command line

how to install wordpress on ubuntu  LEMP nginx

sudo apt install nginx
sudo apt install mysql-server
sudo apt install php-pear php-fpm php-dev php-zip php-curl php-xmlrpc php-gd php-mysql php-mbstring php-xml sudo service nginx restart
check browser and then follow wp installation
//  Take care of errors
LEMP install on ubuntu
Start here if already have live server.

Creation mysql database from command line – install wordpress on ubuntu 

step 1 create database

mysql -u username -p  u=useranme p=passowrd
mysql -u root -p enter this command and enter sql password.
Step 2 create database dbname;
 
CTRL+C to exit mysql

step 2Add permission to mysql user (if necessary)

 
For mysql root no need to assign privileges.
 
grant usage on *.* to username@localhost identified by ‘password’;
grant all privileges on dbname.* to username@localhost;

 Starts here install wordpress on ubuntu (Apache / nginx  Debian)

 

step 1: create new directory – install wordpress on ubuntu

1.a create new directory

sudo mkdir /var/www/html/yourwebsitedirectory.com

1.b change permission to 755  (opiontal_

Note By default newly created permissions will be 755
chmod -R 755 /home/pubclubindia/epf/burnbelly.in

1.c Navigate to the directory

cd /var/www/html/yourwebsitedirectory.com

step 2: Download WordPress & Unzip  – install wordpress on ubuntu 

2.1a download the WordPress from below file by command line directly
wget https://wordpress.org/latest.tar.gz

root@localhost:/var/www/html/files# wget https://wordpress.org/latest.tar.gz
–2021-07-14 10:21:12– https://wordpress.org/latest.tar.gz
Resolving wordpress.org (wordpress.org)… 198.143.164.252
Connecting to wordpress.org (wordpress.org)|198.143.164.252|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 15750424 (15M) [application/octet-stream]
Saving to: ‘latest.tar.gz’

latest.tar.gz 100%[===================>] 15.02M 5.86MB/s in 2.6s

2021-07-14 10:21:16 (5.86 MB/s) – ‘latest.tar.gz’ saved [15750424/15750424]

step 2.a unzip tar wordpress zip on ubutu commandline

tar xfz latest.tar.gz
By default WordPress extracts in WordPress folder. then you have to move top level folder

step 3:  Move files top directory from wordpress folder.

mv wordpress/* ./

step 4: Delete folder and zip archive – install wordpress on ubuntu

rmdir ./wordpress/
rm -f latest.tar.gz

The shortcut or Shell Script

sudo mkdir /var/www/html/yourwebsitedirectory.com && cd /var/www/html/yourwebsitedirectory.com && wget https://wordpress.org/latest.tar.gz && tar xfz latest.tar.gz && mv wordpress/* ./ && rmdir ./wordpress/ && rm -f latest.tar.gz
copy to notepad find and replace yourwebsitedirectory.com to yourwebsite.com

If you created database already

sudo mkdir /var/www/html/yourwebsitedirectory.com && cd /var/www/html/yourwebsitedirectory.com && wget https://wordpress.org/latest.tar.gz && tar xfz latest.tar.gz && mv wordpress/* ./ && rmdir ./wordpress/ && rm -f latest.tar.gz && mv wp-config-sample.php wp-config.php && sudo nano ./wp-config.php
 DON’T FORGET change ownership server user either nginx or www-data apche2
sudo chown www-data:www-data -R /var/www/html/yourwebsitedirectory.com
 
 ex: sudo chown www-data:www-data -R /var/www/html/stories
 

rename & Edit WordPress wp-config.php ubtunu

 

rename

mv wp-config-sample.php wp-config.php

 

 
added db details.
 
 
sudo nano ./wp-config.php
 
 
by deaflut wp-config.php not present in new install
we have added changes to wp-config-sample.php
visit the website in browser and add site tile and install. you can do it without adding DB details in wp-confing php also.
https://youtu.be/Q4uHhuwKZQQ

 

make sure change permissions before installing a plugin..

also you can copy existing plugins & themes other website in same server.

all

cp source to destination  more at CP command

cp -r /var/www/html/wordpress1.in/wp-content/themes/* /var/www/html/woprdpress2.com/wp-content/themes/

cp -r /var/www/html/wordpress1.in/wp-content/plugins/* /var/www/html/woprdpress2.com/wp-content/plugins/

to verify

ls – l /var/www/html/woprdpress2.com/wp-content/themes/

single

cp -r /var/www/html/wordpress1.in/wp-content/plugins/pluginname /var/www/html/woprdpress2.com/wp-content/plugins/pluginname

 

change ownership of wordpress directory root server user (imp)

 

 

sudo chown -R www-data:www-data /var/www/html/files/

 

sudo chown -R jagdisshanandh:jagdisshanandh /var/www/*

 

3rd way fast nginx shell script install wordpress on ubuntu

Part 1 DB creation part

1.mysql -u root -prootpass -e “create database dbname;”

user creation example below:

sudo mysql -e “CREATE USER ‘datadog’@’localhost’ IDENTIFIED BY ‘h3ub7BmyGv UL5TskBFlG9rF’;”
mysql -u root -prootpasss -e “CREATE USER ‘datadog’@’localhost’ IDENTIFIED BY ‘h3ub7BmyGv UL5TskBFlG9rF’;”

Part 2 wp & db details add

sudo mkdir /var/www/html/website.com && cd /var/www/html/website.com && wget https://wordpress.org/latest.tar.gz && tar xfz latest.tar.gz && mv wordpress/* ./ && rmdir ./wordpress/ && rm -f latest.tar.gz && mv wp-config-sample.php wp-config.php && sudo nano ./wp-config.php

b. Change database details c. save file and exit by (CTRLX+X and Then type and Press Enter)

tail /var/log/nginx/error.log

Part 3 server block domain to directory setup for nginx

cat >/etc/nginx/sites-enabled/website <<EOF
server {
listen 80;
root /var/www/html/website/;
server_name website.com www.website.com;
include /etc/nginx/conf.d/global.config; #remaining info
}
EOF

website = website directory

cat >/etc/nginx/sites-enabled/files <<EOF
server {
listen 443;
root /var/www/html/files/;
server_name file.sarkariresult.in;
include /etc/nginx/conf.d/global.config;
}
EOF

incase ssl https nginx server block configuration

cat >/etc/nginx/sites-enabled/website.com<<EOF
server {
listen 443;
root /var/www/html/website.com/;
server_name website.com www.website.com;
ssl_certificate /etc/nginx/ssl/certname.pem;
ssl_certificate_key /etc/nginx/ssl/certname.key;
location / {

try_files $uri $uri/ /index.php?$args;

}

location ~ \.php$ {

 

include snippets/fastcgi-php.conf;

#fastcgi_pass unix:/run/php/php7.2-fpm.sock;

fastcgi_pass 127.0.0.1:9000;

}
}
EOF

also nginx server block explained

verify and reload the server

nginx -t && nginx -s reload

 

etc/nginx/sites-enabled/yourdesiredname

Create or upload ssl certificates to a folder and point theme more at nginx ssl certificate configuration

above code

nano /etc/nginx/ssl/certname.pem

//add code and save

nano /etc/nginx/ssl/certname.key

global.config; need to edit o directly above for php settings

 

 

//ln -s /etc/nginx/sites-available/website.com /etc/nginx/sites-enabled/website.com

chown www-data:www-data -R /var/www/html/

Point domain IP to Server IP.

wordpress nginx server block sample

server {
            listen 80;
            root /var/www/html/wordpress/public_html;
            index index.php index.html;
            server_name SUBDOMAIN.DOMAIN.TLD;

	    access_log /var/log/nginx/SUBDOMAIN.access.log;
    	    error_log /var/log/nginx/SUBDOMAIN.error.log;

            location / {
                         try_files $uri $uri/ =404;
            }

            location ~ \.php$ {
                         include snippets/fastcgi-php.conf;
                         fastcgi_pass unix:/run/php/php7.2-fpm.sock; #8.1 php version or tcp port
            }
            
            location ~ /\.ht {
                         deny all;
            }

            location = /favicon.ico {
                         log_not_found off;
                         access_log off;
            }

            location = /robots.txt {
                         allow all;
                         log_not_found off;
                         access_log off;
           }
       
            location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
                         expires max;
                         log_not_found off;
           }
}


sample 2


# Redirect HTTP -> HTTPS
server {
listen 80;
server_name www.sample.com sample.com;

include snippets/letsencrypt.conf;
return 301 https://sample.com$request_uri;
}

# Redirect WWW -> NON-WWW
server {
listen 443 ssl http2;
server_name www.sample.com;

ssl_certificate /etc/letsencrypt/live/sample.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/sample.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/sample.com/chain.pem;
include snippets/ssl.conf;

return 301 https://sample.com$request_uri;
}

server {
listen 443 ssl http2;
server_name sample.com;

root /var/www/html/sample.com;
index index.php;

# SSL parameters
ssl_certificate /etc/letsencrypt/live/sample.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/sample.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/sample.com/chain.pem;
include snippets/ssl.conf;
include snippets/letsencrypt.conf;

# log files
access_log /var/log/nginx/sample.com.access.log;
error_log /var/log/nginx/sample.com.error.log;

location = /favicon.ico {
log_not_found off;
access_log off;
}

location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}

location / {
try_files $uri $uri/ /index.php?$args;
}

location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}

location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires max;
log_not_found off;
}
}

Related topics:

  1. nginx conf explained best config file performance tuning tips nginx.conf location errors tutorial
  2. Abs workouts
  3. improve mysql performance wordpress my.cnf file configuration
  4. Pubg new season rewards & leaks updates & latest news
  5. mysql commands

wordpress tutorials for beginners advanced complete guide to run WordPress

  • Lazy Load Adsense to improve core web vitals - Vs revenue
  • W3TC w3 total cache plugin setup guide review comparison with wp rocket and wp super cache
  • Wordpress database optimization (don't neglect) plugins & phpmyadmin manually
  • Optimize css delivery inline critical css, remove unused css, render blocking css
  • Converting WordPress into static website speed after 1 second dynamic 3 seconds
  • Wordpress errors and fix
  • Rules to get 100/100 in Google pagespeed web core vitalsscore
  • Install xamp & wordpress on localhost windows
  • favicon ico Change / Add / Disable favicon in wordpress Ft Genesis Theme or any theme
  • increase wordpress memory limit (how to ) 40MB , 64 MB 128 MB or 512 MB maybe 1024MB
  • wp cron job check working or not disable enable change schedule
  • google analytics plugins for wordpress #sitekit #monsterinsights gadwp back as gainwp
  • enable browser caching in wordpress apache nginx caching headers explained
  • xmlrpc php wordpress uses, disable without 403 error log message
  • wordpress change post date programmatically (auto on update like blogger
  • sorry you are not allowed to access this page. admin WordPress options table
  • clone wordpress in linux ubuntu server lemp nginx
  • Cloudflare cache rules for WordPress along with page rules cache level everything
  • wordfence-waf.php fatal error fixed after migration
  • Cloudflare page rules cache level everything redirect and sub domain
  • wordpress delete all posts from database mysql query for phpmyadmin
  • php fpm oom killer problem how to dig it.. memory pool and execution time
  • nginx wordpress multisite subdirectory
  • Wordpress duplicate thin content Issues {FIXED}
  • best wordpress plugins social, seo, Backup, speed up your blog
  • TOP 10 Wordpress Themes Premium/ Free & providers
  • Wordpress Adsense Plugins & Manually
  • Social share buttons for website Wordpress Blogger
  • How to bulk delete in wordpress posts, pages, Media Images, tags and categories
  • TOP 5 Best wordpress comment plugins 2020 (disable pingback, replytocom, customize form)
  • all in one seo pack vs yoast seo pressor
  • Auto post to Facebook, twitter, Google Plus Wordpress Posts 2019
  • wordpress plugins that slow down your site and its alternatives
  • How to use wordpress tags and categories
  • wordpress speed optimization Speed up wordpress Score on Google pagespeed
  • how to increase wordpress memory & file upload size
  • combine rss feeds wordpress
  • Reduce the impact of third-party code ,optimize JS delivery, Minify, remove unused js, pre connect, inline, lazy load etc
  • change wordpress site url internal links in mysql command phpmyadmin
  • install wordpress on ubuntu nginx lemp command line apache debian
  • Wordpress Security Plugins 2021 (Brute force, Login lockdown, Malware scanner etc)
  • website cache best caching plugins wordpress w3tc cloudflare
  • How to add adsense amp ads to wordpress
  • wordpress password reset in 3 ways mail, phpmyadmin, mysql command
  • how i recovered hacked website site 5 times ft wordpress?

 

 

wordpress Pagespeed optimization

Digitalocean free $100 Credit

Cloudways Review pricing promo codes

Siteground cpu limits Pricing

Shared Hosting

Managed wordpress Hosting

Managed Hosting Cloud server

VPS Hosting

Cloud Hosting – Unmanaged

Google cloud Pricing

Aws Pricing

Azure pricing

nginx server tutorials

apache server tutorials

linux sysadmin tutorials

mysql Commands list pdf

LEMP Install Ubuntu

Mysql Performance Tuning

Nginx Performance tuning

Linux Performance tuning

Php -fpm performance tuning

Redis Performance tuning

linux server security

nginx security best practices

wordpress security plugins

 

 

wordpress

 

Top 5  WP Google Analytics Plugins

WP Backup Plugins

Wp Comment Plugins

Top wordpress Security Plugins

WP Seo Plugins

WP Caching Plugins

Best Adsense Plugins for WordPress

Wp social Sharing Plugins

autoshare social media plugins

WP speed Optimization Plugins

Speedup WordPress google Score

More Wp tuts

Server Admin Cloud

 

Installing Nginx LEMP On ubuntu

Installing apache Lamp ubuntu

nginx fastcgi cache enable

php – fpm install  & Configuration

Opcache install & Configure

php -fpm pool manager explained

Mysql Install & Configuration

Redis Object cache install & configure

 

Nginx as Reverse Proxy and Load balancer

Load Balance / auto scaling in google cloud

Linux Commands PDF

Mysql Commands Pdf

Letsencrypt tutorial

mysqldump export & import 

Pagespeed Module install & configure

nginx.conf best file

mysql.conf best file

upgrade ubuntu

© 2023 - All Rights Reserved Disclaimer & Privacy Policy