基于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
- 老鹰主机万圣节促销→虚拟主机 5 折 分销主机 6 折全球[VPS测评]
- 疯狂猜成语 图猜成语偏字的人字旁画着红圈和斜线旁边还有一个奇字是什么成语全球[VPS测评]
- Vultr 推出 Object Storage 对象存储 250G 空间虚拟空间(主机)
- 劳动节秒杀 腾讯云→1 核 1G 1M 香港免备案套餐年付¥249 2 香港VPS[主机]
- [11.11]KVMLA 香港 日本 新加坡年付 6 折 月付 8 折日本VPS[主机]
- 标准互联→襄阳电信高防 VPS 100G 200G 防御 Hyper-V全球[VPS测评]
- 特价 $1.8 月 512M 内存 10G 硬盘 1T 流量@1Gbps全球[VPS测评]
- 流量翻倍 RootNerds→日本直连线路 VPS OpenVZ 虚拟架日本VPS[主机]
- 四个倒着的脚字是什么成语?全球[VPS测评]
- Pyclouds→40 元 月 256MB 内存 5GB 空间 100G虚拟空间(主机)
- 企鹅小屋→深港专线 KVM VPS 256MB 内存 90GB 月流量 全球[VPS测评]
- hkserversolution→2.3 折优惠 美国原生 IP 解锁“美国VPS[主机]
- DedeCMS 中 dede:channel 标签调用栏目简介 desc全球[VPS测评]
- WordPress代码实现自动为文章中的图片添加alt、title属性全球[VPS测评]
- 推荐! Virmach → 1C 512M RAM 15G SSD 25全球[VPS测评]
- 2023年 IDC市场结构和方向的深度分析全球[VPS测评]
- 香港的云服务器值得租用吗?有什么好处?香港VPS[主机]
- 福州职业技术学院获得世界职业院校技能大赛云计算赛项银牌全球[VPS测评]
- 云服务器能干什么?有几十种玩法?阿里云,腾讯云服务器如何购买?全球[VPS测评]
- 云服务器都是有哪些特点?全球[VPS测评]
- JGKVM(极光kvm),便宜香港VPS(5G防御秒解),极光互联vps香港VPS[主机]
- 如何设置必应api 自动推送网站全球[VPS测评]
- 很简单的图片不规则布局样式,纯css样式实现的图片瀑布流布局全球[VPS测评]
- 岚云:香港安迅/沙田CN2直连,75折起,1核/1G/30G SSD/1香港VPS[主机]
- 搬瓦工VPS:高端线路助力企业运营,10Gbps美国 cn2 gia,1日本VPS[主机]
- 企鹅小屋怎么样?深港IPLC专线销售 500M大带宽/2核1G内存/55全球[VPS测评]
- 为什么大家都选择香港服务器建站香港VPS[主机]
- 买了一台云服务器到底能干什么?全球[VPS测评]
- LOCVPS,全新香港大浦CN2 VPS 2核4G内存3M仅54/月香港VPS[主机]
- 56云服务器:国内云服务器2核2G5M仅377.46元/年;香港物理服务香港VPS[主机]
转载请注明原文地址:http://www.motoll.com/read-142260.html