《小內存VPS建站:安裝PHP/Lighttpd/SQLite》要點:
本文介紹了小內存VPS建站:安裝PHP/Lighttpd/SQLite,希望對您有用。如果有疑問,可以聯系我們。
搬瓦工VPS已經在上一篇文章中針對256MB內存方案的VPS主機安裝Debian系統環境,以及更新最新源以及刪除不必要的組件,可以更優的降低資源占用率.這樣在這篇文章中我們需要開始安裝WEB環境,我們一般可能常見Nginx或者Apache架構,但是這兩者的占用資源都比較大,我們可以采用LiteSpeed或者Lighttpd,前者我發現編譯經常出現錯誤,所以我采用Lighttpd這樣更省資源一些.
同時,數據庫不準備使用MYSQL,而用占用資源少的SQLite數據庫,既然準備用小內存VPS主機,所以我們考慮數據庫也是關鍵,比如ZBLOG、TYPECHO程序是我們后面需要選擇的,占用資源較小,這個我們后期在討論,同時,PHP肯定需要安裝的.
第一、安裝SQLite
apt-get install sqlite -y
第二、安裝Lighttpd
apt-get install lighttpd -y
第三、安裝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 -y
第四、配置/etc/php5/cgi/php.ini文件
找到cgi.fix_pathinfo字符,然后前面的備注取消,然后檢查是不是參數1.
第五、添加站點目錄
useradd -d /home/wwwroot -m -s /bin/bash www
這里我們需要給站點添加一個目錄,然后把站點文件到時候可以傳上去.
第六、修改/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"
server.groupname = "www"
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"
),
)))
我們把上面文件中的文件都替換掉.
第七、修改權限
chown -R www:www /var/log/lighttpd
/etc/init.d/lighttpd restart
修改權限后重啟Lighttpd,這樣站點環境就安裝完畢.后面我們就可以開始傳數據.
本文來自:http://www.banwagongvps.com/194.html
維易PHP培訓學院每天發布《小內存VPS建站:安裝PHP/Lighttpd/SQLite》等實戰技能,PHP、MYSQL、LINUX、APP、JS,CSS全面培養人才。