您好!欢迎访问YaBo亚搏手机版App!
专注精密制造10载以上
专业点胶阀喷嘴,撞针,精密机械零件加工厂家
联系方式
0670-97335783
您当前的位置: 主页 > 新闻动态 > 技术支持 >

技术支持

零基础搭建自己的博客

更新时间  2021-06-05 19:54 阅读
本文摘要:1. 申请域名2. 申请服务器说明:这个是我自己在 腾讯云上面申请的,详细可以自己去腾讯云上面购置和申请!我申请的域名为 www.tokenmi.cn 服务器 IP 地址为: 123.207.253.29这个可以通过 ping www.tokenmi.cn 获得 IP 地址2017/09/27 搭建了网站,可是没有存案 发现今天被屏蔽了上面两个步骤就不多说; 申请后记得放开 80 端口,默认之放开了 22 端口.域名信息:服务器信息:放开 80 端口:博客三板斧 Nginx

YaBo亚搏手机版App

yabo亚搏手机版app下载

1. 申请域名2. 申请服务器说明:这个是我自己在 腾讯云上面申请的,详细可以自己去腾讯云上面购置和申请!我申请的域名为 www.tokenmi.cn 服务器 IP 地址为: 123.207.253.29这个可以通过 ping www.tokenmi.cn 获得 IP 地址2017/09/27 搭建了网站,可是没有存案 发现今天被屏蔽了上面两个步骤就不多说; 申请后记得放开 80 端口,默认之放开了 22 端口.域名信息:服务器信息:放开 80 端口:博客三板斧 Nginx + PHP (WordPress) + Mysql机械信息:[root@VM_123_161_centos ~]# uname -aLinux VM_123_161_centos 3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux[root@VM_123_161_centos ~]# free -m total used free shared buff/cache availableMem: 992 780 78 0 133 69Swap: 0 0 0[root@VM_123_161_centos ~]# cat /proc/cpuinfoprocessor: 0vendor_id: GenuineIntelcpu family: 6model: 79model name: Intel(R) Xeon(R) CPU E5-26xx v4stepping: 1microcode: 0x1cpu MHz: 2394.452cache size: 4096 KBphysical id: 0siblings: 1core id: 0cpu cores: 1apicid: 0initial apicid: 0fpu: yesfpu_exception: yescpuid level: 13wp: yesflags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch avx2 rdseed adx xsaveoptbogomips: 4788.90clflush size: 64cache_alignment: 64address sizes: 40 bits physical, 48 bits virtualpower management:------------------------------------------Nginx 篇 -----------------------------------------------------1. 安装 nginx:[root@VM_123_161_centos ~]# yum install nginx -y// nginx-1.10.2-1.el7.x86_642. 启动 nginx:[root@VM_123_161_centos system]# service nginx restartRedirecting to /bin/systemctl restart nginx.service[root@VM_123_161_centos system]# ps aux | grep nginxroot 32553 0.0 0.2 122768 2204 ? Ss Sep27 0:00 nginx: master process /usr/sbin/nginxnginx 32554 0.0 0.3 125312 3200 ? S Sep27 0:00 nginx: worker processroot 32733 0.0 0.0 112648 960 pts/0 R+ 15:51 0:00 grep --color=auto nginx[root@VM_123_161_centos system]#这里可以通过 :service nginx restart#或者/bin/systemctl restart nginx.service#来启动 nginx启动后 可以通过在 浏览器内里输入域名检察到 nginx 提供的默认主页!3. nginx.service 文件以及路径:[root@VM_123_161_centos system]# cat nginx.service[Unit]Description=The nginx HTTP and reverse proxy serverAfter=network.target remote-fs.target nss-lookup.target[Service]Type=forkingPIDFile=/run/nginx.pid# Nginx will fail to start if /run/nginx.pid already exists but has the wrong# SELinux context. This might happen when running `nginx -t` from the cmdline.# https://bugzilla.redhat.com/show_bug.cgi?id=1268621ExecStartPre=/usr/bin/rm -f /run/nginx.pidExecStartPre=/usr/sbin/nginx -tExecStart=/usr/sbin/nginxExecReload=/bin/kill -s HUP $MAINPIDKillSignal=SIGQUITTimeoutStopSec=5KillMode=processPrivateTmp=true[Install]WantedBy=multi-user.target[root@VM_123_161_centos system]# pwd/usr/lib/systemd/system4. nginx 设置文件路径: (最终我们为了让 nginx 支持 php 要修改 nginx.conf 文件)[root@VM_123_161_centos nginx]# lsfastcgi.conf fastcgi_params koi-utf mime.types nginx.conf scgi_params uwsgi_params win-utffastcgi.conf.default fastcgi_params.default koi-win mime.types.default nginx.conf.default scgi_params.default uwsgi_params.default[root@VM_123_161_centos nginx]# pwd/etc/nginx修改详细见:https://my.oschina.net/tsh/blog/1544443-------------------------------------- php 篇 ---------------------------------------------1. 安装 PHP[root@VM_123_161_centos nginx]# yum install php -y//安装包 php-5.4.16-42.el7.x86_642. 安装 php-fpm[root@VM_123_161_centos nginx]# yum install php-fpm -y//安装包 php-fpm-5.4.16-42.el7.x86_64可以通过下面的下令来启动 php-fpm[root@VM_123_161_centos nginx]# service php-fpm restartRedirecting to /bin/systemctl restart php-fpm.service安装好后可以发现 127.0.0.1:9000 会被监听 (用于 nginx 和 php-fpm 通信)---------------------------------------- wordpress 篇 ----------------------------------1. 下载 wordpresshttps://cn.wordpress.org/2. 上传 wordpress 到服务器说明:这里 我是 通过 xshell 登录到 linux 机械的, 默认情况下机械没有提供 rz sz 下令,这个可以自己编译安装或者通过 winscp 上传3. 目录树:[root@VM_123_161_centos nginx]# lshtml modules wordpress[root@VM_123_161_centos nginx]# pwd/usr/share/nginx[root@VM_123_161_centos nginx]# cd wordpress/[root@VM_123_161_centos wordpress]# pwd/usr/share/nginx/wordpress[root@VM_123_161_centos wordpress]# lsindex.php wp-activate.php wp-comments-post.php wp-content wp-links-opml.php wp-mail.php wp-trackback.phplicense.txt wp-admin wp-config.php wp-cron.php wp-load.php wp-settings.php xmlrpc.phpreadme.html wp-blog-header.php wp-config-sample.php wp-includes wp-login.php wp-signup.php-----------------------------------------------mysql篇----------------------------1. 安装 mysqlCentOS7的yum源中未找到mysql服务。所以,我们要先下载mysql的repo源.下载下令:wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm[root@VM_123_161_centos data]# cd /data[root@VM_123_161_centos data]# rm -rf ./mysql-community-release-el7-5.noarch.rpm[root@VM_123_161_centos data]# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm--2017-09-28 16:18:26-- http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpmResolving repo.mysql.com (repo.mysql.com)... 173.223.141.174Connecting to repo.mysql.com (repo.mysql.com)|173.223.141.174|:80... connected.HTTP request sent, awaiting response... 200 OKLength: 6140 (6.0K) [application/x-redhat-package-manager]Saving to: ‘mysql-community-release-el7-5.noarch.rpm’100%[==================================================================================================================================>] 6,140 --.-K/s in 0s 2017-09-28 16:18:27 (583 MB/s) - ‘mysql-community-release-el7-5.noarch.rpm’ saved [6140/6140]安装 rpm 包[root@VM_123_161_centos data]# rpm -ivh mysql-community-release-el7-5.noarch.rpmPreparing... ################################# [100%]通过 yum 安装 mysql[root@VM_123_161_centos data]# yum install mysql-server//mysql-community-server-5.6.37-2.el7.x86_64启动 mysql[root@VM_123_161_centos data]# service mysqld restartRedirecting to /bin/systemctl restart mysqld.service[root@VM_123_161_centos data]#[root@VM_123_161_centos data]# ps aux | grep mysqlmysql 1193 0.0 0.1 113252 1588 ? Ss 16:22 0:00 /bin/sh /usr/bin/mysqld_safe --basedir=/usrmysql 1360 3.6 46.3 1316684 471268 ? Sl 16:22 0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sockroot 1388 0.0 0.0 112648 964 pts/0 R+ 16:22 0:00 grep --color=auto mysql添加新mysql用户:1. 修改一下设置文件[root@VM_123_161_centos etc]# vim /etc/my.cnf修改这一行就可以了,否则添加用户的时候会报错2. 登录到mysql (这里默认没有密码,提示输入密码直接回车就可以了)[root@VM_123_161_centos etc]# mysql -u root -pEnter password:Welcome to the MySQL monitor. Commands end with ; or g.Your MySQL connection id is 3Server version: 5.6.37 MySQL Community Server (GPL)Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.mysql> insert into mysql.user(Host, User, Password) values ('localhost', 'tsh185', password('qwer1234'));Query OK, 1 row affected, 3 warnings (0.02 sec)mysql> flush privileges;Query OK, 0 rows affected (0.01 sec)mysql> quit;这里就建立了一个 用户名为 tsh185 密码为 qwer1234 的 mysql 用户! 当前如果用这个用户登录 mysql 是会提示失败的!原因是 mysql 内里存在一个 为空的用户(直接在 shell>>mysql 就可以登录到 mysql),要删除该用户才气使用 tsh185 这个用户登录到 mysql[root@VM_123_161_centos etc]# mysql -u root -pEnter password:Welcome to the MySQL monitor. Commands end with ; or g.Your MySQL connection id is 4Server version: 5.6.37 MySQL Community Server (GPL)Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.mysql> use mysqlReading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> delete from user where User='';Query OK, 0 rows affected (0.00 sec)mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)mysql> quit;3. 建立数据库(tsh185blog), 而且授权给用户 tsh185[root@VM_123_161_centos etc]# mysql -u root -pEnter password:Welcome to the MySQL monitor. Commands end with ; or g.Your MySQL connection id is 6Server version: 5.6.37 MySQL Community Server (GPL)Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.mysql> create database tsh185blog;Query OK, 1 row affected (0.01 sec)mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || blogdb || mysql || performance_schema || tsh185blog |+--------------------+5 rows in set (0.00 sec)mysql> grant all privileges on tsh185blog.* to tsh185@localhost;Query OK, 0 rows affected (0.00 sec)mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)mysql> quit;Bye4. 验证一把 tsh185 用户 对 tsh185blog 的权限(这里可以通过 tsh185 登录 mysql 可以看到数据库 tsh185blog )[root@VM_123_161_centos etc]# mysql -u tsh185 -pEnter password:Welcome to the MySQL monitor. Commands end with ; or g.Your MySQL connection id is 7Server version: 5.6.37 MySQL Community Server (GPL)Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || tsh185blog |+--------------------+2 rows in set (0.00 sec)mysql> quit;Bye到此 通过 修改 nginx.conf 设置文件来启动 wordpress 了[root@VM_123_161_centos nginx]# vim /etc/nginx/nginx.conf设置文件内容见: https://my.oschina.net/tsh/blog/1544443----------------------------------最后-----------------------------------1. 打开浏览器输入你的域名:就可以设置 wordpress 了这里要填写的信息,就是上面的mysql 建立的信息.好比我这里的 数据库就是: tsh185blog我这里的用户名 就是: tsh185我这里的密码就是: qwer1234我这里的 数据库主机是: localhost表前缀我这里填写的是: bm_设置完成后 网站就搭建完成了!------------------------------------------------------------------------------------------参考信息:mysql: http://www.cnblogs.com/hqmao/p/5293831.htmlhttp://www.jianshu.com/p/834b0a47fc08wordpress: https://www.wpdaxue.com/how-to-install-wordpress.html域名设置: https://zhidao.baidu.com/question/1369523978800896739.html---------------------------- 增补说明 ------------------------------安装完成第一次打开 发现排版很乱, 通过 fiddler 发现是会见资源权限问题,通过修改权限没有解决可是还是建议设置一下 资源的权限信息[root@VM_123_161_centos html]# cd /usr/share/nginx/[root@VM_123_161_centos nginx]# chmod 755 -R ./*[root@VM_123_161_centos nginx]# chown nginx:nginx -R ./*// 这里的 nginx 用户和组 应该是 安装 yum install nginx 的时候建立的解决这个问题, 我认为是 nginx 的设置文件内里的 这一行rewrite /wp-admin$ $scheme://$host$uri/ permanent;最后 网站是要存案的,如果不存案 就像这样子了!!。


本文关键词:零,基础,搭建,自己的,博客,申请,域名,服务器,yabo亚搏手机版app下载

本文来源:YaBo亚搏手机版App-www.zh-zhuoyue.com