从 LAMP 迁移到 SAMP 时需要做什么和准备什么
我的公司在网络服务器上的补丁管理方面存在一个非常现实的问题。公共服务器已经过时,现在管理层认为这是一个优先事项。然而,他们并没有简单地更新和修补现有服务器(以及随之而来的所有测试),而是开始迁移到 Solaris 服务器,作为“缓解问题”的一种方式。 (我认为这是因为他们碰巧有一些 Solaris 服务器)
我对 Solaris 没有任何问题,而且我发现从技术上讲我的所有 php Web 代码都应该在 MySQL 数据库上运行良好。我也明白从 php4 升级到 php5 需要同样多的思考和测试。
我想知道的是,当服务器团队回来告诉我我的代码不起作用时,我应该注意哪些问题。我现在想开始寻找令人头痛的问题以缓解过渡。
我们目前拥有最后一代堆栈,我假设他们在升级和迁移 PHP、MySQL 和 Apache 服务器时会放入当前一代
问题摘要: 我的公司正在从 Linux 服务器上的 PHP4 站点迁移到 Solaris 服务器上的 PHP4 站点。在为迁移准备代码时我应该注意哪些问题?
My company has a very real problem with patch management on our web servers. The public servers are out of date, and now management considers this a priority. However, rather than simply updating and patching the existing servers (and all the testing that goes along with that) they have embarked on the process of migration to Solaris servers as a way to "mitigate the problems". (I think it is because they happen to have some solaris servers sitting around)
I have no problems with Solaris and I see that technically all my php web code should run fine with the MySQL databases. I also understand it takes as much thought and testing to upgrade from php4 to php5.
What I want to know it what sort of gotchas should I have my head up for when the server team comes back and tells me my code doesn't work. I want to start looking for headaches now to ease the transition.
We have last generation of the stack currently, and I assume they will put in the current generation when they upgrade and migrate the servers for PHP, MySQL, and Apache
Question Summary:
My company is moving from PHP4 sites on Linux servers to PHP4 sites on Solaris servers. What issues should I look for in preparing my code for the move?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有几个重要的细节。
首先,我相信您需要一份服务合同才能访问安全补丁集。接下来,您必须从 Sun 的网站下载每月(或每季度)的补丁集。补丁是通过执行补丁集附带的 shell 脚本来安装的。某些甚至大多数补丁都会失败,具体取决于该补丁是否适用于您的配置。
在第一轮补丁之后,使用以下命令重新启动盒子:reboot --(不要忘记两个破折号),这样内核就会知道更新配置信息。之后,您再次安装相同的补丁集,以防第一轮补丁存在依赖性。你猜怎么着,再次重启。
它是一个比 Linux(或者至少是 Linux 的某些变体)更加正式的维护系统。显然 PHP、MySQL、Apache 等都工作得很好。但根据您选择的芯片组(酷线程),您需要安装正确调整的 SAMP 堆栈版本(称为 glassfish 堆栈或其他名称)。
我不会太担心 shell,因为对于大多数管理员来说,以 root 身份操作并不是通常的行为 - 因此您可以选择 bash 或 ksh。另外,不要从 /bin/sh 更改根 shell,它是静态链接的,以防您破坏某些共享库(如 libc.so)。
您还需要下载 SunStudio(当前版本为 12.1)并使用 Sun 的编译器编译下载的源文件,因为它可以更好地针对 SPARC 芯片组进行优化。并且在编译时不要忘记使用 -fast 编译器标志。除此之外,我唯一能想到的就是下载Sun的DTrace Guide(动态跟踪指南)。
哦,请阅读 pkgadd 和 pkgrm。还有一件事,top 在默认安装中可能不存在,因此请使用 Sun 的版本:prstat。并熟悉 svcadm 来管理服务。唉,我只能想到这么多了。
There are a couple details that are important.
First, I believe you need a service contract to access security patch-sets. Next you have to download monthly (or quarterly) patch sets from Sun's website. The patches are installed by executing a shell script that comes with the patch-set. There will be failures for some or even most of the patches depending on whether that patch applies to your configuration.
After the first round of patches, restart the box with: reboot -- (don't forget the two dashes) so the kernel will know to update configuration information. After that, you install the same patch set again in case there were dependencies from the first round of patching. And guess what, reboot -- again.
It's a much more formalized system of maintenance than Linux (or at least some variants of Linux). Obviously PHP, MySQL, Apache, etc. all work fine. But depending on the chip-set you choose (cool-threads) you'll want to install the proper tuned version of their SAMP stack (it's called something like glassfish stack or something).
I wouldn't worry too much about the shell since operating as root isn't usual behavior for most administrators - so you can pick bash or ksh. Also, do not change the root shell from /bin/sh it's statically linked in case you bugger up some shared libraries like libc.so.
You'll also want to download the SunStudio (current version is 12.1) and compile downloaded source files with Sun's compiler since it better optimizes for the SPARC chip-set. And don't forget to use the -fast compiler flag when you do compile. Other than that the only other thing I can think of is to download Sun's DTrace Guide (dynamic tracing guide).
Oh, and read up on pkgadd and pkgrm. One more thing, top may not exist on a default install so use Sun's version: prstat. And become familiar with svcadm to manage services. Alas, that's all I can think of.
如果您知道的话,Solaris 是哪个版本?
假设他们安装相同或更新版本的 PHP 和 MySQL,在 php4 级别上差别很小。迁移到 Solaris 时更容易损坏的是 shell 或 C 代码,因此如果您也负责其中任何一个,那么您将有更多工作要做。
关于 shell,值得记住的是 Solaris 使用 Bourne shell,而不是 Bash,因为它是
/bin/sh
;很多人都有一些用于执行各种任务的 shell,并且很容易出现在普通 bourne-shell 中不起作用的 bash-ism。同样,如果您完全使用外部二进制文件,Solaris 的二进制文件可能会完全不同。
Which version of Solaris, if you know?
There will be very little difference at the php4 level, presuming they install the same or newer version of PHP and MySQL. What's more likely to break when moving to Solaris is shell or C code, so if you're responsible for any of that as well, you'd have more work to do.
On the subject of shell, it's worth remembering that Solaris uses the Bourne shell, not Bash, as it's
/bin/sh
; lots of people have little bits of shell they use for various tasks, and it's easy to have bash-isms in there that don't work in vanilla bourne-shell.Likewise, if you shell out to external binaries at all, Solaris ones may be quite different.