分类: 虚拟主机

虚拟主机使用的一些文章

  • 从阿里云备案转入腾讯云用时及经验分享

    博客的第一次备案是在阿里云做的,现在将主机从阿里云迁移到腾讯云之后,需要做备案转入。由于迁移的那几天工作比较忙,一直没有拍照提交材料,终于在上周完成了操作。

    我的ICP主体备案号下有两个域名,第一个域名是先在管局备案的,前段时间自己放弃维护关掉了,现在备案转入域名nopme时,要求第一个域名的网站必须是打开的,否则腾讯不予提交管局审核域名转入。如果你也涉及到关闭的网站,建议提前打开再向腾讯云提交转入申请。

    网站名称必须和备案时的一致,如果改了网站名称的话,建议提前改好,等通过审核之后再改回原名即可。以下是域名nopme.com在域名转入涉及到的几个时间点,分享给大家:

    2018-08-05 22:20:59 提交腾讯云审核
    2018-08-06 09:41:28 腾讯云初审通过
    2018-08-06 09:41:30 邮寄资料审核通过
    2018-08-06 10:06:52 提交幕布照片
    2018-08-06 14:33:35 幕布审核通过
    2018-08-06 17:45:13 已提交管局
    2018-08-10 09:50:21 管局审核通过

    由于我有幕布照片,所以中间环节比较快,这里也赞一下湖南通管局的效率,从提交到审核通过只用了4个工作日,比预估的20个工作日快多了。

  • Namecheap 2018年续费8折优惠码

    之前在Namecheap注册了两个ca域名,本月底就要过期,找了一圈续费到优惠码,在V2ex发现了一枚去年11月的8折优惠码,没想到2018年还能用,8折续费优惠。

    优惠码 FCDISCOUNT

    优惠说明是domain, hosting, SSL, email, renewal 都可以使用,我是renewal,新注册应该也可以使用,欢迎测试。

    如果优惠不能用了,还希望能留言提醒我一下,谢谢!

  • The server quit without updating PID file (/var/run/mysqld/mysqld.pid)错误解决办法

    昨天搭好的WordPress,今天早晨一打开一看,提示Error establishing a database connection ,毫无疑问是数据库故障了,找了几个帖子,只有这一个有用。

    http://blog.csdn.net/asp89007342/article/details/52681774

    故障原因是多了一个my.cnf,导致mysql数据库无法启动,保留/etc/my.cnf,删除mysql目录下的my.cnf 之后,重启mysql即可.

    执行指令

    rm -rf /etc/mysql/my.cnf

    service mysql restart

    我是在阿里云安装 ubuntu 14.04 lnmp 环境下试验成功的。

     

  • DigitalOcean开始支持FreeBSD

    DigitalOcean应广大客户要求,在今天正式开始支持FreeBSD。附上官方的宣传海报:

    FreeBSD作为DigitalOcean平台上出现的地一个非Linux内核的操作系统,以稳定性和良好的操作性而著称。作为20156年DigitalOcean的第一个大动作,期待DigitalOcean能够提供更多更好的服务。本来打算翻译官方给出的详细说明,发现自己的中式英语太蹩脚了,就不献丑了,在这里附上官方的说明,供参考。

    We’re happy to announce that FreeBSD is now available for use on DigitalOcean!

    FreeBSD will be the first non-Linux distribution available for use on our platform. It’s been widely requested because of its reputation of being a stable and performant OS. While similar to other open source unix-like operating systems, it’s unique in that the development of both its kernel and user space utilities are managed by the same core team, ensuring consistent development standards across the project. FreeBSD also offers a simple, yet powerful package management system that allows you to compile and install third-party software for your system with ease.

    One particularly compelling attribute of the FreeBSD project is the quality of theirdocumentation, including the FreeBSD Handbook which provides a comprehensive and thoughtful overview of the operating system. We at DigitalOcean love effective and concise technical writing, and so we’ve also produced numerous FreeBSD tutorials to aid new users with Getting Started with FreeBSD.

    We understand that this has been a long standing user request, and we’ve heard you. You might be asking yourself – what took so long?

    The internal structure of DigitalOcean’s engineering team has rapidly changed over time due to the dynamic growth of the company. What began as a couple of guys coding furiously in a room in Brooklyn has ballooned to a 100+ person organization serving hundreds of thousands of users around the globe. As we’ve grown, by necessity we’ve needed to adjust and reorganize ourselves and our systems to be able to better serve our users. There have been many experiments in how we approach, prioritize and execute this work; this image is a result of the successful alignment of a few key elements.

    Technical Foundation

    Last year, we built our metadata service — allowing a droplet to have access to information about itself at the time that it’s being created. This is a powerful thing because it gives a vanilla image a mechanism to configure itself independently. This service was a big part what allowed us to offer CoreOS, and in building it, it gave us more flexibility in what we could offer moving forward. Our backend code would no longer need to know the contents of the image to be able to serve it. On creation, the droplet itself could query for configurables — hostnames, ssh keys, and the like — and configure itself instead of relying on a third party.

    This fundamental decoupling is an echo of a familiar refrain: build well defined interfaces and don’t let knowledge leak across those boundaries unnecessarily. It’s allowed us to free images from customization by our backend code, and entirely sidestep the problematic issue of modifying a UFS filesystem from a Linux host.

    Since we now had a feasible mechanism to allow images to be instantiated independently of our backend, we just needed to put the parts together that would allow us to inject the configuration upon creation. FreeBSD doesn’t itself offer cloud versions of the OS similar to what Canonical and Red Hat provide, so we started from a publicly available port of cloud-init meant to allow FreeBSD to run on OpenStack.

    In order to query metadata, we need to have an initial network configuration in order to build our configuration, since DigitalOcean’s droplets use static networking. During boot time, we bring up the droplet on a v4 link-local address in order to do the initial query to the service. From there, we pick up the real network config, hostname, and ssh keys. The cloud-init project then writes a configuration that’s associated with the droplet’s ID. Linking this configuration to the droplet ID is the mechanism that allows it to know whether the image is being created from a snapshot or new create, or is just a rebooted instance of an already configured droplet.

    Once this configuration has been injected, FreeBSD’s boot process can continue and use it accordingly — eventually booting into the instance as expected.

    Focus

    This endeavor began life as an experiment in how we organize ourselves in the engineering team. We were given a few weeks to pick a project, self organize in cross-functional teams, and execute. A lot went right during this process that allowed this project to succeed.

    Deadlines are powerful things. Not in a punitive or negative sense of the word, but in a sense that there will be a well defined time where work on this will collectively end. So is having a very clear picture of what “done” looks like. In the case of BSD, it was particularly powerful to have a clear goal of a alpha functional BSD droplet with a date to drive for. Given the freedom to focus on a single goal, clear communication, and well defined restraints, we were able to finally deliver a long standing user request with relative ease.

    This is the start to the many things we’re excited to build in 2015!

  • ramnode 128M 使用感受及2015年最新coupon优惠码

    准备重新弄下早先注册的域名taoeuro,在v2ex看了不少网友的推荐,于是在昨天购买了一个ramnode 最低配置的vps,考虑到一般虚拟主机性价比不高,所以选择了价位相当的vps,还有一个独立ip,并且自己的可操控能力较强。

    15刀年付,几个机房可供选择,我选择了西雅图的机房,湖南电信这边访问速度还不错。现在的15刀每年的这款vps性能较之前的版本有了缩水,早先是内存和swap都是128m,现在内存虽然还是128m,但是swap交换分区已经缩水到64m,不要小看了这点缩水。

    vps所装程序中,如果用来搭建网站的话,mysql是消耗内存的大户,swap减半之后,mysql 5.5 都没办法安装,更不容说维持网站日常访问了。所以如果用来搭建wordpress的话,还是不推荐了,频繁的宕机会被搜索引擎给k了的。

    貌似他们的退款是3日内提交才可以,所以如果购买之后不满意的话,请第一时间联系客服取消服务。由于早先的优惠码已经都不能用了,这里给大家推荐一个最新的折扣码,下单减5刀。

    优惠码是官网提供的,WOWSSD5

    Get a $5 credit when you order a new VPS! Coupon: WOWSSD5

    这款vps的i/o性能很不错,如果用来做其他的话,还是很不错的。

    Update:

    目前最新可用折扣为订单9折优惠,优惠代码为SSD10

    10% OFF ANY NEW SSD VPS! Coupon: SSD10

  • digitalocean wordpress 数据库错误解决办法

    wordpress数据库连接错误的毛病相信很多用户都遇到过,无非是数据库出了故障,导致连接失败。前几日,一直被数据库连接错误的问题所围绕。刚开始,认为是vps性能差导致,于是开启了cache,可是依然如故,没过多久就又连接错误了。

    从网上搜索了一些优化mysql数据库的文章,尝试优化数据库,优化之后直接无法启动数据库了,查看日志后发现wp_options这个表故障所致,在vps中,进入mysql,repair下wp_options这个表,就可以了。

    用到的命令:

    登录MySQL:mysql -uroot -p (用root账户登录),然后输入密码;

    修复数据表:repair 表名

    修复wp_options的话,就输入 repair wp_options

    退出mysql操作: q

     

  • digitalocean使用两天感受

    博客由digitalocean驱动,有5天了,整体感觉不错,不过数据库挂掉了不下两次了,由于前几日没注意,看到阿里云发来的监测日志,才意识到宕机时间那么久。联系了客服,客服给的建议,竟然是让升级服务,说是512内存的vps支撑不了。

    这个确实有些让人难以接受了,我流量少的可怜,不存在大的波动,怎么可能频繁宕机呢?继续用两天试试,如果不行的话,就重装试试,实在不行就用完这个月再换回ec2,毕竟稳定比什么都重要。

    附上客服的奇葩解决办法:

    The most common reason why MySQL is not running is that it stopped or failed to start as a result of not enough memory.

    This can usually be seen by attempting to start the mysql server (“service mysql start” on Ubuntu and some other systems) and then reviewing the mysql error log (usually in /var/log/mysql/error.log or similar file path).

    A useful program to review the logs one page at a time is “less” –for example:

    less /var/log/mysql/error.log

    If you see memory issues such as “mmap can’t allocate” then you can be sure that you are having memory issues.

    Potential solutions are:

    1) upsize to a larger server. We recommend at least a 1GB droplet for any server utilizing a MySQL database.

    2) Enable swap space, which functions in the same way as RAM, except it’s slower since it’s using disk space to simulate RAM. Your system uses this only in the case where you run out of RAM, and it’ll likely result in slower responses from your site, but if you add enough swap (generally twice as much as the amount of RAM you have is a safe bet) it should prevent MySQL from crashing and causing your site to go down. You can find a guide relevant to your Linux distribution here:

    有点店大欺客的感觉了,之前哪怕用000webhost都没有这么脆弱。

  • 从amazon ec2搬迁至digitalocean

    博客使用Amazon EC2有一年了,一年的免费使用配额就要结束,由于博客所占用的空间以及流量比较低,综合考量之后,决定搬迁。EC2使用过程中,直到最后这个月的时候,才出现了MYSQL数据库有损坏的问题,简单修复后仍然正常使用,没有重启过,没有遇到过宕机。单论稳定这一条,还是很赞的。

    搬迁思路,很简单,EC2和digitalocean分别安装phpmyadmin,推荐安装4.0的版本,否则会遇到提示数据库版本低的问题。备份wp-content目录,copy到digitalocean中。

    不推荐使用wordpress的数据库备份插件,导入后会遇到乱码问题。

    由于博客使用了伪静态,导入到digitalocean后要设置一下。digitalocean一键安装的wordpress是使用的lamp架构,vps默认直接开启了伪静态。只需要在wordpress根目录添加.htaccess文件即可。

    还有一点就是wp-content文件夹的权限设置。

    处理完了以上这些问题就搬家成功了。如果遇到问题测试域名的话,建议自己本机改host来配合测试。

  • amazon ec2快速安装lnmp环境

    使用ec2安装lnmp环境,由于配置比较简陋,军哥的一键安装包,要跑半天,如何快速安装呢?答案就是下载安装包时,下载完整版。

    首先要运行 sudo su指令,切换到root权限。请注意当前路径,看是否在根目录下,如果不是,请通过cd ..指令,退回到根目录下,输入screen -S lnmp来打开远程会话功能,接下来,根据您的系统版本来执行相应的指令。

    CentOS系统下执行:wget -c http://soft2.vpser.net/lnmp/lnmp1.0-full.tar.gz && tar zxvf lnmp1.0-full.tar.gz && cd lnmp1.0-full && ./centos.sh

    Debian系统下执行:wget -c http://soft2.vpser.net/lnmp/lnmp1.0-full.tar.gz && tar zxvf lnmp1.0-full.tar.gz && cd lnmp1.0-full && ./debian.sh

    Ubuntu系统下执行:wget -c http://soft2.vpser.net/lnmp/lnmp1.0-full.tar.gz && tar zxvf lnmp1.0-full.tar.gz && cd lnmp1.0-full && ./ubuntu.sh

    这样能快一些,2个小时左右,能搭建完成。

    完成之后,请先运行 ./upgrade_php.sh这一步,

    提示您输入php版本,输入us2.php.net目前可用的发行版即可,现在输入5.3.28即可

    升级您的php版本后就可以添加虚拟主机。

  • openshift wordpress Service Temporarily Unavailable 503错误解决办法

    今天中午,收到阿里云监控发来的短消息,博客使用的openshift空间出现503错误。于是打开监控日志阅读,发现故障出现在2013-10-18 00:13:04这个时间,到我开始处理已经过了14个小时。如果是大网站的话,使用openshift驱动一定要注意了。

    我使用openshift架设了两个网站,另一个使用的程序是deiscuz 7.2,一切正常,不确定是否是博客程序wordpress自身的原因导致,这一点还需要继续观察。

    最简单的解决办法:

    登陆您的openshift账户,在openshift网站登陆即可,访问console程序控制台页面,找到出现503错误的程序,将其restar重启即可。

    重启按钮标示:restart-openshift

    重启以后就可以解决503错误。

    特别提醒:使用免费空间,尤其是国外的免费空间,大环境在那里摆着,一定要将监控、备份做好,一旦出现故障,努力将损失降低到最小。