http://blog.cong.co/cygwin.html#%E5%AE%9A%E4%B9%89%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F配置 cygwin 中的服务程序

配置 cygwin 中的服务程序^

详细情况阅读 /usr/share/doc/Cygwin/cygserver.README,要让一个apache httpd或者 proftpd成功运行,在winxp下:

  • 需要把 /bin/cygrunsrvLocalSystem 的身份设置为系统服务,最简单的方法就是运行 脚本 /usr/bin/cygserver-config。这将在 "Control Panel > Admin Tools > Services" 里边出现一个名为 CYGWIN cygserver 的服务项目。
  • 然后设置环境变量 CYGWIN,最简单的方法就是在 cygwin.bat 中添加一句:
    set CYGWIN=server

配置服务或应用程序之前,阅读 =/usr/share/doc= 中罗列的文档

配置 apache httpd2 服务^

配置 httpd2 很简单,直接用 setup 的安装程序安装好 httpd2。然后运行如下命令即可:
apachectl2 start

要是找不到 apachectl2,看看 /usr/sbin 有没有加入到 PATH 中。

配置 proftpd 服务^

阅读 /usr/share/doc/proftpd-1.2.10/* 下的一堆文档,按照配置来,先test。

配置应用程序^

配置rxvt^

win的cmd实在太难用了,而我又不用cygwin的X系统,所以rxvt成了我最好的选择,这里是 我的颜色配置,写入 ~/.Xdefaults 即可:

Rxvt*title:             Cygwin-Rxvt
Rxvt*geometry: 90x40-10+30
Rxvt*background: #BFDF74
Rxvt*foreground: #001123
Rxvt*scrollBar_right: true
Rxvt*colorBD: 1
Rxvt*font: courier new
Rxvt*blodFont: Courier New
Rxvt*saveLines: 2000
Rxvt.backspacekey: ^?
Rxvt*loginShell: True
!! VIM-like colors
Rxvt*color0: #000000
!Rxvt*color1: #FFFFFF
Rxvt*color1: #911B08
Rxvt*color2: #00A800
Rxvt*color3: #DD0000
Rxvt*color4: #0000A8
Rxvt*color5: #A800A8
Rxvt*color6: #00A8A8
Rxvt*color7: #D8D8D8
Rxvt*color8: #B5613B
Rxvt*color9: #966BEB
Rxvt*color10: #00A800
Rxvt*color11: #FFFF00
Rxvt*color12: #0000A8
Rxvt*color13: #A800A8
Rxvt*color14: #00A8A8
Rxvt*color15: #B5613B

把下边这段写入 cygwin.bat

@echo off
set CYGWIN=server
set HOME=d:\MyDoc
d:
chdir d:\cygwin\bin
rxvt -title "Cygwin-Rxvt" -sr -sl 2000 -tn Cygwin -fn "bitstream vera sans mono-19" -e /bin/bash -login
定制特色的提示符^

~/.bashrc 或者 ~/.bash_profile 中定制特色的提示符

PS1="`whoami`@`hostname | sed 's/..*//'`"
PS1="[e[32;1m]${PS1}[e[0m]:[e[31;1m]w[e[0m]n"
case `id -u` in
0) PS1="${PS1}# ";;
*) PS1="${PS1}$ ";;
esac
定义环境变量^

设置locale为Windows的默认locale,否则中文文件名会显示乱码:

LC_CTYPE=zh_CN.gbk
CHARSET=GBK
export LC_CTYPE CHARSET

bash配置文件^

~/.bashrc^
# -*- coding: chinese-gbk -*
LC_CTYPE=zh_CN.gbk
CHARSET=GBK #glib2需要使用找个环境变量确定文件名的编码
export LC_CTYPE CHARSET
export LESSCHARSET=latin1
export INPUTRC=$HOME/.inputrc
export TERM=rxvt
# alias
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias df='df -h'
alias du='du -h'
# Misc :)
alias less='less -r --raw-control-chars' # raw control characters
alias whence='type -a' # where, of a sort
alias grep='grep --color' # show differences in colour
# Some shortcuts for different directory listings
alias ls='ls -hF --color=tty --show-control-chars' # classify files in colour
alias dir='ls --color=auto --format=vertical --show-control-chars'
alias vdir='ls --color=auto --format=long --show-control-chars'
alias ll='ls -la --show-control-chars' # long list
alias la='ls -A --show-control-chars' # all but . and ..
alias l='ls -lF --show-control-chars' #
# 添加清屏处理
alias clear='clearn'
alias clr='clearn'
# 添加whereis的别名
alias whereis='which'
alias autoexec=autoexec.bat
~/.inputrc^

主要是加入一些中文编码支持

# -*- coding: chinese-gbk -*-
# base-files version 3.6-1
# Insert Key
"e[2~":paste-from-clipboard
# equivalent to "C-?": delete-char
"e[3~": delete-char
# VT
"e[1~": beginning-of-line
"e[4~": end-of-line
# kvt
"e[H": beginning-of-line
"e[F": end-of-line
# rxvt and konsole (i.e. the KDE-app...)
"e[7~": beginning-of-line
"e[8~": end-of-line
# VT220
"eOH": beginning-of-line
"eOF": end-of-line
# Allow 8-bit input/output
set meta-flag on
# 关闭bash命令行8字节字符转义符的转换
set convert-meta off
# 使bash命令行支持8字节字符输入
set input-meta on
# 使bash命令行支持8字节字符输出
set output-meta on 我的配置文件E:\cygwin\home\zpc\.bashrc
export LANG="zh_CN.UTF-8"
alias ls="ls --color=auto"
alias ll="ls --color=auto -l"
alias l="ls --color=auto -l"
alias ..="cd .."
alias ...="cd ..."
export PS1="\[\e[33m\]\w\[\e[0m\]\$ "

最新文章

  1. 一分钟搞定AlloyTouch图片轮播组件
  2. Asp.net与Dojo交互:仪器仪表实现
  3. [SHELL进阶] (转)最牛B的 Linux Shell 命令 (二)
  4. Android 禁用以及捕捉home键
  5. canvas createRadialGradient 用法
  6. C# 实现的多线程异步Socket数据包接收器框架
  7. STL中erase的小心使用
  8. BS常用方法备忘
  9. C/C++ 知识点---C语言关键字(32个)
  10. PHP通过访客来路获取搜索关键词的方法
  11. VB.NET或C#报错:You must hava a license to use this ActiveX control.
  12. git教程——工作流程
  13. django--use
  14. Synergy简单使用小记
  15. dubbo源码分析8——服务暴露概述
  16. 精简版自定义 jquery
  17. 聊聊Python中的闭包和装饰器
  18. CF720A Closing ceremony 贪心
  19. VS2013 opencv配置
  20. C语言:使用realloc函数对malloc或者calloc动态分配的内存大小进行扩展

热门文章

  1. C# 设置窗口大小为不可调、取消最大化、最小化窗口按键
  2. c++ 计算器 带括号 代码实现
  3. 开启虚拟机所报的错误:VMware Workstation cannot connect to the virtual machine. Make sure you have rights to run the program, access all directories the program uses, and access all directories for temporary fil
  4. 关于Python、Java、C#语言的一些比较
  5. laravel5.5用户认证源码分析
  6. Win10安装bash慢的解决方案
  7. 《Cracking the Coding Interview》——第18章:难题——题目12
  8. 3dMax,Maya与FBX
  9. neutron floating ip 限速
  10. 异步fifo的设计(FPGA)