免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4622 | 回复: 5
打印 上一主题 下一主题

[FreeBSD] 如何将apache卸载掉,升级为nginx? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-07-06 00:22 |只看该作者 |倒序浏览
前序:
http://www.freebsdchina.org/forum/viewtopic.php?t=46193
http://freebsd.chinaunix.net/bbs ... ;page=1#pid10799726

这个问题一直困扰着我,大家给的建议是升级为nginx,而我是新手,想请大家如何升级,我在百度和谷歌搜索了很多文章,没有找到。

说明下我服务器情况:
系统配置:
  1. cpu:P4 3.0双线程
  2. 内存:1G*2
  3. 硬盘:SATA 160G
复制代码

环境配置:
  1. Freebsd 7.2
  2. PHP5.2.9
  3. MYSQL5.0.81
  4. APACHE2.2.11
复制代码

我的分区:
  1. / 512m
  2. /swap 4g
  3. /tmp 2g
  4. /var 50g
  5. /usr 5g
  6. /www 100g
复制代码


软件都是使用ports安装的。
卸载是使用哪个比较合适:
  1. make deinstall clean
  2. pkg_delete apache-version
复制代码

我参考了以下一些文章,但是还是不知道用哪个命令会比较适合我?
http://www.freebsdchina.org/forum/topic_14336.html
http://bbs3.chinaunix.net/thread-602459-1-1.html

