Heim  >  Artikel  >  Backend-Entwicklung  >  Erstellen Sie einen persönlichen Blog mit WordPress

Erstellen Sie einen persönlichen Blog mit WordPress

小云云
小云云Original
2018-03-22 14:05:335979Durchsuche

In diesem Artikel erfahren Sie hauptsächlich, wie Sie mit WordPress einen persönlichen Blog erstellen. Ich hoffe, er kann Ihnen helfen.

1 LNMP-Kombination

1.1 Überprüfen Sie die Konnektivität von Nginx zu PHP

Alle Umgebungen wurden in den vorherigen Blogbeiträgen konfiguriert, testen wir Nginx und die Verbindung zwischen PHP

LNMP Nginx-Dienstaufbau und drei Arten von virtuellen Hosts
LNMP-Binärinstallation MySQL-5.5.54
LNMP-Quellcode-Kompilierung und Installation PHP- 5.5.32

# 修改/application/nginx/conf/extra/blog.conf[root@web01 extra]# cat blog.conf
    server {        listen       80;
        server_name  blog.rsq.com;
        location / {
            root   html/blog;            index  index.html index.htm;
        }
        location ~ .*\.(php|php5)?$ {
            root html/blog;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        include fastcgi.conf;
        }
    }# 重启nginx服务[root@web01 extra]# ../../sbin/nginx -tnginx: the configuration file /application/nginx-1.6.3//conf/nginx.conf syntax is ok
nginx: configuration file /application/nginx-1.6.3//conf/nginx.conf test is successful
[root@web01 extra]# ../../sbin/nginx -s reload# 在/application/nginx/html/blog/目录中写一个Erstellen Sie einen persönlichen Blog mit WordPress文件,测试连通性[root@web01 extra]# cd /application/nginx/html/blog/[root@web01 blog]# echo "<?php Erstellen Sie einen persönlichen Blog mit WordPress(); ?>" >test_info.php[root@web01 blog]# cat test_info.php<?php Erstellen Sie einen persönlichen Blog mit WordPress(); ?>

# Führen Sie den Zugriffstest im Windows-Browser durch. Wenn die folgende Seite erscheint, ist der Test erfolgreich
Erstellen Sie einen persönlichen Blog mit WordPress

1.2 Überprüfen Sie die Konnektivität von PHP nach MySQL

# 写一个简单的数据库连接脚本[root@web01 blog]# cat test_mysql.php<?php
    $link_id=mysql_connect(&#39;localhost&#39;,&#39;root&#39;,&#39;oldboy123&#39;) or mysql_error();    if($link_id){        echo "Mysql successful by RSQ !";
    }else{        echo mysql_error();
    }?>

# Browserseitiger Test
Erstellen Sie einen persönlichen Blog mit WordPress

2 LNMP WordPress Persönlicher Blog-Aufbau

2.1 Erstellen WordPress-Datenbank

# 先登录mysql,创建WordPress所需要的数据库
[root@web01 ~]# mysql -uroot -poldboy123mysql> show databases;
+--------------------+| Database           |
+--------------------+| information_schema |
| mysql              |
| performance_schema || test               |
+--------------------+4 rows in set (0.01 sec)

mysql> drop database test;          # 删除多余的test数据库
Query OK, 0 rows affected (0.02 sec)mysql> show databases;          #显示数据库
+--------------------+| Database           |
+--------------------+| information_schema |
| mysql              |
| performance_schema |+--------------------+3 rows in set (0.00 sec)

mysql> create database wordpress;           # 创建wordpress用户
Query OK, 1 row affected (0.00 sec)mysql> show databases;
+--------------------+| Database           |
+--------------------+| information_schema |
| mysql              |
| performance_schema || wordpress          |
+--------------------+4 rows in set (0.00 sec)mysql> select user();
+----------------+| user()         |
+----------------+| root@localhost |
+----------------+1 row in set (0.00 sec)mysql> select user,host from mysql.user;        #查看当前数据库用户
+------+-----------+| user | host      |
+------+-----------+| root | 127.0.0.1 |
| root | ::1       |
|      | localhost || root | localhost |
+------+-----------+4 rows in set (0.00 sec)

