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

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

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

1.设置代理服务器


Touch 文件/etc/apt/apt.conf,输入
Acquire::http::Proxy http://yourproxyaddress:proxyport;
或者直接导出环境变量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

 

 

 

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值