快速搭建一个博客网站
1、环境准备
[root@lnmp ~]$ cat /etc/redhat-release CentOS release 6.8 (Final) [root@lnmp ~]$ uname -m x86_64 [root@lnmp ~]$ uname -r 2.6.32-642.el6.x86_64 更改yum源 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo 或者 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo 同步repo源 wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo yum makecache
2、安装lnmp
名词解释:linux+nginx+mysql+php简称:lnmp [root@lnmp ~]$ yum -y install nginx [root@lnmp ~]$ yum -y install mysql mysql-server mysql-devel [root@lnmp ~]$ yum install php-fpm php-cli php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-magickwand php-magpierss php-mbstring php-mcrypt php-mssql php-shout php-snmp php-soap php-tidy
3、配置nginx
[root@lnmp ~]$ > /etc/nginx/nginx.conf [root@lnmp ~]$ vim /etc/nginx/nginx.conf 复制下面的到nginx,conf user nginx; worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name www.yanghao.com; location / { root html; index index.php; } location ~ .*\.(php|php5)?$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; } } } [root@lnmp ~]$ wget https://cn.wordpress.org/wordpress-4.9.4-zh_CN.tar.gz [root@lnmp ~]$ tar xf wordpress-4.9.4-zh_CN.tar.gz [root@lnmp ~]$ cp -a wordpress/* /usr/share/nginx/html/ [root@lnmp ~]$ chown -R nginx.nginx /usr/share/nginx/html/
4、启动php和nginx
[root@lnmp ~]$ /etc/init.d/php-fpm start Starting php-fpm: No log handling enabled - turning on stderr logging Created directory: /var/lib/net-snmp/mib_indexes [ OK ] [root@lnmp ~]$ /etc/init.d/nginx start Starting nginx: [ OK ]
打开浏览器访问:10.0.0.30
5、创建wordpress连接账号密码
[root@lnmp ~]$ /etc/init.d/mysqld start [root@lnmp ~]$ mysql mysql> create database wordpress; Query OK, 1 row affected (0.00 sec) mysql> grant all on wordpress.* to 'wordpress'@'localhost' identified by '123123'; Query OK, 0 rows affected (0.00 sec)
再次打开浏览器
按照上面的提升复制里面的内容
[root@lnmp ~]$ cd /usr/share/nginx/html/
[root@lnmp html]$ vim wp-config.php
将复制的内容粘贴到里面,然后点击现在安装
输入用户名和密码点击登录即可
到这里我们的一个简单博客网站告一段落
原文链接:https://www.cnblogs.com/HByang/articles/9214197.html
© 版权声明
声明📢本站内容均来自互联网,归原创作者所有,如有侵权必删除。
本站文章皆由CC-4.0协议发布,如无来源则为原创,转载请注明出处。
THE END