# 为wordpress数据库创建专门管理的wordpress用户并授予所有权限
mysql> grant all on wordpress.* to wordpress@&#39;localhost&#39; identified by &#39;123456&#39;;        
Query OK, 0 rows affected (0.00 sec)mysql> select user,host from mysql.user;    # 查看wordpress数据库用户是否创建
+-----------+-----------+| user      | host      |
+-----------+-----------+| root      | 127.0.0.1 |
| root      | ::1       |
|           | localhost |
| root      | localhost || wordpress | localhost |
+-----------+-----------+5 rows in set (0.00 sec)
mysql> show grants for wordpress@&#39;localhost&#39;;   # 查看指定用户所具有的权限
mysql> flush privileges;        # 刷新一下,使用户权限生效
Query OK, 0 rows affected (0.00 sec)
2.2 Ändern Sie die Konfigurationsdatei blog.conf

# blog.conf配置文件中index新增index.html[root@web01 extra]# cat blog.conf 
    server {
        listen       80;
        server_name  blog.rsq.com;
        location / {
            root   html/blog;
            index  index.php index.html index.htm;
        }
        location ~ .*\.(php|php5)?$ {
            root html/blog;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        include fastcgi.conf;
        }
    }
[root@web01 tools]# /application/nginx/sbin/nginx -t nginx: the configuration file /application/nginx-1.6.3//conf/nginx.conf syntax is oknginx: configuration file /application/nginx-1.6.3//conf/nginx.conf test is successful
[root@web01 tools]# /application/nginx/sbin/nginx -s reload
2.3 Laden Sie das WordPress-Softwarepaket herunter

# Überprüfen Sie zuerst die offizielle Website. Unterstützte Plug-Ins in Versionen
Erstellen Sie einen persönlichen Blog mit WordPress

# 去官网下载最新的wordpress软件包[root@web01 extra]# cd /home/oldboy/tools/[root@web01 tools]# wget https://cn.wordpress.org/wordpress-4.9.4-zh_CN.tar.gz# 解压缩[root@web01 tools]# tar -xf wordpress-4.9.4-zh_CN.tar.gz# 拷贝wordpress目录下的所有内容到/application/nginx/html/blog/目录下[root@web01 tools]# cp -a wordpress/* /application/nginx/html/blog/[root@web01 tools]# ls /application/nginx/html/blog/index.php        wp-blog-header.php    wp-includes        wp-settings.phplicense.txt      wp-comments-post.php  wp-links-opml.php  wp-signup.phpreadme.html      wp-config-sample.php  wp-load.php        wp-trackback.phpwp-activate.php  wp-content            wp-login.php       xmlrpc.phpwp-admin         wp-cron.php           wp-mail.php# 授予权限,先暂时授予所有文件,以后再调整权限[root@web01 tools]# chown -R www.www /application/nginx/html/blog/
2.4 Webseiteninstallation WordPress

# Client-Hosts-Datei muss analysiert werden

Erstellen Sie einen persönlichen Blog mit WordPress

Erstellen Sie einen persönlichen Blog mit WordPress

Erstellen Sie einen persönlichen Blog mit WordPress

Erstellen Sie einen persönlichen Blog mit WordPress

Erstellen Sie einen persönlichen Blog mit WordPress

Erstellen Sie einen persönlichen Blog mit WordPress

Erstellen Sie einen persönlichen Blog mit WordPress

Erstellen Sie einen persönlichen Blog mit WordPress

——————————————ENDE!

Verzeichnis



  • 1 LNMP-Kombination

    • 1.1 Überprüfen Sie die Konnektivität von Nginx zu PHP

    • 1.2 Überprüfen Sie die Konnektivität von PHP zu MySQL

  • 2 LNMP für WordPress Erstellen Sie eine persönliche Blog

    • 2.1 Erstellen Sie eine WordPress-Datenbank

    • 2.2 Ändern Sie die blog.conf-Konfigurationsdatei

    • 2.3 Laden Sie das WordPress-Softwarepaket herunter

    • 2.4 Installieren Sie WordPress auf der Webseite

