Cubieboard Linux服务器教程三
Jun 07, 2016 pm 04:37 PM本系列教程主要讲解通过Cubieboard 板子做一个小型的 Linux 服务器,用户可以通过浏览器访问到Cubieboard 服务器。教程三主要讲解Cubieboard Linux服务器配置HTTP服务,使用Nginx作为Web服务容器。搭建一个Linux + Nginx + MySQL + PHP的LNMP环境。 Linaro D
本系列教程主要讲解通过Cubieboard 板子做一个小型的 Linux 服务器,用户可以通过浏览器访问到Cubieboard 服务器。教程三主要讲解Cubieboard Linux服务器配置HTTP服务,使用Nginx作为Web服务容器。搭建一个Linux + Nginx + MySQL + PHP的LNMP环境。
Linaro Debian Linux 安装 Nginx + MySQL + PHP
通过以下命令一键安装:
apt-get update
apt-get upgrade
apt-get install nginx php5-cli php5-cgi spawn-fcgi mysql-server mysql-client php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
OK,完成以上命令的安装后,默认的安装版本是:
- Nginx 1.2.1
- MySQL 5.5.27-0ubuntu2
- PHP Version 5.4.6-1ubuntu1
配置虚拟主机
在本文中“cb.lixiphp.com”作为一个网站例子。您应该在后续步骤的配置中取代为你自己的域名。首先,创建目录来保存内容和日志文件:
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
public_html 目录用于存储Web程序,外网可以访问。
logs 目录用于存储Nginx的日志文件,包括访问日志和错误日志。
Nginx 配置示例:
修改nginx的虚拟主机配置文件类似于下面的示例:
文件位置: /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 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;
}
}
root 目录为当前cb.lixiphp.com指向的Web根目录。
index 为默认的索引文件。
创建一个文件 /usr/bin/php-fastcgi 使用以下的内容:
文件位置: /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
使用以下命令使其可执行:
chmod +x /usr/bin/php-fastcgiNach dem Login kopieren
启用和启动服务:
使用以下命令来启用该网站:
cd /etc/nginx/sites-enabled/
ln -s /etc/nginx/sites-available/cb.lixiphp.com
创建一个文件 /etc/init.d/php-fastcgi 使用以下的内容:
(...)
Read the rest of Cubieboard Linux服务器教程三 (235 words)

Heißer Artikel

Hot-Tools-Tags

Heißer Artikel

Heiße Artikel -Tags

Notepad++7.3.1
Einfach zu bedienender und kostenloser Code-Editor

SublimeText3 chinesische Version
Chinesische Version, sehr einfach zu bedienen

Senden Sie Studio 13.0.1
Leistungsstarke integrierte PHP-Entwicklungsumgebung

Dreamweaver CS6
Visuelle Webentwicklungstools

SublimeText3 Mac-Version
Codebearbeitungssoftware auf Gottesniveau (SublimeText3)

Heiße Themen

Android TV Box erhält inoffizielles Ubuntu 24.04-Upgrade

Deepseek Web Version Eingang Deepseek Offizielle Website Eingang

BitPie Bitpie-Wallet-App-Download-Adresse

Bitget Offizielle Website -Installation (2025 Anfängerhandbuch)

Installation der Quellcode-Kompilierung von Zabbix 3.4

Ausführliche Erklärung: Parameterbefehl zur Beurteilung der Variablen des Shell-Skripts

Ouyi OKX Installationspaket ist direkt enthalten
