Use the LNMP environment to install typecho blog full record, lnmptypecho

Source: Internet
Author: User
Tags nginx server

Use the LNMP environment to install typecho blog full record, lnmptypecho

Although I am engaged in asp.net, I like php very much. php has many open-source blog programs, such as the well-known Wordpress. There are also various independent blog z-blog, and short and concise emblog.

Wordpress is bloated, pass! Others do not like it, so we chose the typecho open-source blog system developed by Chinese people. The advantage is that it is easy to use and supports markdown.

To install typecho, you need a php environment. Here I use lnmp, and the server uses Vultr for begging. The system is ubuntu14.14. Next I will start to install typecho. Each step is described in detail.
'''

Upgrade various software packages

Sudo apt-get update

Install screen to prevent ssh disconnection during long Compilation

Sudo apt-get install screen

Enable new screen window

Screen-S lnmp

Download and install the one-click lnmp package. Because my server is in China, I use the lnmp download point in China.

Wget-c https://api.sinas3.com/v1/SAE_lnmp/soft/lnmp1.2-full.tar.gz -- no-check-certificate & tar zxf lnmp1.2-full.tar.gz & cd lnmp1.2-full &./install. sh lnmp

Follow the prompts to install it step by step-mysql super password, whether to enable innoDB, Mysql, php version, after completion, it will take a long time to wait for compilation to complete, the time ranges from 30 minutes to 1 hour. Check the configuration of the VPS and add the VM.

Lnmp vhost add

Enter the domain name www.luodaoyi.com,

Www.luodaoyi.com

Set pseudo-static rules. Once the lnmp one-key package has built-in typecho support, you only need to enter typecho. It will customize the pseudo-static configuration of Incloud Typecho.

Typecho

Create a mysql database. Follow the prompts and configure the VM.
This is not complete yet. You have to reconfigure the pseudo-static file; otherwise, typecho will be 404 ..

Vi/usr/local/nginx/conf/vhost/www.luodaoyi.com. conf
There are two main points:

Comment out try_files $ uri = 404; Enable include pathinfo. conf;

It looks like this:

Server
{
Listen 80;

# Listen [:]: 80;
Server_name www.luodaoyi.com;
Index. php;
Root/home/wwwroot/www.luodaoyi.com;

    include typecho.conf;    #error_page   404   /404.html;    location ~ [^/]\.php(/|$)    {        # comment try_files $uri =404; to enable pathinfo        #try_files $uri =404;        fastcgi_pass  unix:/tmp/php-cgi.sock;        fastcgi_index index.php;        include fastcgi.conf;        include pathinfo.conf;    }    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$    {        expires      30d;    }    location ~ .*\.(js|css)?$    {        expires      12h;    }    access_log  /home/wwwlogs/www.luodaoyi.com.log  access;}
Then you can upload the typecho code and start the installation. Do not repeat https again. There are two ways to enable https: 1. Configure the ssl certificate directly on the nginx server and enable port 443, if you want to redirect all http connections to Https, edit the nginx vhost configuration.

Vi/usr/local/nginx/conf/vhost/www.luodaoyi.com. conf

Add a new port 80 server to set the redirection:

Server
{
Listen 80;
Server_name www.luodaoyi.com;
Rewrite. * $ https: // $ host $1 permanent;
}

After setting, all http requests will be redirected to https.
'''

Method 2: Use cdn that supports https acceleration. I use youpai cloud and configure the SSL Service in the toolbox. Note that the ssl certificate must be uploaded to the private key, in addition, the private key cannot be encrypted with a password. Otherwise, it will fail and then bind your CDN service domain name. I use method 1 and add this method.

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.