1 LNMP-Kombination

1.1 Verifizierung der Konnektivität von Nginx zu PHP

Alle Umgebungen wurden in den vorherigen Blogbeiträgen konfiguriert. Testen wir die Konnektivität zwischen Nginx und PHP

LNMP Nginx-Dienstkonstruktion und drei Arten von virtuellen Hosts

LNMP-Binärinstallation MySQL-5.5.54
LNMP-Quellcode-Kompilierung und Installation PHP-5.5.32

# 修改/application/nginx/conf/extra/blog.conf[root@web01 extra]# cat blog.conf
    server {        listen       80;
        server_name  blog.rsq.com;
        location / {
            root   html/blog;            index  index.html index.htm;
        }
        location ~ .*\.(php|php5)?$ {
            root html/blog;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        include fastcgi.conf;
        }
    }# 重启nginx服务[root@web01 extra]# ../../sbin/nginx -tnginx: the configuration file /application/nginx-1.6.3//conf/nginx.conf syntax is ok
nginx: configuration file /application/nginx-1.6.3//conf/nginx.conf test is successful
[root@web01 extra]# ../../sbin/nginx -s reload# 在/application/nginx/html/blog/目录中写一个Erstellen Sie einen persönlichen Blog mit WordPress文件,测试连通性[root@web01 extra]# cd /application/nginx/html/blog/[root@web01 blog]# echo "<?php Erstellen Sie einen persönlichen Blog mit WordPress(); ?>" >test_info.php[root@web01 blog]# cat test_info.php<?php Erstellen Sie einen persönlichen Blog mit WordPress(); ?>

# Führen Sie einen Zugriffstest im Windows-Browser durch. Wenn die folgende Seite angezeigt wird, ist der Test erfolgreich
Erstellen Sie einen persönlichen Blog mit WordPress1.2 Überprüfen Sie die Konnektivität von PHP zu MySQL

# 写一个简单的数据库连接脚本[root@web01 blog]# cat test_mysql.php<?php
    $link_id=mysql_connect(&#39;localhost&#39;,&#39;root&#39;,&#39;oldboy123&#39;) or mysql_error();    if($link_id){        echo "Mysql successful by RSQ !";
    }else{        echo mysql_error();
    }?>
# Browserseitiger Test


Erstellen Sie einen persönlichen Blog mit WordPress2 LNMP-WordPress-persönlicher Blog-Aufbau

2.1 WordPress-Datenbank erstellen

2.2 Änderungsblog .conf-Konfigurationsdatei
# 先登录mysql,创建WordPress所需要的数据库
[root@web01 ~]# mysql -uroot -poldboy123mysql> show databases;
+--------------------+| Database           |
+--------------------+| information_schema |
| mysql              |
| performance_schema || test               |
+--------------------+4 rows in set (0.01 sec)

mysql> drop database test;          # 删除多余的test数据库
Query OK, 0 rows affected (0.02 sec)mysql> show databases;          #显示数据库
+--------------------+| Database           |
+--------------------+| information_schema |
| mysql              |
| performance_schema |+--------------------+3 rows in set (0.00 sec)

mysql> create database wordpress;           # 创建wordpress用户
Query OK, 1 row affected (0.00 sec)mysql> show databases;
+--------------------+| Database           |
+--------------------+| information_schema |
| mysql              |
| performance_schema || wordpress          |
+--------------------+4 rows in set (0.00 sec)mysql> select user();
+----------------+| user()         |
+----------------+| root@localhost |
+----------------+1 row in set (0.00 sec)mysql> select user,host from mysql.user;        #查看当前数据库用户
+------+-----------+| user | host      |
+------+-----------+| root | 127.0.0.1 |
| root | ::1       |
|      | localhost || root | localhost |
+------+-----------+4 rows in set (0.00 sec)

