已有的基础:
1)域名和服务器绑定
2)SSL数字证书的验证
3)域名备案
4)域名和IP的解析操作
下述的操作:
lnmp安装:(Linux下的一种服务器架构。Nginx/MySQL/PHP)下载地址https://lnmp.org/download.html
Nginx说明:https://www.cnblogs.com/wcwnina/p/8728391.html
两种管理及配置服务器的操作二选一:
(1)宝塔软件的使用:http://docs.bt.cn/424211 在上面进行lnmp安装和wordpress安装很方面
宝塔软件登录http://39.105.213.64:8888/login
(2)2.1xftp(负责对文件进行上传和下载,管理很方便)、xshell(负责和云服务器进行连接交互、以及相应命令的实现)的使用
使用的xftp5:下载地址https://download.csdn.net/download/gzyftk/10196193
xshell5:下载地址https://download.csdn.net/download/u012500868/10393675
通过红色部分的按钮实现新建xftp进行数据的传输,自动连接
2.2 使用xshell实现lnmp安装
2.3 使用xshell实现wordpress安装
2.4 使用shell实现mysql的管理
下面为使用第二种方法也即是xftp和xshell进行配置管理出现的问题汇总:(在该博主的基础上https://cuijiahua.com/blog/2018/10/website-20.html操作)
1.sql服务器无法登陆(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES))
参考:【1】关于问题 mysql"Access denied for user root@localhost" 的解决办法 https://blog.csdn.net/hgq_csdn/article/details/53728451
1)mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
2)mysql -u root mysql
3) select host,user,password from user;
4) delete from user where host <> 'localhost';
5)update user set password=password('*****');
6) quit; 退出
7) mysql -uroot -p***** 登录
2.nigx配置完成后出现打开界面显示404 niginx
尝试:不是编码原因:https://zhangzifan.com/wordpress-can-not-login-problem.html
解决:原因是寻找的网址没有找到相关内容,为此按照
修改地址为:/root/lnmp1.5/conf下的niginx.conf进行修改(按照notepad编辑器打开)注意路径可能不对
路径可参考:https://www.cnblogs.com/yadongliang/p/8524529.html
1)在server{}下添加
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
2) 重启nginx
service nginx restart
【2】配置nginx 解决404 not found问题https://blog.csdn.net/csflvcxx/article/details/78911835中的提示在server下添加一段链接的地址并且重新nigx服务器后,再次打开网页显示正常
【3】配置nginx 解决404 not found问题 https://www.cnblogs.com/kaka666/p/10046781.html
【4】重启命令操作https://blog.csdn.net/STchaoL/article/details/79289590
3、wordpress最后的安装步骤
参考:https://cuijiahua.com/blog/2018/10/website-20.html
出现问题:显示失败
只要将下图的127.0.0.1修改为localhost。同时重新启动myspl服务器
成功!
搭建完成的结果:
4、重新安装wordpress提示之前已经安装,如何卸载?并以域名的方式进行安装
1) 需要删除wordpress数据表和相应的用户名等配置
删除目录下的wp-config.php 参考:【1】https://jingyan.baidu.com/article/cdddd41c80065f53cb00e115.html
【2】 https://zhidao.baidu.com/question/517759780.html提示在 web目录下,我在/home/wwwroot/目录下也能删除也能实现?
【3】您的WordPress看起来已经安装妥当.如果想重新安装,请删除数据库中的旧数据表https://www.5dzone.com/73.html提示在wordpress根目录下也即是在/home/wwwroot/目录下实现。
2) 涉及mysql的数据表的操作:
查看数据库:
mysql>use wordpress;
mysql> SHOW DATABASES;
删除数据库表:
mysql> DROP TABLE wp_users 参考:http://www.runoob.com/mysql/mysql-drop-tables.html
删除数据库:
mysql> drop database wordpress;参考:http://www.runoob.com/mysql/mysql-drop-database.html
注意:使用的命令drop 、delete、 truncate的区别:drop全部删除,delete删除表内部分数据,truncate删除所有记录但保留表
创建数据库:
mysql> create DATABASE RUNOOB;参考:http://www.runoob.com/mysql/mysql-create-database.html
创建数据表:
mysql> CREATE TABLE runoob_tbl(
-> runoob_id INT NOT NULL AUTO_INCREMENT,
-> runoob_title VARCHAR(100) NOT NULL,
-> runoob_author VARCHAR(40) NOT NULL,
-> submission_date DATE,
-> PRIMARY KEY ( runoob_id )
-> )ENGINE=InnoDB DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.16 sec)
参考http://www.runoob.com/mysql/mysql-create-tables.html
5、修改域名重装wordpress后出现,域名依然指向别的域名
知更鸟上的begin模板出现的问题:解决方法
conf文件把里面非绑定域名删除或者把自己的域名加到里面
注意查找的是user/local/nginx/nginx.conf 路径下的nginx.conf文件并配置:
操作如下:
1)使用vim打开该配置文件:vim /usr/local/nginx/conf/nginx.conf
或者在上述的目录下使用本地电脑的notepate打开,编辑保存
2)修改的内容在server下的
2.1server_name 后面添加自己的域名
2.2将root /home/wwwroot/defaut修改
修改如下:
server
{
listen 80 default_server;
#listen [::]:80 default_server ipv6only=on;
server_name www.heguangqiang.com heguangqiang.com;
index index.html index.htm index.php;
root /home/wwwroot/wordpress;
#error_page 404 /404.html;
【1】参考该博主:https://www.cnblogs.com/yadongliang/p/9212831.html
【2】该文件niginx.conf的详细配置为:https://blog.csdn.net/xy2204/article/details/45967183
Nginx安装及配置文件nginx.conf详解 http://www.cszhi.com/20120513/nginx_nginx-conf.html
【3】https://cuijiahua.com/blog/2018/10/website-20.html
区分linux的目录结构
修改的时候有两个目录,目录1:user/local/nginx/nginx.conf
目录2:/root/lnmp1.5/conf/nginx.conf 。
修改的目录1有效,修改目录2无效。
命令/可以查看全部目录结构
ls适合查看当前路径下的文件
cd指令操作:
cd -:返回之前的目录
cd ..:返回到上一级目录 “.”表示当前目录,“..”表示上一级目录
cd ~:到用户所在的家目录
创建文件:
创建一个文件: touch 文件名
参考:
【1】Linux---查看文件目录和目录结构https://blog.csdn.net/pengzhisen123/article/details/79833474
【2】各目录的详细说明
Linux目录结构及功能https://blog.csdn.net/EthanGuo1985/article/details/50612594
https://blog.csdn.net/Tian_Luo_Girl/article/details/79768308
【3】window目录和linux目录的区别https://blog.csdn.net/PythonCodeZ/article/details/70941613
补充linux操作和编辑器vim的使用
vim使用参考:vim从入门到放弃 https://blog.csdn.net/sumword_/article/details/53011463
编辑器notepate++:下载地址https://notepad-plus-plus.org/download/v7.6.6.html
后续:网站的防御:https://www.bt.cn/bbs/thread-9562-1-1.html
修改SSH端口https://www.cnblogs.com/freeweb/p/5667166.html
基于python+flask搭建交互式网站https://download.csdn.net/download/oschina_39891353/9942995