• 欢迎访问Ppabc博客网站,专注于Linux、CentOS、Apache、Nginx、MySQL、PHP等开源工具安装优化的技术博客,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站,欢迎加入Ppabc博客
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏Ppabc博客吧

Ubuntu 7.1 server从无到有搭建全能WEB生产环境(一)

baidu空间 admin 11年前 (2008-03-16) 163次浏览

http://www.dingl.com/blog/archives/12
作者:丁令

由于工作原因,需要搭建 linux 环境。
选择 Ubuntu7.1 server 的原因是比较干净,生产服务器上不要搞那么多乱七八糟的东西。

Ubuntu7.1 server 是一个非常干净的系统,连图形界面都没有,于是鼠标用不上了。

安装 Ubuntu 非常简单,不再多述。注意几点:
1、安装之前先插上网线
2、除了 OpenSSH,不装其它任何的服务器软件,Apache/Mysql/PHP 都不装,后面使用源码自己编译安装

Ubuntu 安装后的配置:
1、启用 root 用户
  sudo passwd root
 输入密码后:
  su
 即可用 root 用户完成后面的配置与维护。

2、配置网络
 如果在安装时没有配置好网络环境,可手工配置:
  vi /etc/network/interfaces
 根据环境正确配置即可。重启网络:
  /etc/init.d/networking restart

3、配置 apt-get 的更新位置
 如果想使用最新版本的各种包,此步必须。
  vi /etc/apt/sources.list
 编辑文件,主要是禁止从 cdrom 安装软件,而从网上下载最新的版本。
#
# deb cdrom:[Ubuntu-Server 7.10 _Gutsy Gibbon_ – Release i386 (20071016)]/ gutsy main restricted

#deb cdrom:[Ubuntu-Server 7.10 _Gutsy Gibbon_ – Release i386 (20071016)]/ gutsy main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.

deb http://ubuntu.cn99.com/ubuntu/ gutsy main restricted
deb-src http://ubuntu.cn99.com/ubuntu/ gutsy main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://ubuntu.cn99.com/ubuntu/ gutsy-updates main restricted
deb-src http://ubuntu.cn99.com/ubuntu/ gutsy-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://ubuntu.cn99.com/ubuntu/ gutsy universe
deb-src http://ubuntu.cn99.com/ubuntu/ gutsy universe
deb http://ubuntu.cn99.com/ubuntu/ gutsy-updates universe
deb-src http://ubuntu.cn99.com/ubuntu/ gutsy-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://ubuntu.cn99.com/ubuntu/ gutsy multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ gutsy multiverse
deb http://ubuntu.cn99.com/ubuntu/ gutsy-updates multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ gutsy-updates multiverse

## Uncomment the following two lines to add software from the ‘backports’
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://ubuntu.cn99.com/ubuntu/ gutsy-backports main restricted universe multiverse
# deb-src http://ubuntu.cn99.com/ubuntu/ gutsy-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical’s
## ‘partner’ repository. This software is not part of Ubuntu, but is
## offered by Canonical and the respective vendors as a service to Ubuntu
## users.
# deb http://archive.canonical.com/ubuntu gutsy partner
# deb-src http://archive.canonical.com/ubuntu gutsy partner

deb http://security.ubuntu.com/ubuntu gutsy-security main restricted
deb-src http://security.ubuntu.com/ubuntu gutsy-security main restricted
deb http://security.ubuntu.com/ubuntu gutsy-security universe
deb-src http://security.ubuntu.com/ubuntu gutsy-security universe
deb http://security.ubuntu.com/ubuntu gutsy-security multiverse
deb-src http://security.ubuntu.com/ubuntu gutsy-security multiverse

4、更新 Ubuntu:
  apt-get update
  apt-get upgrade
 此步需要花费大概 30 分钟,如果出现网络错误可重新执行或加上–fix-missing 参数重新执行。

5、安装各种软件包
 可一次安装 N 个:
  apt-get install binutils cpp fetchmail flex gcc libarchive-zip-perl libc6-dev libcompress-zlib-perl libdb4.3-dev libpcre3 libpopt-dev lynx m4 make ncftp nmap perl perl-modules unzip zip zlib1g-dev autoconf automake1.9 libtool bison autotools-dev g++ build-essential
 上面的命令要放在一行执行。这些包基本都是后面需要使用的或者平时也经常可以用到的,可根据自己需要选择。

6、安装 libncurses5-dev
 很多朋友在使用源码安装软件时在 make 时出现错误,就是因为没有安装这个包:
  checking for termcap functions library… configure: error: No curses/termcap library found
 解决办法:
  apt-get install libncurses5-dev

7、增加 ll 别名
 以前用 fedora core 时都有 ll 命令,Ubuntu 下没有,很不习惯,只好自己设置:
  vi ~/.bashrc
 此文件中其实已经有别名的配置,只是已经注释掉了,去掉注释即可,同时为 vi 设置别名为 vim。
  alias ll=’ls -l’
  alias la=’ls -A’
  alias l=’ls -CF’
  alias vi=’vim’

]]>


Selinux 中国 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Ubuntu 7.1 server 从无到有搭建全能 WEB 生产环境(一)
喜欢 (0)