收集整理的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

 

 

 

發佈了125 篇原創文章 · 獲贊 5 · 訪問量 204萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章