基于64MB VPS主机安装Typecho或者ZBLOG PHP网站环境全过程
![]() | ![]() | ![]() | ![]() |
| 【性价之王】 | 【线路之王】 | 【价格之王】 | 【配置之王】 |
| 【免费之王】 | 【香港首推】 | 【梯子之王】 | 【独服之王】 |

看到不少玩转VPS高手在小内存VPS建站,一来可以显的自己多会折腾VPS,二来可以利用剁手购买的小内存年付、便宜VPS合理利用资源,至少可以挂在那边玩玩网站。不论在国内还是在国外,有看到用低至32MB内存的VPS建立博客的,这里蜗牛考虑到没有32MB内存的VPS机器。
第一、确定64MB内存VPS环境以及精简系统
这里蜗牛采用Debian 6 32位系统环境,而且需要升级到最新系统包环境,以及要进行Debian的精简。
apt-get update&&apt-get upgrade #升级系统
apt-get -y purge apache2-* bind9-* xinetd samba-* nscd-* portmap sendmail-* sasl2-bin #移除多余的软件
apt-get -y purge lynx memtester unixodbc python-* odbcinst-* sudo tcpdump ttf-* #移除多余的组件
apt-get autoremove && apt-get clean #清理缓存文件
这里,我们要先对debian系统进行升级、精简不必要的自带软件和组件,这样可以在一定程度上节省几M内存占用。
第二、安装Lighttpd,SQLite和PHP建站环境
因为考虑到MYSQL占用资源较大,即便能够安装,后面基本也跑不动,除非就自己玩玩,所以还是准备使用SQLITE数据库,因为ZBLOG PHP和TYPECHO程序都带的,占用资源很小。
A – 安装系统必须要的环境和组件
apt-get install sqlite #安装sqlite数据库
apt-get install lighttpd #安装lighttpd引擎驱动
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以及相关站点需要的组件
B – 配置系统文件
修改/etc/php5/cgi/php.ini文件中的cgi.fix_pathinfo参数,取消前面的;然后检查参数值是不是1,如果不是需要修改成1
C – 建立WWW单独用户
useradd -d /home/wwwroot -m -s /bin/bash www
D – 修改Lighttpd配置文件(/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\\”
),
)))
修改内容如上。
E – 设置Lighttpd拥有者权限和重启Lighttpd
chown -R www:www /var/log/lighttpd
/etc/init.d/lighttpd restart
这里我们的环境就配置完毕,后面就只需要创建站点建站。
第三、64MB内存VPS环境添加站点
mkdir -p /home/wwwroot/itbulu
mkdir -p /home/wwwroot/itbulu/public
手工添加站点目录。
chown www:www /home/wwwroot/itbulu/public
修改目录所有权。
chown -R www:www /var/log/lighttpd
lighttpd日志目录存放所有权。
/etc/lighttpd/lighttpd.conf
配置lighttpd.conf文件设定站点。在文件最后,添加下面脚本配置站点。
$HTTP[\\”host\\”] =~ \\”(^|\\\\.)itbulu\\\\.com$\\” {
server.document-root = \\”/home/wwwroot/itbulu/public\\”
accesslog.filename = \\”/var/log/lighttpd/itbulu/access.log\\”
server.error-handler-404 = \\”/404.html\\”
}
这里我们需要对应创建的目录和站点域名对应修改。
/etc/init.d/lighttpd restart
重启lighttpd生效。
这样,我们站点就创建完毕,后面我们做什么呢?肯定是搭建我们需要的Typecho或者ZBLOG PHP程序。
[64MB VPS]历史优惠活动内容
猜你可能想看的VPS
- 促销 sharktech 鲨鱼机房→VPS 全场 75 折 独立服务器 独立服务器[U]
- 优惠 80M 主机→全场 75 折优惠 可按小时计费 香港 CN2 GI香港VPS[主机]
- 0 元购 酷番云→1 核 1G 60G 硬盘 2M 带宽 内蒙机房邀请好全球[VPS测评]
- 优惠 Digitalvm→日本机房 10G 带宽超多流量 国内连接速度超日本VPS[主机]
- 劳动节 hosteons→7 大促销活动 不限流量 VPS 低至$13.WINDOWS
- VULTR→KVM 月付 3.5 美元起 16 个机房 支持支付宝微信全球[VPS测评]
- drServer→$56 月-E 2134 16GB 480GB SSD全球[VPS测评]
- 大带宽高防 ¥1210 年 2 核 CPU 4G 内存 40G SSD 全球[VPS测评]
- stsdust 广州移动 vds 预售,1Gbps 带宽无限流量,硬件资全球[VPS测评]
- 便宜 PacificRack→$10.99 每年 1 核 512M 内存全球[VPS测评]
- 劳动节 搬瓦工→新增 10Gbps 带宽的 cn2 gia 线路 VPS全球[VPS测评]
- AlphaVPS 黑五 1GB内存 2核CPU 1T流量 免费赠送DA面全球[VPS测评]
- RepriseHosting独立服务器促销,$27.97起/月,免费升级独立服务器[U]
- DediPath黑五全场VPS三五折,月付最低1.2美元起;高配便宜服务全球[VPS测评]
- Alwyzon奥地利便宜vps,单核/1.5G内存/1Gbps,年付€1全球[VPS测评]
- 微基(idc.wiki)建站虚拟主机五折优惠 1G 113元三年全球[VPS测评]
- BuyVM 拉斯维加斯 媒体解锁-中国特别版 → 无限流量 → 1G 2全球[VPS测评]
- Wikihost(idc.wiki) → 日本CN2 去程163回程C日本VPS[主机]
- 狗云DogYun,香港cn2云服务器/优惠码/流量包,按小时计费云服务器香港VPS[主机]
- 磐逸云:全场8折优惠,1核1G香港套餐月付24元,日本NNT线路套餐,月日本VPS[主机]
- TmhHost优惠码:黑五优惠全场8折,洛杉矶vps、日本CN2、韩国C日本VPS[主机]
- 初忆云: 滁州电信、湖北电信云服务器价格低至10元起,续费同价全球[VPS测评]
- 快速云:云计算分类和云计算的特点全球[VPS测评]
- 云计算到底是谁发明的?全球[VPS测评]
- 桔子数据:香港CN2大带宽云服务器28元/月_1核/1G/10M带宽/C香港VPS[主机]
- wikihost微基主机服务,香港稳定虚拟主机8折,3.73元/月起,C香港VPS[主机]
- tmhhost:香港CN2/NNT,美国CN2 GIA VPS,韩国CN韩国VPS[主机]
- cmivps:全场7折,香港不限流量VPS,Windows系统,LinuWINDOWS
- 恒创科技:香港/美国服务器_最后10天爆款特价,三网强制CN2美国VPS[主机]
- 华纳云年终钜惠活动:云服务器半年低至280元,香港高防服务器999元香港VPS[主机]
转载请注明原文地址:http://140.238.13.167:12355/read-142260.html











