安装很简单,光盘启动后直接 Enter,就安装了基本系统。在安装过程我选择语言为英语,国家地区选择中国,后面的时区就自动选择了上海时间。
1. 重启登陆系统,编辑 /etc/network/interfaces 文件,用 sudo vi /etc/network/interfaces,修改 IP 地址。
代码: 全选
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
mapping hotplug
script grep
map eth0
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.156
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
代码: 全选
127.0.0.1 localhost.localdomain localhost server1
192.168.1.156 server1.gdgpi.com server1
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
3. 编辑 /etc/hostname,内容改为 server1.gdgpi.com。
4. sudo /etc/init.d/networking restart 重新启动网络。
5. 编辑 /etc/apt/souces.list 文件,用 sudo vi /etc/apt/sources.list,注释旧的源,加入 cn99 源
代码: 全选
deb http://ubuntu.cn99.com/ubuntu/ breezy main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ breezy-updates main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ breezy-security main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ breezy-backports main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu-cn/ breezy main restricted universe multiverse
deb http://ubuntu.cn99.com/backports/ breezy-extras main restricted universe multiverse
6. 更新系统
代码: 全选
sudo apt-get update
sudo apt-get upgrade
8. 在 windows 工作站用 puTTY 登陆服务器。
9. 安装 Apache2 MySQL4.1 PHP4 phpMyAdmin2.6,用 sudo apt-get install apache2 mysql-server php4-common php4-gd php4-mysql libapache2-mod-php4 apache2-mpm-prefork apache2-utils phpmyadmin
10. 配置php,用 sudo vi /etc/php4/apache2/php.ini
代码: 全选
修改允许最大使用内存,查找
memory_limit = 8M
修改为
memory_limit = 32M
修改允许最大上传尺寸,查找
upload_max_filesize = 2M
修改为
upload_max_filesize = 8M
11. 添加 MySQL 根用户的密码,用 mysqladmin -u root password 我自己的密码。
12. 配置 Apache2
* 用 sudo a2enmod rewrite 启用 rewrite,这样才可以让 drupal 使用 Clean URL。
* 为了 Drupal 的 Clean URL 可以运作,还必须修改一些设置,用 sudo vi /etc/apache2/apache2.conf,添加
代码: 全选
<Directory /var/www/*>
Options Indexes FollowSymLinks
AllowOverride all
</Directory>
很奇怪 Ubuntu 5.10 的 MySQL 是 4.1.12 版,将我的站点备份下来仍然是乱码,不但在 phpmyadmin 中看见是乱码,整个 Drupal 站点页面所有中文全部成了乱码。据说从 MySQL 4.1.14 上备份下来到 Ubuntu 中也是乱码。