软件准备

    软件包 版本 大小
    lnmp1.7.tar.gz 1.7 165kB
    wordpress-4.7.3-zh_CN.zip 4.7.3 8995KB
    CentOS-7-x86_64-DVD-1511.iso 1511 4.03GB

    运行lnmp包

    1. [root@lnmp ~]# tar -zxvf lnmp1.7.tar.gz
    2. [root@lnmp ~]# cd lnmp1.7
    3. [root@lnmp lnmp1.7]# ./install.sh
    4. [root@lnmp lnmp1.7]# mysql -uroot -plnmp.org#16342
    5. mysql> create database wordpress;
    6. Query OK, 1 row affected (0.00 sec)
    7. mysql> grant all privileges on *.* to root@localhost identified by '000000' with grant option;
    8. Query OK, 0 rows affected (0.00 sec)
    9. mysql> grant all privileges on *.* to root@"%" identified by '000000' with grant option;
    10. Query OK, 0 rows affected (0.01 sec)
    11. mysql> exit
    12. [root@lnmp ~]# tar -zxvf wordpress-5.8-zh_CN.tar.gz
    13. [root@lnmp ~]# rm -rf /home/wwwroot/default/index.html
    14. [root@lnmp ~]# cp -rvf wordpress/* /home/wwwroot/default/
    15. [root@lnmp ~]# chmod 777 /home/wwwroot/default/*
    16. [root@lnmp ~]# cd /home/wwwroot/default/
    17. [root@lnmp ~]# cp wp-config-sample.php wp-config.php
    18. [root@lnmp ~]# vi wp-config.php
    19. /** The name of the database for WordPress */
    20. define( 'DB_NAME', 'wordpress' );
    21. /** MySQL database username */
    22. define( 'DB_USER', 'root' );
    23. /** MySQL database password */
    24. define( 'DB_PASSWORD', '000000' );
    25. /** MySQL hostname */
    26. define( 'DB_HOST', '192.168.100.10' );
    27. /** Database charset to use in creating database tables. */
    28. define( 'DB_CHARSET', 'utf8' );
    29. [root@lnmp default]# cd /usr/local/nginx/conf/vhost/
    30. [root@lnmp vhost]# mkdir qq
    31. [root@lnmp vhost]# mv default.conf load.conf proxy.conf ssl.conf test.com.conf qq
    32. [root@lnmp vhost]# vim qq.conf
    33. server
    34. {
    35. location ~ \.php$ {
    36. root /var/www/html;
    37. fastcgi_pass 127.0.0.1:9000;
    38. fastcgi_index index.php;
    39. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    40. include fastcgi_params;
    41. }
    42. }

    image.png