How to set up wordpress at digitalocean, a practical protocol

If you choose $5 droplet at digitalocean, wordpress can’t be set up in an easy way, you must do it by your own. It’s easy to find these two links, but there are a lot of unsolved problems.

First install ubuntu 16.04

then

ii dbconfig-mysql 
ii libmysqlclient-dev 
ii libmysqlclient20:amd64
ii mysql-client 
ii mysql-client-5.7 
ii mysql-client-core-5.7 
pi mysql-common 
ii mysql-server 
ii mysql-server-5.7 
ii mysql-server-core-5.7 
ii php-mysql 
ii php7.0-mysql 


ii php-common 
ii php-fpm 
ii php-gd 
ii php-gettext 
ii php-mbstring 
ii php-mcrypt 
ii php-mysql 
ii php-pear 
ii php-phpseclib 
ii php-readline 
ii php-ssh2 
ii php-tcpdf 
ii php-xml 
ii php7.0-cli 
ii php7.0-common 
ii php7.0-fpm 
ii php7.0-gd 
ii php7.0-json 
ii php7.0-mbstring 
ii php7.0-mcrypt 
ii php7.0-mysql 
ii php7.0-opcache 
ii php7.0-phpdbg 
ii php7.0-readline 
ii php7.0-xml 
ii phpmyadmin

ii nginx 
ii nginx-common 
ii nginx-core

through

apt install "above packages"

https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-in-ubuntu-16-04

https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-nginx-on-ubuntu-14-04

How to connect nginx to php?

Find out the if exists

/tmp/php-cgi.sock
or 
/run/php/php7.0-fpm.sock;

set it up as 

location ~ \.php$ {

                include fastcgi.conf;

                fastcgi_pass unix:/tmp/php-cgi.sock;

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

                fastcgi_index index.php;

                include /etc/nginx/fastcgi_params;

        }

Why my php file shows blank?

in /etc/nginx/fastcgi_params add
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

otherwise you will receive a blank white screen
when accessing any PHP scripts.

How does nginx connect to mysql? 

https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-nginx-on-ubuntu-14-04

Why the browser download index.php instead of opening? 

in /etc/nginx/sites-enabled/wordpress

        location ~ \.php$ {

                include fastcgi.conf;

                fastcgi_pass unix:/tmp/php-cgi.sock;

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

                fastcgi_index index.php;

                include /etc/nginx/fastcgi_params;

        }

        index index.php;

put

index index.php; below fastcgi_pass section, otherwise index.php can not be handled through fastcgi

Why chrome still download index.php after above setup? 

in settings, clear the cache of files and images

How do I know if mysql works fine? 

service mysql status

Why I can not log in to phpmyadmin? 

log in with user name : wordpressuser and your password

How to log into wordpress? How to change the default password? 

in phpmyadmin

in user_pass, use the dropdown menu MD5, set up new password, then save Go.

How to insert my google adsense? 

use Plugins -> install plugins -> Easy Adsense

then in settings, you will find Easy adsense.

 

Posted in IT

Leave a Reply

Your email address will not be published. Required fields are marked *