注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

從頭再來 Blog

一切將會如小生命的誕生一樣,從頭再來.....

 
 
 

日志

 
 

在OpenMss上安装webserver/php/mysql  

2007-11-18 20:36:02|  分类: Linux |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

Current version: 0.1.9 (23 September 2006)
I know many have longed for a webserver, php and mysql for their msses, and finally their longing has come to an end. In this tutorial I will show how to install and and configure lighttpd-1.4.11, php-5.1.4 and mysql-5.0.22

Requirements
This tutorial assumes you have OpenMSS and BusyBox installed. For the latter one, issue ipkg install busybox on the commandline.

Furthermore, you must add a new repository to your ipkg list:
Code: Select all
cat >> /opt/etc/ipkg.conf
src bryan http://ipkg.openmss.org/bryan
{Press: ctrl+d}

Then, install a new version of libc6 if you have not done yet before:
Code: Select all
ipkg install libc6


For editting config files, vi is commonly used. Open a file by vi /path/to/file. Enter editmode by entering i. When your done, press escape twice, and type :wq<enter>.

lighttpd
As Apache is much to overweight for our 32MB MSS, I decided to use lighttpd, which is a webserver with the capabilities of Apache, but a much smaller memory usage.

1. Install lighttpd
Code: Select all
ipkg install lighttpd


2. Configure lighttpd: lighttpd defaults to running at port 8080, with /opt/bin/lighttpd/var/wwwroot as it's root directory, but you can change that by editting /opt/bin/lighttpd/lighttpd.conf.
For PHP support add or change the following lines in /opt/bin/lighttpd/lighttpd.conf:

Code: Select all
static-file.exclude-extensions = ( ".php" )
index-file.names = ( "index.html", "index.php" )

server.modules = ("mod_fastcgi", )

fastcgi.server = (
    ".php" => ((
        "bin-path" => "/opt/bin/php",
        "socket" => "/opt/bin/lighttpd/php.socket",
        "max-procs" => 2,
        "bin-environment" => (
            "PHP_FCGI_CHILDREN" => "4",
            "PHP_FCGI_MAX_REQUESTS" => "32"
        ),
        "bin-copy-environment" => ( "PATH", "SHELL", "USER"),
        "broken-scriptfilename" => "enable"
    ))
)


PHP
PHP Hypertext Processor is a commonly used scripting languages for websites, and now also available for OpenMSS.

1. Install PHP
Code: Select all
ipkg install libxml2
ipkg install php5

2. If you want to modify the default PHP settings, you may create /opt/etc/php.ini

3. If you are running Firmware 1.2.2, you might need a new version of libpthread.
Code: Select all
ipkg install http://ipkg.openmss.org/testing/libpthread_0.9_mipsel.ipk


MySQL
MySQL is a commonly used database system, with bindings to PHP.

1. Install MySQL (note: this may take a while to download and install)
Code: Select all
ipkg install mysql

2. If you want to modify the default MySQL settings, the config file is located at /opt/usr/local/mysql/etc/my.cnf

Testing
1. Create a phpinfo.php file:
Code: Select all
cat > /opt/bin/lighttpd/var/wwwroot/phpinfo.php
<?php phpinfo(); ?>
{Press: ctrl+d}


2. Start lighttpd:
Code: Select all
/opt/bin/lighttpd/bin/lighttpd


3. Surf to http://address-of-your-mss:8080/phpinfo.php

Any mistakes in either this tutorial or one of my packages? Feel free to comment!
Last edited by Bryan on 23 Sep 2006 20:16, edited 13 times in total.
Python 2.5, CTorrent dnh3.2, Busybox 1.2.0
Bryan
  评论这张
 
阅读(792)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017