超迷你博客收集及搭建方法

这几天发现了好几个32M或者64M内存的小博客,给大家看看玩~~

  • 64MB.TOP:来源于搬瓦工的绝版货,年付3.99美金(很久之前的绝版货了)
  • 64MB.WIN:来源于特价alpharacks,年付2.99美金(去年黑五,目前木有,目前最便宜的是这个,9刀一年)
  • 32空间 :来源于屌鸡之前的绝版货(目前最低的是64M,一年48人民币,但没货,具体可以看这里
  • Hello World:参照本文搭建的站点,VPS为屌鸡的64M

搭建方法一:Lighttpd + PHP + SQLite

方法二看这里:Nginx + PHP + SQLite

  • 这个其实三个博客都有些,我就转载过来了。

系统为 Debian 7 32位系统,Debian 6 因不再维护更新软件时会出问题。

更新软件

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

LAMP安装(伪)

apt-get install sqlite lighttpd 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 文件(建议通过winscp进行操作)

vi /etc/php5/cgi/php.ini
  • 找到 cgi.fix_pathinfo=1,把前面的; 去掉。

网站程序

  • 将 typecho 的文件放到自己设定的网站根目录 (/var/www/html), 设置目录
cd /var
mkdir www 
cd www
mkdir html
cd html
apt-get install wget
wget https://github.com/typecho/typecho/archive/v1.1-15.5.12-beta.zip
apt-get install zip unzip
unzip v1.1-15.5.12-beta.zip
mv typecho-1.1-15.5.12-beta/* .
rm -rf v1.1-15.5.12-beta.zip
rm -rf typecho-1.1-15.5.12-beta
chown -R www-data.www-data /var/www/html
  • 定位置lighttpd
cd /etc/lighttpd
vi lighttpd.conf
  • 替换为以下内容

注意请将$HTTP[“host”] =~ “(^|.)liyuans.com$” 中的liyuans.com替换为你的域名

server.modules = (
    "mod_access",
    "mod_alias",
    "mod_compress",
    "mod_redirect",
    "mod_rewrite",

)

server.document-root        = "/var/www/html"
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"
server.port                 = 80

index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

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

# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

$HTTP["host"] =~ "(^|\.)liyuans\.com$" {
server.document-root = "/var/www/html"
accesslog.filename = "/var/www/access.log"
server.error-handler-404 = "/404.html"
}

url.rewrite = (
"^/(admin|usr)/(.*)"  => "/$1/$2",
"^/(.*).html$" => "/index.php/$1.html",
"^/archives/(.*)" => "/index.php/archives/$1",
"^/category/(.*)" => "/index.php/category/$1",
"^/([0-9]+)/([0-9]+)/$" => "/index.php/$1/$2/",
"^/tag/(.*)/$" => "/index.php/tag/$1",
"^/search/(.*)/$" => "/index.php/search/$1",
"^/(.*)page/(.*)" => "/index.php/$1page/$2",
"^/(feed.*)" => "/index.php/$1",
"^/action/(.*)" => "/index.php/action/$1",
"^/(.*)comment" => "/index.php/$1/comment"
)

在当前路径下,复制 fastcgi 相关文件

cd conf-enabled
cp ../conf-available/*fastcgi* .

重启 Lighttpd

/etc/init.d/lighttpd restart

输入liyuans.com/install,安装即可
注意请将liyuans.com替换为你的域名
伪静态规则在前面已经设置完,直接后台开启即可。