WordPress is a free and open-source content management system (CMS) based on PHP and MySQL. To function, WordPress has to be installed on a web server, which would either be part of an Internet hosting service or a network host in its own right.
安装PHP环境
1 2 3 4 |
sudo apt-get update sudo apt-get install screen screen -S wp wget -c http://soft.vpser.net/lnmp/lnmp1.4.tar.gz && tar zxf lnmp1.4.tar.gz && cd lnmp1.4 && ./install.sh lnmp |
配置设置(要记住数据库密码后面连接要用):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
+------------------------------------------------------------------------+ | LNMP V1.4 for Ubuntu Linux Server, Written by Licess | +------------------------------------------------------------------------+ | A tool to auto-compile & install LNMP/LNMPA/LAMP on Linux | +------------------------------------------------------------------------+ | For more information please visit https://lnmp.org | +------------------------------------------------------------------------+ You have 5 options for your DataBase install. 1: Install MySQL 5.1.73 2: Install MySQL 5.5.56 (Default) 3: Install MySQL 5.6.36 4: Install MySQL 5.7.18 5: Install MariaDB 5.5.56 6: Install MariaDB 10.0.30 7: Install MariaDB 10.1.23 0: DO NOT Install MySQL/MariaDB Enter your choice (1, 2, 3, 4, 5, 6, 7 or 0): No input,You will install MySQL 5.5.56 =========================== Please setup root password of MySQL.(Default password: root) Please enter: MySQL root password: root =========================== Do you want to enable or disable the InnoDB Storage Engine? Default enable,Enter your choice [Y/n]: y You will enable the InnoDB Storage Engine =========================== You have 6 options for your PHP install. 1: Install PHP 5.2.17 2: Install PHP 5.3.29 3: Install PHP 5.4.45 4: Install PHP 5.5.38 (Default) 5: Install PHP 5.6.31 6: Install PHP 7.0.21 7: Install PHP 7.1.7 Enter your choice (1, 2, 3, 4, 5, 6 or 7): No input,You will install PHP 5.5.38 =========================== You have 3 options for your Memory Allocator install. 1: Don't install Memory Allocator. (Default) 2: Install Jemalloc 3: Install TCMalloc Enter your choice (1, 2 or 3): No input,You will not install Memory Allocator. Press any key to install...or Press Ctrl+c to cancel |
等待几十分钟至几个小时才能编译安装完成。
创建虚拟机
1 |
lnmp vhost add |
运行命令,要记住数据库表名,账号,密码,安装wordpress会用到。最好再选择SSL安装。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
root@ubuntu-2gb-sfo1-01:~# lnmp vhost add +-------------------------------------------+ | Manager for LNMP, Written by Licess | +-------------------------------------------+ | https://lnmp.org | +-------------------------------------------+ Please enter domain(example: www.lnmp.org): www.shui.com Your domain: www.shui.com Enter more domain name(example: lnmp.org *.lnmp.org): shui.com domain list: shui.com Please enter the directory for the domain: www.shui.com Default directory: /home/wwwroot/www.shui.com: Virtual Host Directory: /home/wwwroot/www.shui.com Allow Rewrite rule? (y/n) y Please enter the rewrite of programme, wordpress,discuz,typecho,sablog,typecho rewrite was exist. (Default rewrite: other): wordpress You choose rewrite: wordpress Allow access log? (y/n) y Enter access log filename(Default:www.shui.com.log): You access log filename: www.shui.com.log Create database and MySQL user with same name (y/n) y Enter current root password of Database (Password will not shown): OK, MySQL root password correct. Enter database name: newblog Your will create a database and MySQL user with same name: newblog Please enter password for mysql user newblog: newblog Your password: newblog Add SSL Certificate (y/n) y 1: Use your own SSL Certificate and Key 2: Use Let's Encrypt to create SSL Certificate and Key Enter 1 or 2: 2 Please enter your email address: test@qq.com It will be processed automatically. Press any key to start create virtul host... |
安装wordpress
安装完成后,切换到网站域名目录下/home/wwwroot/www.shui.com,安装wordpress。
1 2 3 4 5 6 7 |
cd /home/wwwroot/www.shui.com wget https://cn.wordpress.org/wordpress-4.8.1-zh_CN.tar.gz tar -xzvf wordpress-4.8.1-zh_CN.tar.gz mv * ../ cd ../ rm -r wordpress rm wordpress-4.8.1-zh_CN.tar.gz |
之后访问域名https://www.shui.com(最好用HTTPS网址进行配置),进行最后的配置。
Intimately, the article is in reality the greatest on this precious topic. I agree with your conclusions and can thirstily look forward to your coming updates. Just saying thanks can not just be enough, for the phenomenal lucidity in your writing. I will certainly at once grab your rss feed to stay informed of any updates. Fabulous work and much success in your business dealings!