天天看點

網頁搭建過程中遇到的問題

已有的基礎:

域名+雲伺服器 阿裡雲伺服器登入:https://account.aliyun.com/login/login.htm?oauth_callback=https%3A%2F%2Fecs.console.aliyun.com%2F%3Fspm%3D5176.11231235summary.902.dManageInstance.c11457e8jfSLnQ%23%2FsecurityGroupDetail%2Fregion%2Fcn-beijing%2FgroupId%2Fsg-2ze0pls976u6m8xvqono%2Finstance

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 [email protected]" 的解決辦法 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

https://download.csdn.net/download/oschina_39891353/9942995

繼續閱讀