停止 Apache 服务
使用以下命令停止 Apache 服务,并禁止 Apache 服务开机自动启动:
ben@linux-cotk:~> sudo /etc/init.d/apache2 status Checking for httpd2: running ben@linux-cotk:~> /sbin/chkconfig --list apache2 apache2 0:off 1:off 2:off 3:on 4:off 5:on 6:off ben@linux-cotk:~> ben@linux-cotk:~> sudo /etc/init.d/apache2 stop Shutting down httpd2 (waiting for all children to terminate) done ben@linux-cotk:~> sudo /sbin/chkconfig -del apache2 insserv: warning: current start runlevel(s) (3 5) of script `vboxadd-x11' overwrites defaults (empty). apache2 0:off 1:off 2:off 3:off 4:off 5:off 6:off ben@linux-cotk:~> ben@linux-cotk:~> sudo /etc/init.d/apache2 status Checking for httpd2: unused ben@linux-cotk:~> /sbin/chkconfig --list apache2 apache2 0:off 1:off 2:off 3:off 4:off 5:off 6:off ben@linux-cotk:~> 安装 Nginx首先使用以下命令添加 Nginx 所在的安装源到软件仓库,然后更新软件仓库:
ben@linux-cotk:~> sudo zypper addrepo SUSE.org/repositories/openSUSE:/Factory:/Contrib/openSUSE_11.3 openSUSE:Factory:Contrib 正在添加安装源 'openSUSE:Factory:Contrib' [done] Repository 'openSUSE:Factory:Contrib' successfully added Enabled: Yes Autorefresh: No URI: :/Factory:/Contrib/openSUSE_11.3 ben@linux-cotk:~> sudo zypper refresh Repository 'Updates for openSUSE 11.3 11.3-1.82' is up to date. Repository 'mono-stable' is up to date. Repository 'openSUSE-11.3 11.3-1.82' is up to date. Retrieving repository 'openSUSE:Factory:Contrib' metadata [\] New repository or package signing key received: Key ID: 9111972B32099D43 Key Name: openSUSE:Factory:Contrib OBS Project Key Fingerprint: 9258D0071F2782CCE2E6FE079111972B32099D43 Key Created: 2010年09月21日 星期二 22时27分04秒 Key Expires: 2012年11月29日 星期四 22时27分04秒 Repository: openSUSE:Factory:Contrib Do you want to reject the key, trust temporarily, or trust always? [r/t/a/?] (r): a Retrieving repository 'openSUSE:Factory:Contrib' metadata [done] 正在构建 'openSUSE:Factory:Contrib' 安装源缓存 [done] Repository 'openSUSE-11.3-Non-Oss' is up to date. Repository 'VirtualBox for openSUSE 11.3' is up to date. All repositories have been refreshed. ben@linux-cotk:~>注意在更新软件仓库时要回答“a”表示总是信任这个安装源。然后例行地更新一次软件包:
ben@linux-cotk:~> sudo zypper update =====> 意外地进行了漫长地更新 <===== ben@linux-cotk:~> sudo zypper dist-upgrade ben@linux-cotk:~>意外发生,居然进行了漫长地更新,看一下具体信息,原来是升级 mono 2.8.2。赶紧到 mono 官方网站的下载页面去看看,果真发布了新的 mono 2.8.2 版本。
现在可以使用以下命令安装 Nginx :
ben@linux-cotk:~> sudo zypper install nginx-0.8 Loading repository data... Reading installed packages... Resolving package dependencies... The following NEW package is going to be installed: nginx-0.8 1 new package to install. Overall download size: 381.0 KiB. After the operation, additional 1.2 MiB will be used. Continue? [y/n/?] (y): Retrieving package nginx-0.8-0.8.54-2.1.i586 (1/1), 381.0 KiB (1.2 MiB unpacked) Retrieving: nginx-0.8-0.8.54-2.1.i586.rpm [done (26.6 KiB/s)] Installing: nginx-0.8-0.8.54-2.1 [done] Additional rpm output: insserv: warning: current start runlevel(s) (3 5) of script `vboxadd-x11' overwrites defaults (empty). ben@linux-cotk:~>安装过程非常快,因为只需下载 381 KB 的文件,可见 Nginx 是多么的小巧了。