Original link: http://tabalt.net/blog/make-blog-support-baidu-search-engine/
If no description of this blog article are original, please indicate the above link when reproduced
GitHub pages Build the site, in Baidu search engine visits, the regular will return 403 forbidden
, so Baidu will think the website visit is not stable, the site down right, even K station.
To solve this problem, only buy a VPS themselves took a Jekyll analytic blog. But my domain name does not have the record, purely uses the foreign VPS, the user accesses also may have the slow question, after all GitHub pages CDN is still very good (page response time 200ms or so). There is no way, let Baidu Crawler to catch foreign VPS on the content, ordinary users directly access to GitHub pages it?
Now the technology is so developed, this thing is of course a small case. In general, the domain name analysis in large companies can be done by provinces, operators and so on; we commonly used dnspod also support such a powerful function, free users can be based on telecommunications, unicom, education Network, Baidu, search engine, etc. set up the analysis, pay users can be divided into provinces, sub-countries, continents and so on. For my little blog, the Free is enough.
Here is my toss-up process, record the memo.
Installing Jekyll
- Compile and install node. js
Jekyll is a ruby-based development that uses Ruby's Execjs method to execute JavaScript code, which requires you to specify a JavaScript runtime; Here we choose to install node. js.
sudo yum install libtool automake autoconf gcc-c++ openssl-devel wgetmkdir ~/soft/cd ~/soft/wget http://nodejs.org/dist/v 0.12.4/NODE-V0.12.4.TAR.GZTAR-ZXVF node-v0.12.4.tar.gzcd node-v0.12.4./configure--prefix=/usr make && sudo Make Installnode-vnpm-v
- Installing Ruby, RubyGems
sudo yum install ruby Ruby-devel gem
- Installing Jekyll with RubyGems
Gem Install Jekyll
Build a blog site
sudo yum install Gitsudo mkdir-p ~/mydomain.com/git clone Https://github.com/username/username.github.io.git.
- Update your blog code regularly
Configuration crontab 2 minutes pull the code:
CRONTAB-E # Add the following code: */2 * * * * CD ~/mydomain.com/; Git pull >>/tmp/github_blog_pull_record.log 2>&1;
After Jekyll 2.4, the file changes are followed, and the static files are automatically regenerated. Use the --detach
parameters specified in the background execution, --port
specify the port, --host
specify the current machine's extranet IP.
CD ~/mydomain.com/jekyll serve--port--host 192.168.1.101--detach
Bind the host test, the normal access will be completed. For more Jekyll use, refer to the documentation: http://jekyllrb.com/docs/usage/.
- Using the Web server Nginx
The HTTP service that is started by using the preceding method will monopolize the port of this server, and 80
if the machine needs to deploy another Web site, it must use a different port other than 80.
Using Nginx can solve this problem, configure an nginx vhost, you can use to jekyll build --watch &
generate static content of the blog, and set the site root directory ~/mydomain.com/_site/
, here does not do a specific description.
Configure smart DNS
Login dnspod, enter the domain name resolution Settings page, add a resolution for Baidu:
Postscript
After the above steps have been done, and then use Baidu's crawler test, it will be able to crawl the content of the normal.
I finished the next day, originally the remaining 8 articles, immediately became 1. Of course this is understandable, after all, is suddenly changed an IP, more hair articles and chain, recovery and weight is the sooner or later things. In addition, I this VPS in the domestic visit is still a little slow, the first request to return to 500ms or so, or the domain name of the record, in the domestic to get a cloud host.
Original link: http://tabalt.net/blog/make-blog-support-baidu-search-engine/
If no description of this blog article are original, please indicate the above link when reproduced
Let GitHub pages blog support Baidu search engine included