创建 wordpress 要用的数据库,这里 mysql 就也不再创建用户了,直接用 root,把密码设置复杂点。
1 2 3 4 5
mysql -u root -p
CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; GRANT ALL ON wordpress.* TO ‘root’@‘localhost' IDENTIFIED BY ‘root’;*FLUSH PRIVILEGES; EXIT;
server { listen 80 default_server; listen 198.199.119.75 default_server;
root /var/www/html;
# Add index.php to the list if you are using PHP index index.php index.html index.htm index.nginx-debian.html;
server_name _;
location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. # try_files $uri $uri/ =404; try_files $uri $uri/ /index.php$is_args$args; }
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location \.php$ { include snippets/fastcgi-php.conf;
# \# With php7.0-cgi alone: fastcgi_pass 127.0.0.1:9000; # \# With php7.0-fpm: # fastcgi_pass unix:/run/php/php7.0-fpm.sock; }
完成,然后就是把 nginx 加上压缩,加上 https,再加上那个 google analytics 就齐活了,一个网站就搞定了,要做外贸电商也很容易,woocommerce 插件一装,paypal 配置好,上架商品,就行了。做码农真的容易被限制思维方式,其实想做任何东西,都有现成的工具可以用,只要整合就行了。
参考链接
[How To Install WordPress with LEMP on Ubuntu 16.04 | DigitalOcean][2] [Installing Nginx with PHP 7 and MySQL 5.7 (LEMP) on Ubuntu 16.04 LTS][3] [How to Fix the Missing MySQL Extension Error in WordPress – RoseHosting Blog][4]