重装系统
mariadb把数据库弄死了,重装。 这东西弄得整个服务器全死了:重装的机器都死了。 把数据库文件扯出来,强行挂载在别的机器上,强行导出数据库,这才恢复了数据。 临时上个SSL证书,未来上letsencrypt。
mariadb把数据库弄死了,重装。 这东西弄得整个服务器全死了:重装的机器都死了。 把数据库文件扯出来,强行挂载在别的机器上,强行导出数据库,这才恢复了数据。 临时上个SSL证书,未来上letsencrypt。
之前用Google Apps,但是总感觉不好。 现在换用Mandrill,希望送达率会高。 QQ邮箱继续无人权,请留意。
原来的机器到期了,换一台。 Vultr Seattle。 希望能对大陆友好,速度快点。
服务器不知道为什么自己就关机了。 这机器性能的确很差,4 core也不如vultr的1 core。。。。未来还是双vultr之类吧。
我自己感觉是快了点。不知道大家感觉如何? 求反馈。
LNMP,http://lnmp.org/ ,是我目前看见的最方便的一键部署脚本。什么都不用担心,全傻瓜(bi)化操作。 但是,由于他几乎更换了所有的默认目录,HHVM会认不出这货。 网上所有的教程都是从0开始安装Nginx。这多不爽。 这里记录一下具体操作。 环境: Ubuntu 12.04 x64(<—-重要!x86不能安装,在这里浪费了两个小时) 1.准备环境,安装HHVM: Ubuntu有deb包,不必自己编译了。 具体列表看这里:https://github.com/facebook/hhvm/wiki/Prebuilt%20Packages%20for%20HHVM
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#安装依赖 sudo add-apt-repository ppa:mapnik/boost sudo apt-get update sudo apt-get install libboost1.49-dev libboost-regex1.49-dev \ libboost-system1.49-dev libboost-program-options1.49-dev \ libboost-filesystem1.49-dev libboost-thread1.49-dev #安装HHVM # If this command is not found then do this: sudo apt-get install python-software-properties sudo add-apt-repository ppa:mapnik/boost wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add - echo deb http://dl.hhvm.com/ubuntu precise main | sudo tee /etc/apt/sources.list.d/hhvm.list sudo apt-get update sudo apt-get install hhvm |
最后你会看见:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
******************************************************************** * HHVM is installed. * * Running PHP web scripts with HHVM is done by having your webserver talk to HHVM * over FastCGI. Install nginx or Apache, and then: * $ sudo /usr/share/hhvm/install_fastcgi.sh * $ sudo /etc/init.d/hhvm restart * (if using nginx) $ sudo /etc/init.d/nginx restart * (if using apache) $ sudo /etc/init.d/apache restart * * Detailed FastCGI directions are online at: * https://github.com/facebook/hhvm/wiki/FastCGI * * If you're using HHVM to run web scripts, you probably want it to start at boot: * $ sudo update-rc.d hhvm defaults * * Running command-line scripts with HHVM requires no special setup: * $ hhvm whatever.php * * You can use HHVM for /usr/bin/php even if you have php-cli installed: * $ sudo /usr/bin/update-alternatives --install /usr/bin/php php /usr/bin/hhvm 60 ******************************************************************** |
2. 修改/usr/share/hhvm/install_fastcgi.sh 替换L187~220:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
nginx_check_installed() { echo "Checking if Nginx is installed" if [ -d "/usr/local/nginx/conf/" ] then echo "Detected Nginx installation" return 0 fi echo "Nginx not found" return 1 } nginx_check_custom() { echo "Checking for custom Nginx configuration" if [ ! \( -z "$(grep -E "^[^#]*(fastcgi|hhvm.conf)" "/usr/local/nginx/conf/nginx.conf")" \) \ -o ! \( -z "$(grep -ER "^[^#]*(fastcgi|hhvm.conf)" "/usr/local/nginx/conf/")" \) \ -o ! \( -z "$(grep -ER "^[^#]*(fastcgi|hhvm.conf)" "/usr/local/nginx/conf/vhost/")" \) ] then echo "WARNING: Detected clashing configuration. Look at /etc/nginx/hhvm.conf for information how to connect to the hhvm fastcgi instance." return 0 fi return 1 } nginx_enable_module() { echo "Enabling hhvm Nginx module" insert_line "/usr/local/nginx/conf/nginx.conf" 'server_name.*$' 'include hhvm.conf;' echo "Finished enabling module" } nginx_disable_module() { echo "Disabling hhvm Nginx module" remove_line "/usr/local/nginx/conf/nginx.conf" "hhvm.conf" echo "Finished disabling module" } |
执行。 3.修改相关文件: 1) /usr/local/nginx/conf 将所有的vhosts都改成
1 |
include hhvm.conf; |
2)修改~/vhosts.sh: 同样修改。 4.删除启动项: 停止php-fpm服务,删除/etc/init.d/ 里面的php-fpm,这样这东西就不自动启动了。… Read more »
SB的机器出了问题: I do apologize. We’ve resolved the issue with your container. It does appear that one of our administrators incorrectly typed an IP on another device in the same… Read more »
我弄了个插件,可以通知你我回复了你的评论。我基本上每天都看看评论,最长间隔不会超过36小时,而且基本上有问必答。。。所以请使用真实邮箱。都不是第一天出来混了,我知道怎么处理隐私信息的。。。
挪到新地方了。 SB的机器价格比较公道,30刀/年。 网络速度其实我感觉不如DS,但是不知道大陆会怎么看。IO比较呵呵,但是内存可真慷慨。KVM的好货。 搬家特别简单: 整个数据库导出-PMA导入-新用户-LNMP设置-改DNS-看效果。 这个机器会维持很长时间了。
再次搬家完毕。感谢@sunday的协助。 总体算是特别顺利。 1.入个新VPS: IO和网速都不是特别满意,但是也不贵。KVM架构,这下做东西放心了。 LNMP准备好。 2.提前变解析: 老站点和新站点必须都有直接解析,否则过一会要出乱子。这次差点传不上文件,幸亏老站点有IP直接连接。 3.打包资料: 虽然站点有每日+每周备份,还是要小心。 VPS直接shell进去,打包所有文件,扔在根目录下。等一会远程拖过去。 sql直接打包,PMA就成。 最惨,WP还提供导出功能。 4.远程拖: 文件大肯定麻烦。 5.导入数据库,建立vhost,做好rewrite。 建立账号,数据库连接检查。 6.更改权限,该加组的加组。 7.改回CDN。 完活。