# 为wordpress数据库创建专门管理的wordpress用户并授予所有权限
mysql> grant all on wordpress.* to wordpress@&#39;localhost&#39; identified by &#39;123456&#39;;        
Query OK, 0 rows affected (0.00 sec)mysql> select user,host from mysql.user;    # 查看wordpress数据库用户是否创建
+-----------+-----------+| user      | host      |
+-----------+-----------+| root      | 127.0.0.1 |
| root      | ::1       |
|           | localhost |
| root      | localhost || wordpress | localhost |
+-----------+-----------+5 rows in set (0.00 sec)
mysql> show grants for wordpress@&#39;localhost&#39;;   # 查看指定用户所具有的权限
mysql> flush privileges;        # 刷新一下,使用户权限生效
Query OK, 0 rows affected (0.00 sec)

2.3 WordPress-Softwarepaket herunterladen
# blog.conf配置文件中index新增index.html[root@web01 extra]# cat blog.conf 
    server {
        listen       80;
        server_name  blog.rsq.com;
        location / {
            root   html/blog;
            index  index.php index.html index.htm;
        }
        location ~ .*\.(php|php5)?$ {
            root html/blog;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        include fastcgi.conf;
        }
    }
[root@web01 tools]# /application/nginx/sbin/nginx -t nginx: the configuration file /application/nginx-1.6.3//conf/nginx.conf syntax is oknginx: configuration file /application/nginx-1.6.3//conf/nginx.conf test is successful
[root@web01 tools]# /application/nginx/sbin/nginx -s reload

# Gehen Sie zunächst auf die offizielle Website, um die Version des unterstützten Plug-Ins zu überprüfen


Erstellen Sie einen persönlichen Blog mit WordPress

2.4 Webseiteninstallation WordPress
# 去官网下载最新的wordpress软件包[root@web01 extra]# cd /home/oldboy/tools/[root@web01 tools]# wget https://cn.wordpress.org/wordpress-4.9.4-zh_CN.tar.gz# 解压缩[root@web01 tools]# tar -xf wordpress-4.9.4-zh_CN.tar.gz# 拷贝wordpress目录下的所有内容到/application/nginx/html/blog/目录下[root@web01 tools]# cp -a wordpress/* /application/nginx/html/blog/[root@web01 tools]# ls /application/nginx/html/blog/index.php        wp-blog-header.php    wp-includes        wp-settings.phplicense.txt      wp-comments-post.php  wp-links-opml.php  wp-signup.phpreadme.html      wp-config-sample.php  wp-load.php        wp-trackback.phpwp-activate.php  wp-content            wp-login.php       xmlrpc.phpwp-admin         wp-cron.php           wp-mail.php# 授予权限,先暂时授予所有文件,以后再调整权限[root@web01 tools]# chown -R www.www /application/nginx/html/blog/

# Client-Hosts-Datei muss analysiert werden

Erstellen Sie einen persönlichen Blog mit WordPress

Erstellen Sie einen persönlichen Blog mit WordPress

Erstellen Sie einen persönlichen Blog mit WordPress

Erstellen Sie einen persönlichen Blog mit WordPress

Erstellen Sie einen persönlichen Blog mit WordPress

Erstellen Sie einen persönlichen Blog mit WordPress

Erstellen Sie einen persönlichen Blog mit WordPress

Verwandte Empfehlungen :

Detaillierte Grafik- und Texterklärung zum Erstellen eines persönlichen Blogs mit LAMP basierend auf dem PHP-Modul

Schritte zum Erstellen eines persönlichen Blogs mit WordPress HTTPS

php persönlicher Blog spricht über PHP-Vererbung, meine persönliche Meinung

Das obige ist der detaillierte Inhalt vonErstellen Sie einen persönlichen Blog mit WordPress. Für weitere Informationen folgen Sie bitte anderen verwandten Artikeln auf der PHP chinesischen Website!

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn