您的位置:首页 > 运维架构 > Linux

收集整理的Linux下的小技巧(四) - 在Ubuntu创建自己的开发环境

2007-11-08 23:11 846 查看
一直都用的是RHEL和Fedora,现在换成Ubuntu。很多现成的命令居然找不到,想编译个Kernel, 写点web应用程序居然都没有缺省安装,非常不习惯。为创建一个便于使用的环境,确实比较麻烦,我把我的配置步骤记录下来,供参考。都比较简单,比较适合初学者。

为了简化,没有使用sudo,请读者自行加上。

1.设置代理服务器

Touch 文件/etc/apt/apt.conf,输入
Acquire::http::Proxy http://yourproxyaddress:proxyport;[/code] 或者直接导出环境变量http_proxy
Export http_proxy=http://yourproxyaddress:proxyport


2.加入安装源

编辑/etc/apt/sources.list,加入ubuntu.org.cn的源,并apt-get update
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 multiverseapt-get install x-window-system-core


3.中文语言支持:(Gnome)

安装相应的包
apt-get install -y language-pack-gnome-zh language-pack-gnome-zh-base language-pack-zh language-pack-zh-base language-support-zh


安装中文输入法
主要有scim和fcitx两种,这里介绍fcitx的安装配置:
sudo apt-get install fcitx
sudo sh -c ” echo ‘export XMODIFIERS=@im=fcitx ; export GTK_IM_MODULE=”fcitx” ; fcitx ‘ > /etc/X11/Xsession.d/95xinput ”
sudo chmod +755 /etc/X11/Xsession.d/95xinput


设置环境
在文件/etc/environment中删掉其它行,加入:
LANGUAGE="zh_CN:zh:en_US:en"
LC_CTYPE=zh_CN.UTF-8
LANG=zh_CN.UTF-8
GST_ID3_TAG_ENCODING=GBK


重新登录gnome即可。

4.安装ssh

apt-get install -y ssh

允许root用户从远程登录
/etc/ssh/sshd_config
然后改/etc/ssh/sshd_config,找到下面一行。
PermitRootLogin no

改为
PermitRootLogin yes


5.允许root用户从桌面登录

System->Administration->Login Window->Security->Allow local system administrator login.

也可以很容易改成自动登录。

6.安装nfs客户端

默认情况下不能够mount NFS,需要安装相应的client
apt-get install portmap nfs-common -y


要配置NFS server需要安装nfs-kernel-server
apt-get install nfs-kernel-server -y


7.搭建Linux kernel编译环境

apt-get install -y build-essential
apt-get install -y libncurses5-dev
然后就可以make linux的kernel了。
建议把默认的shell从dash改成bash再make.
然后就可以make linux kernel了

8.搭建web开发环境

在Ubuntu下安装IE,先要安装一个模拟器
apt-get install -y wine cabextract
详细步骤见http://www.tatanka.com.br/ies4linux/page/Installation:Ubuntu

安装LAMP(Apache+Mysql+PHP)
apt-get install -y apache2 mysql-server php5 php5-gd php5-mysql php5-cli


Reference
如何编译一个内核 - Ubuntu方式 http://blog.zhaoke.com/7.html 用UBUNTU做WEB开发 - http://www.xxlinux.com/linux/article/development/web/20070220/7624.html 打造Ubuntu下的SLAMP - http://forum.ubuntu.org.cn/viewtopic.php?t=1320
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息