CubieboardLinux server tutorial 3

Source: Internet
Author: User
This series of tutorials mainly explain how to use the Cubieboard to create a small Linux server. You can access the Cubieboard server through a browser. Tutorial 3 describes how to configure the HTTP service on the CubieboardLinux server and use Nginx as the Web Service container. Build a Linux + Nginx + MySQL + php lnmp environment. LinaroD

This series of tutorials mainly explain how to use the Cubieboard to create a small Linux server. You can access the Cubieboard server through a browser. Tutorial 3 describes how to configure the HTTP service on the Cubieboard Linux server and use Nginx as the Web Service container. Build a Linux + Nginx + MySQL + php lnmp environment. Linaro D

This series of tutorials mainly explain how to use the Cubieboard to create a small Linux server. You can access the Cubieboard server through a browser. Tutorial 3 describes how to configure the HTTP service on the Cubieboard Linux server and use Nginx as the Web Service container. Build a Linux + Nginx + MySQL + php lnmp environment.

Install Nginx + MySQL + PHP in Linaro Debian Linux

Run the following command for one-click installation:

Apt-get update
Apt-get upgrade
Apt-get install nginx php5-cli php5-cgi php5-mysql spawn-fcgi mysql-server mysql-client php5-curl php5-gd php5-intl php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell

OK. The default installation version is:

  • Nginx 1.2.1
  • MySQL 5.5.27-0ubuntu2
  • PHP Version 5.4.6-1ubuntu1
Configure a VM

In this article, "cb.lixiphp.com" is used as a website example. You should replace your domain name in the subsequent steps. First, create a directory to save the content and log files:

Mkdir-p/srv/www/cb.lixiphp.com/public_html
Mkdir/srv/www/cb.lixiphp.com/logs
Chown-R www-data: www-data/srv/www/cb.lixiphp.com

The public_html directory is used to store Web programs and can be accessed from the Internet.

The logs directory is used to store Nginx log files, including access logs and error logs.

Nginx configuration example:

Modifying the nginx virtual host configuration file is similar to the following example:

File Location:/Etc/nginx/sites-available/cb.lixiphp.com

Server {
Server_name cb.lixiphp.com example.com;
Access_log/srv/www/cb.lixiphp.com/logs/access.log;
Error_log/srv/www/cb.lixiphp.com/logs/error.log;
Root/srv/www/cb.lixiphp.com/public_html;
Location /{
Index. php index.html index.htm;
}
Location ~ \. Php $ {
Include/etc/nginx/fastcgi_params;
Fastcgi_pass 127.0.0.1: 9000;
Fastcgi_index index. php;
Fastcgi_param SCRIPT_FILENAME/srv/www/cb.lixiphp.com/public_html?fastcgi_script_name;
}
}

The root directory is the Web root directory pointed to by cb.lixiphp.com.

Index is the default index file.

Create a file/usr/bin/php-fastcgi and use the following content:

File Location:/Usr/bin/php-fastcgi

#! /Bin/bash
FASTCGI_USER = www-data
FASTCGI_GROUP = www-data
ADDRESS = 127.0.0.1
PORT = 9000
PIDFILE =/var/run/php-fastcgi/php-fastcgi.pid
CHILDREN = 6
PHP5 =/usr/bin/php5-cgi
/Usr/bin/spawn-fcgi-a $ ADDRESS-p $ PORT-P $ PIDFILE-C $ CHILDREN-u $ FASTCGI_USER-g $ FASTCGI_GROUP-f $ PHP5

Run the following command to make it executable:

chmod +x /usr/bin/php-fastcgi

Enable and start the service:

Run the following command to enable the website:

Cd/etc/nginx/sites-enabled/
Ln-s/etc/nginx/sites-available/cb.lixiphp.com

Create a file/etc/init. d/php-fastcgi and use the following content:

(...)
Read the rest of Cubieboard Linux Server tutorial 3 (235 words)

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.