做半成品网站,网站开发合同模板,宁德蕉城住房和城乡建设部网站,珠海网站制作推广公司哪家好(一)lighttpd1. 安装yum install lighttpd安装完成后#xff0c;系统中应该多了一个用户lighttpd和组lighttpd。这个用户#xff0c;默认是不允许登陆的。我们修改/etc/passwd#xff0c;将lighttpd修改为如下形式。lighttpd:x:489:470:lighttpd web server:/home/lighttpd/…(一)lighttpd1. 安装yum install lighttpd安装完成后系统中应该多了一个用户lighttpd和组lighttpd。这个用户默认是不允许登陆的。我们修改/etc/passwd将lighttpd修改为如下形式。lighttpd:x:489:470:lighttpd web server:/home/lighttpd/:/bin/bash注意你所看到的数字可能不是489,470这个没关系也不用改保持原来的值即可。2. 为lighttpd用户创建一个目录将网站的内容放进去mkdir /home/lighttpdchown lighttpd:lighttpd /home/lighttpd创建相关子目录并放入网站的内容。注意/home/lighttpd以lighttpd目录中的各种操作都以lighttpd用户的身份来完成。否则lighttpd运行时可能会出现权限问题。su lighttpdcd /home/lighttpdmkdir wwwmkdir www/cgi-binmkdir www/databasesmkdir www/imagesmkdir www/log好了现在可以往各个目录里放内容了网页图片php脚本sqlite数据库文件等。index.html就放到www目录下。3. 配置修改lighttpd的配置文件 /etc/lighttpd/lighttpd.confa)打开cgi功能当然你也可以根据需要打开其他的功能。我修改后的server.modules如下。server.modules (mod_rewrite,mod_redirect,# mod_alias,mod_access,# mod_trigger_b4_dl,# mod_auth,# mod_status,# mod_setenv,# mod_fastcgi,# mod_proxy,# mod_simple_vhost,# mod_evhost,# mod_userdir,mod_cgi,mod_compress,# mod_ssi,mod_usertrack,# mod_expire,# mod_secdownload,# mod_rrdtool,mod_accesslog )b) 默认的文件名这里把default.xxx也给加上。index-file.names ( index.php, index.html,index.htm, default.htm, default.php )c) 设置一些路径server.document-root /home/lighttpd/www/## where to send error-messages toserver.errorlog /home/lighttpd/www/log/error.logaccesslog.filename /home/lighttpd/www/log/access.log#### php解析器的路径加上cgi.assign ( .pl /usr/bin/perl,.php /usr/bin/php )4. 启动lighttpdservice lighttpd start5. 设置lighttpd开机自动启动chkconfig --add lighttpd(二)sqlite这个简单直接安装一下就行了。(三)php下载php源码包http://ar2.php.net/distributions/php-5.6.3.tar.bz2将源码包拷贝到 /root目录下然后进入/root目录执行如下命令序列tar -xjf php-5.6.3.tar.bz2cd php-5.6.3./configure --prefix/usr --with-config-file-path/etc --enable-libxml --with-libxml-dir/usr/lib --with-sqlite3 --enable-pdo --with-pdo-sqlite CLAGS-O2需要注意的是这种编译方式支持访问sqlite3的方式为pdo方式。这种方式不需要依赖任何extension(四)测试a)用lighttpd用户进入/home/lighttpd/www/databases目录创建一个数据库[lighttpdlocalhost databases]$ sqlite3 test.dbSQLite version 3.6.22Enter .help for instructionsEnter SQL statements terminated with a ;sqlite create table my_friends(name varchar(10), age smallint);sqlite insert into my_friends values(tom,22);sqlite insert into my_friends values(liyan,21);输入ctrld退出sqlite shellb) 用lighttpd用户进入cig-bin目录创建一个php脚本haha.php内容如下//phpinfo();echo hello 我的第一个php脚本\n;echo getcwd();$file_db new PDO(sqlite:../databases/test.db);$result $file_db-query(SELECT * FROM my_friends);foreach($result as $row){echo name: .$row[name]. ;}?c) 用浏览器访问haha.php看看效果吧 :)