128M 内存 VPS 安装 WordPress 是怎样一种体验?

in #cn7 years ago (edited)

前阵子买了个廉价 VPS,今天有坛友问这 VPS 怎么架设 http 服务器,忍不住就体验了一下。体验过程还算顺利,本以为会安装失败,意料之外,成功搭建运行 WordPress。

<p dir="auto">内存小,安装 nginx 或者 lighthttpd 会比较好。技术比较菜,加上懒,还是选择 <a href="https://lnmp.org/install.html" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">LNMP 一键包安装环境。 <p dir="auto">环境:128MB 内存、128MB SWAP、10GB 硬盘,CentOS 6 32bit <p dir="auto">安装 LNMP 前先更新一下系统,安装必要的支持。 <pre><code>yum update && yum upgrade yum install wget && yum install screen <hr /> <p dir="auto">执行完毕,接下来安装 LNMP。 <hr /> <pre><code>screen -S lnmp wget -c http://soft.vpser.net/lnmp/lnmp1.4.tar.gz && tar zxf lnmp1.4.tar.gz && cd lnmp1.4 && ./install.sh lnmp <hr /> <p dir="auto">选择配置:MySQL 5.5.56、MySQL InnoDB -> n、其余默认即可。(我测试的时候选了 PHP7) <p dir="auto">接下来就是漫长的等待。 <p dir="auto"><strong>Install lnmp takes 218 minutes. <p dir="auto">我测试是用了差不多四个小时才安装完。LNMP 搭建好就快了。 <p dir="auto">添加主机,按提示操作即可。详细教程:LNMP添加、<a href="https://lnmp.org/faq/lnmp-vhost-add-howto.html" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">删除虚拟主机及伪静态使用教程 <pre><code>lnmp vhost add <hr /> <p dir="auto">安装 WordPress <pre><code>cd /data/www/default ##网站目录 wget -O w.zip https://wordpress.org/latest.zip unzip w.zip cd wordpress/ mv * ../ <hr /> <p dir="auto">至此网站搭建成功。 <p dir="auto">参考『<a href="https://blog.alswl.com/2011/11/vps-lnmp-setup-config/" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">128M内存VPS LNMP安装优化小记』稍稍调整了一下网站配置: <h3>Nginx 配置 <p dir="auto">/usr/local/nginx/conf/nginx.conf <pre><code>worker_processes 1; events { worker_connections 1024; } <h3>MySQL 配置 <p dir="auto">/etc/my.cnf <pre><code>open_files_limit = 600 max_connections = 100 skip-innodb #禁用innodb数据库引擎 <h3>PHP 配置 <p dir="auto">/usr/local/php/etc/php-fpm.conf <pre><code>pm.max_children = 2 #默认是10 pm.max_spare_servers = 2 #默认是6 <hr /> <p dir="auto">配置完,没啥访问量的情况下,内存还有点剩余。 <p dir="auto">solusvm 控制面板看到的内存占用 <p dir="auto"><img src="https://images.hive.blog/768x0/https://cyhour.com/wp-content/uploads/2018/01/634-mem-solusvm.png" alt=" 634-mem-solusvm " srcset="https://images.hive.blog/768x0/https://cyhour.com/wp-content/uploads/2018/01/634-mem-solusvm.png 1x, https://images.hive.blog/1536x0/https://cyhour.com/wp-content/uploads/2018/01/634-mem-solusvm.png 2x" /> <p dir="auto">free -m 内存占用 <p dir="auto"><img src="https://images.hive.blog/768x0/https://cyhour.com/wp-content/uploads/2018/01/634-mem-free-m.png" alt=" 634-mem-free-m " srcset="https://images.hive.blog/768x0/https://cyhour.com/wp-content/uploads/2018/01/634-mem-free-m.png 1x, https://images.hive.blog/1536x0/https://cyhour.com/wp-content/uploads/2018/01/634-mem-free-m.png 2x" /> <p dir="auto">好了,言归正传,128M 内存 VPS 安装 WordPress 是怎样一种体验? <p dir="auto">答:心急吃不了热豆腐。 <hr /> <p dir="auto">Originally Posted on <a href="https://steemit.com/cn/@zhijun/128m-vps-wordpress" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Steemit & <a href="https://cyhour.com/634/" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Blog<span> by <a href="/@zhijun">@zhijun.
Sort:  

挺不错,我两个128M内存的都是直接

<pre><code>apt-get install nginx <p dir="auto">然后布置好PHP环境。都用的typecho。= =wp真心有点大。

额,小内存据说大便系统更省内存?

是的,Debian系貌似更给力~