我的PKG_INFO的输出:
  1. ccer@king[/usr/home/ccer]# pkg_info
  2. ZendOptimizer-3.3.0.a An optimizer for PHP code
  3. apache-2.2.11_4     Version 2.2.x of Apache web server with prefork MPM.
  4. autoconf-2.62       Automatically configure source code on many Un*x platforms
  5. autoconf-wrapper-20071109 Wrapper script for GNU autoconf
  6. automake-1.10.1     GNU Standards-compliant Makefile generator (1.10)
  7. automake-wrapper-20071109 Wrapper script for GNU automake
  8. bigreqsproto-1.0.2  BigReqs extension headers
  9. ca_root_nss-3.11.9_2 The root certificate bundle from the Mozilla Project
  10. compat6x-i386-6.4.604000.200810 A convenience package to install the compat6x li                                                                             braries
  11. curl-7.19.5         Non-interactive tool to get files from FTP, GOPHER, HTTP(S)
  12. cvsup-without-gui-16.1h_4 File distribution system optimized for CVS (non-GUI ve                                                                             rsion
  13. expat-2.0.1         XML 1.0 parser written in C
  14. freetype2-2.3.9_1   A free and portable TrueType font rendering engine
  15. gettext-0.17_1      GNU gettext package
  16. gmake-3.81_3        GNU version of 'make' utility
  17. help2man-1.36.4_3   Automatically generating simple manual pages from program o
  18. inputproto-1.5.0    Input extension headers
  19. jpeg-6b_7           IJG's jpeg compression utilities
  20. kbproto-1.0.3       KB extension headers
  21. libICE-1.0.4_1,1    Inter Client Exchange library for X11
  22. libSM-1.1.0_1,1     Session Management library for X11
  23. libX11-1.2.1,1      X11 library
  24. libXau-1.0.4        Authentication Protocol library for X11
  25. libXaw-1.0.5_1,1    X Athena Widgets library
  26. libXdmcp-1.0.2_1    X Display Manager Control Protocol library
  27. libXext-1.0.5,1     X11 Extension library
  28. libXmu-1.0.4,1      X Miscellaneous Utilities libraries
  29. libXp-1.0.0,1       X print library
  30. libXpm-3.5.7        X Pixmap library
  31. libXt-1.0.5_1       X Toolkit library
  32. libcheck-0.9.6      A unit test framework for C
  33. libiconv-1.11_1     A character set conversion library
  34. libltdl-1.5.26      System independent dlopen wrapper
  35. libmcrypt-2.5.8     Multi-cipher cryptographic library (used in PHP)
  36. libpthread-stubs-0.1 This library provides weak aliases for pthread functions
  37. libsigsegv-2.5      Handling page faults in user mode
  38. libtool-1.5.26      Generic shared library support script
  39. libxcb-1.2_1        The X protocol C-language Binding (XCB) library
  40. libxml2-2.7.3       XML parser library for GNOME
  41. libxslt-1.1.24_2    The XSLT C library for GNOME
  42. m4-1.4.12,1         GNU m4
  43. mhash-0.9.9         An easy-to-use library for strong hashes such as MD5 and SH
  44. mysql-client-5.0.81 Multithreaded SQL database (client)
  45. mysql-scripts-5.0.81 Multithreaded SQL database (scripts)
  46. mysql-server-5.0.81 Multithreaded SQL database (server)
  47. p5-DBD-mysql50-4.010 MySQL 5.0 driver for the Perl5 Database Interface (DBI)
  48. p5-DBI-1.60.7       The perl5 Database Interface.  Required for DBD::* modules
  49. p5-Storable-2.18    Persistency for perl data structures
  50. p5-gettext-1.05_2   Message handling functions
  51. pcre-7.9            Perl Compatible Regular Expressions library
  52. perl-5.8.9_2        Practical Extraction and Report Language
  53. php5-5.2.9          PHP Scripting Language
  54. php5-ctype-5.2.9    The ctype shared extension for php
  55. php5-curl-5.2.9     The curl shared extension for php
  56. php5-dom-5.2.9      The dom shared extension for php
  57. php5-exif-5.2.9     The exif shared extension for php
  58. php5-extensions-1.3 A "meta-port" to install PHP extensions
  59. php5-filter-5.2.9   The filter shared extension for php
  60. php5-ftp-5.2.9      The ftp shared extension for php
  61. php5-gd-5.2.9       The gd shared extension for php
  62. php5-gettext-5.2.9  The gettext shared extension for php
  63. php5-hash-5.2.9     The hash shared extension for php
  64. php5-iconv-5.2.9    The iconv shared extension for php
  65. php5-json-5.2.9     The json shared extension for php
  66. php5-mbstring-5.2.9 The mbstring shared extension for php
  67. php5-mcrypt-5.2.9   The mcrypt shared extension for php
  68. php5-mhash-5.2.9    The mhash shared extension for php
  69. php5-mysql-5.2.9    The mysql shared extension for php
  70. php5-mysqli-5.2.9   The mysqli shared extension for php
  71. php5-pcre-5.2.9     The pcre shared extension for php
  72. php5-pdo-5.2.9      The pdo shared extension for php
  73. php5-pdo_sqlite-5.2.9 The pdo_sqlite shared extension for php
  74. php5-posix-5.2.9    The posix shared extension for php
  75. php5-session-5.2.9  The session shared extension for php
  76. php5-simplexml-5.2.9 The simplexml shared extension for php
  77. php5-spl-5.2.9      The spl shared extension for php
  78. php5-sqlite-5.2.9   The sqlite shared extension for php
  79. php5-tokenizer-5.2.9 The tokenizer shared extension for php
  80. php5-xml-5.2.9      The xml shared extension for php
  81. php5-xmlreader-5.2.9 The xmlreader shared extension for php
  82. php5-xmlwriter-5.2.9 The xmlwriter shared extension for php
  83. php5-zip-5.2.9      The zip shared extension for php
  84. php5-zlib-5.2.9     The zlib shared extension for php
  85. pkg-config-0.23_1   A utility to retrieve information about installed libraries
  86. png-1.2.35          Library for manipulating PNG images
  87. printproto-1.0.4    Print extension headers
  88. python25-2.5.4_1    An interpreted object-oriented programming language
  89. t1lib-5.1.2_1,1     A Type 1 Rasterizer Library for UNIX/X11
  90. unrar-3.80,5        Extract, view & test RAR archives
  91. xcb-proto-1.4       The X protocol C-language Binding (XCB) protocol
  92. xcmiscproto-1.1.2   XCMisc extension headers
  93. xextproto-7.0.5     XExt extension headers
  94. xf86bigfontproto-1.1.2 XFree86-Bigfont extension headers
  95. xorg-macros-1.2.1   X.Org development aclocal macros
  96. xproto-7.0.15       X11 protocol headers
  97. xtrans-1.2.3        Abstract network code for X
复制代码


先请各位兄弟,比较有时间的帮我把大致思路用命令走一遍贴出来;比较没时间的帮我分析下思路,由于小弟是新手,而且服务器已经在生产运行,马虎不得,所以恳请各位兄弟指点,小弟万分感谢!

论坛徽章:
54
2017金鸡报晓
日期:2017-02-08 10:39:42操作系统版块每日发帖之星
日期:2016-03-08 06:20:00操作系统版块每日发帖之星
日期:2016-03-07 06:20:00操作系统版块每日发帖之星
日期:2016-02-22 06:20:00操作系统版块每日发帖之星
日期:2016-01-29 06:20:00操作系统版块每日发帖之星
日期:2016-01-27 06:20:00操作系统版块每日发帖之星
日期:2016-01-20 06:20:00操作系统版块每日发帖之星
日期:2016-01-06 06:20:0015-16赛季CBA联赛之江苏
日期:2015-12-21 20:00:24操作系统版块每日发帖之星
日期:2015-12-21 06:20:00IT运维版块每日发帖之星
日期:2015-11-17 06:20:002015亚冠之广州恒大
日期:2015-11-12 10:58:02
2 [报告]
发表于 2009-07-06 14:07 |只看该作者
pkg_delete -x apache
pkg_add -r nginx spawn-cgi

配置一下/usr/local/etc/nginx/nginx.conf,基本上就可以用了。

启动脚本到/usr/local/etc/rc.d/里面找,都能找到,可以加到rc.conf里做自启动。

论坛徽章:
0
3 [报告]
发表于 2009-07-06 15:43 |只看该作者
原帖由 lsstarboy 于 2009-7-6 14:07 发表
pkg_delete -x apache
pkg_add -r nginx spawn-cgi

配置一下/usr/local/etc/nginx/nginx.conf,基本上就可以用了。

启动脚本到/usr/local/etc/rc.d/里面找,都能找到,可以加到rc.conf里做自启动。


我觉得先装好nginx,再delete apache会不会好一点?

论坛徽章:
2
狮子座
日期:2013-08-26 15:25:32金牛座
日期:2013-09-05 15:45:36
4 [报告]
发表于 2009-07-06 16:18 |只看该作者
其实可以不卸载apache,两个可以共存的
我的测试机就是
在rc.conf里面设置启动哪个就可以,嘿嘿

论坛徽章:
54
2017金鸡报晓
日期:2017-02-08 10:39:42操作系统版块每日发帖之星
日期:2016-03-08 06:20:00操作系统版块每日发帖之星
日期:2016-03-07 06:20:00操作系统版块每日发帖之星
日期:2016-02-22 06:20:00操作系统版块每日发帖之星
日期:2016-01-29 06:20:00操作系统版块每日发帖之星
日期:2016-01-27 06:20:00操作系统版块每日发帖之星
日期:2016-01-20 06:20:00操作系统版块每日发帖之星
日期:2016-01-06 06:20:0015-16赛季CBA联赛之江苏
日期:2015-12-21 20:00:24操作系统版块每日发帖之星
日期:2015-12-21 06:20:00IT运维版块每日发帖之星
日期:2015-11-17 06:20:002015亚冠之广州恒大
日期:2015-11-12 10:58:02
5 [报告]
发表于 2009-07-06 18:18 |只看该作者
楼上说的是,不卸载也没关系,只要端口不冲突,两个可以一起用。

论坛徽章:
0
6 [报告]
发表于 2009-07-07 10:50 |只看该作者
感谢各位大大的回复!

是不是这样:
1.
#ee /etc/rc.conf
        注释掉apache22_enable="YES" 或者删除。
#reboot
2.
取消php对apache的支持,或者不取消?!
#ee /usr/local/etc/php.ini
然后将:
; Enable the PHP scripting language engine under Apache.
engine = On

On 改成 Off ?

3.
至于zend,之前就已经安装并配置好,可以保持不动吧?

4.
安装nginx
#cd /usr/ports/www/nginx/
#make install

5.
为了得到fastcgi,安装lighttpd
# cd /usr/ports/www/lighttpd/
#make install
#rehash

6.
配置nginx,这个网上教程不少。

大体的流程是不是这样就可以了呀?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP