How to use Gitblog and markdown to build your own blog _php instance

Source: Internet
Author: User
Tags error code

Below to share how to use Gitblog and markdown to build their own blog, how everyone has a server or cloud platform to provide the cloud host, I recommend that you use linux+ Nginx to run Gitblog, if you are currently only Apache environment can also.

Domain Name resolution

You are ready to resolve the domain name to your host IP, recommend the use of Dnspod to manage and monitor your domain name, the specific use of reference Dnspod official documentation, very simple.

nginx+php Operating Environment

First install your nginx and PHP environment, PHP version requires more than 5.3. If you have not installed, Google search for relevant tutorials, you can also refer to Nginx and PHP official documents. This is the first step, there is a normal nginx + PHP operating environment.

Configure Nginx

Nginx can refer to the following configuration:

server {
 listen    ;
 server_name jockchou.gitblog.cn;
 root/data/vhosts/jockchou.gitblog.cn;
 Index index.html index.htm index.php;
 Location ~ \. (Jpg|png|gif|js|css|swf|flv|ico) $ {
   expires 12h;
 }
 Location/{
  if (!-e $request _filename) {
     rewrite ^ (. *) $/index.php?$1 last;
     break;
  }
 }
 Location ~* ^/(Doc|logs|app|sys)/{return
  403;
 }
 Location ~. *\. (PHP|PHP5)? $
 {
  fastcgi_connect_timeout;
  Fastcgi_send_timeout;
  Fastcgi_read_timeout;
  Fastcgi_pass  127.0.0.1:9000;
  Fastcgi_index index.php;
  Fastcgi_param script_filename $document _root$fastcgi_script_name;
  Include Fastcgi_params;
 }
}

Change the server_name and root in the above configuration to your own, fastcgi_pass your CGI process port.

Permission configuration

Because the Gitblog cache mechanism needs to write the App/cache directory, check and modify the permissions of this directory if necessary to ensure that your PHP has permission to write this directory. Usually you only need to modify the owner and group of this directory into a CGI run account.

Run

After the above configuration, start your nginx and CGI services, upload gitblog source code to the site directory, through the browser to resolve to the local Domain name Observation page effect. If the page does not display correctly, check your CGI and Nginx configuration with the error code.

Gitblog Introduction

I. INTRODUCTION

Gitblog is an easy-to-use markdown blog system, it does not require a database, no management background functions, update the blog just need to add your written markdown file can. It got rid of the difficulty of the online editor typesetting, not real-time preview of the shortcomings, everything to markdown to complete, a blog is a markdown file. Also support comments, code highlighting, mathematical formulas, page PV statistics and other common functions. Gitblog offers a different theme style, you can configure it according to your preferences, if you want to make your own blog theme, it is also very easy. Gitblog also supports the whole station static export, you can completely export the entire station static page deployment to GitHub pages.

Two. Functional features

Using Markdown
Comment Box
Code highlighting
PV statistics
Latex Mathematical formula
Self-made theme
Response type
Static export of whole station
A good SEO
three. Gitblog Advantage

No database, lighter system, easier porting
The disadvantage of using markdown to write, get rid of the difficulty of background edit typesetting, can't preview in real time
can be static export of all stations
Flexible configuration, can switch some functions freely
Multi-theme support, self-made theme
Blogs, classifieds, tags, archiving
four. Environmental Requirements

PHP 5.2.4+

Five. Installation steps

Download Gitblog Source code
Unzip upload to your PHP site root directory
Open the browser, visit the home page
Upload markdown files to posts folder

The above is how to use Gitblog and markdown to build their own blog all the content, I hope you can enjoy.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.