蜗牛789
主机测评与优惠

Debian系统安装Lighttpd/SQLite/PHP建站环境

应该在上个月有网友找蜗牛提到两次希望能整理一篇Lighttpd/SQLite/PHP VPS建站环境的教程出来,因为有网站搭建需要使用。今天上午想到这个事情还是寻找网上的资源,然后补充整理Lighttpd/SQLite/PHP环境的文章教程。因为蜗牛也有发现比如Typecho、ZBLOG PHP等都有支持SQLite数据库,且比使用MYSQL节省资源,尤其是在用低配置内存的VPS时候用SQLite数据库还是不错的。

当然,不管我们用于什么项目中,在这篇文章中蜗牛分享基于Debian系统安装Lighttpd/SQLite/PHP建站环境,参考和查阅不少的文章,经过大半天的测试安装终于成功。

蜗牛猜测你可能也会有需要使用下面几个环境安装包:

完整Debian7配置LAMP(Apache/MySQL/PHP)环境及搭建建站

完整配置CentOS6安装LAMP(Apache/MySQL/PHP)环境搭建教程

LEMP(Linux/Nginx/MySQL/PHP)一键包安装及SFTP快速建站教程

第一、升级debian环境

apt-get update && apt-get -y upgrade

我们需要先升级最新的debian环境状态,因为不升级可能下面的环境包也不好安装。

第二、安装Lighttpd和SQLite数据库

apt-get install lighttpd #安装Lighttpd
apt-get install sqlite #安装SQLite

第三、安装PHP环境需要的组件

apt-get install php5-cgi php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

第四、修改php.ini配置文件(vi /etc/php5/cgi/php.ini)

cgi.fix_pathinfo启动且值修改成1

第五、配置/etc/lighttpd/lighttpd.conf文件

server.modules = (
\”mod_access\”,
\”mod_alias\”,
\”mod_compress\”,
\”mod_redirect\”,
\”mod_rewrite\”,
\”mod_fastcgi\”,
)

server.document-root = \”/var/www\”
server.upload-dirs = ( \”/var/cache/lighttpd/uploads\” )
server.errorlog = \”/var/log/lighttpd/error.log\”
server.pid-file = \”/var/run/lighttpd.pid\”
server.username = \”www-data\”
server.groupname = \”www-data\”

index-file.names = ( \”index.php\”, \”index.html\”,
\”index.htm\”, \”default.htm\”,
\” index.lighttpd.html\” )

url.access-deny = ( \”~\”, \”.inc\” )

static-file.exclude-extensions = ( \”.php\”, \”.pl\”, \”.fcgi\” )

include_shell \”/usr/share/lighttpd/use-ipv6.pl\”

dir-listing.encoding = \”utf-8\”
server.dir-listing = \”enable\”

compress.cache-dir = \”/var/cache/lighttpd/compress/\”
compress.filetype = ( \”application/x-javascript\”, \”text/css\”, \”text/html\”, \”text/plain\” )

include_shell \”/usr/share/lighttpd/create-mime.assign.pl\”
include_shell \”/usr/share/lighttpd/include-conf-enabled.pl\”

fastcgi.server = ( \”.php\” => ((
\”bin-path\” => \”/usr/bin/php5-cgi\”,
\”socket\” => \”/tmp/php.socket\”,
\”max-procs\” => 1,
\”bin-environment\” => (
\”PHP_FCGI_CHILDREN\” => \”4\”,
\”PHP_FCGI_MAX_REQUESTS\” => \”1000\”
),
)))

斜体部分是我添加和修改的,其他不变。

第六、重启Lighttpd

/etc/init.d/lighttpd restart

这样,蜗牛在debian系统下创建/搭建Lighttpd/SQLite/PHP建站换完毕。后面我们就可以创建站点、安装网站。

About 蜗牛

【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。





评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址