Last active
December 17, 2015 18:59
-
-
Save wgm89/5657576 to your computer and use it in GitHub Desktop.
ubuntu 配置
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 字体 | |
| ------------------------------------------------------------------------------------ | |
| http://damieng.com/blog/2008/05/26/envy-code-r-preview-7-coding-font-released | |
| https://github.com/adobe/source-code-pro | |
| ---------------------------------------------------------------------------------------- | |
| vim 插件: emmet-vim c-p | |
| ---------------------------------------------------------------------------------------- | |
| vimrc 配置 | |
| 可参考 https://github.com/fisadev/fisa-vim-config/blob/master/.vimrc | |
| ------------------------------------------------------------------------------------ | |
| if has("syntax") | |
| syntax on | |
| endif | |
| let hour = strftime("%H") | |
| if hour >=18 | |
| colorscheme evening | |
| else | |
| colorscheme morning | |
| endif | |
| filetype plugin indent on | |
| " vim 支持中文 | |
| set enc=utf-8 | |
| set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936 | |
| set langmenu=zh_CN.UTF-8 | |
| language message zh_CN.UTF-8 | |
| set guifont=NSimSun:h8 | |
| set helplang=cn | |
| set ambiwidth=double | |
| map <C-P> :!/php/php/bin/php -l %<CR> | |
| "suojin | |
| set tabstop=4 | |
| set shiftwidth=4 | |
| set expandtab | |
| set softtabstop=4 | |
| set smarttab | |
| " 显示tab和空格 | |
| set list | |
| " 设置tab和空格样式 | |
| set lcs=tab:\|\ ,nbsp:%,trail:- | |
| " 设定行首tab为灰色 | |
| highlight LeaderTab guifg=#666666 | |
| " 匹配行首tab | |
| match LeaderTab /^\t/ | |
| . 代码中Tab和空格混排 | |
| 需求:将空格转为Tab或Tab转为空格 | |
| 解决方法:先设置自己的缩进设置,例如我是用4个空格缩进:set ts=4 sts=4 sw=4 et,然后敲入:ret可将代码中原有的Tab转成4个空格。后续编辑中,Tab键自动生成4个空格,你删除的时候,按一个删除键,删除的也是4个空格。如果你是用4个空格宽度的Tab缩进的,使用:set ts=4 sts=4 sw=4 noet,然后敲入:ret即可。 | |
| 2. 行尾多余的空格和Tab | |
| 需求:删除多余空格 | |
| 解决方法:输入:%s/\s*$//ge,将行尾多余空格删除。 | |
| Plugin: | |
| NERD tree : http://www.vim.org/scripts/script.php?script_id=1658 | |
| Ctrlp: https://github.com/kien/ctrlp.vim | |
| ---------------------------------------------------------------------------------------- | |
| php+nginx+mysql ubuntu install | |
| ---------------------------------------------------------------------------------------- | |
| 1. 使用官方PPA安装 Nginx 最新版本,使用以下命令: | |
| sudo add-apt-repository ppa:nginx/stable | |
| sudo apt-get update | |
| sudo apt-get install nginx | |
| Nginx相关控制命令: | |
| 启动 Nginx: | |
| sudo /etc/init.d/nginx start | |
| 浏览器浏览运行情况输入:http://localhost ; | |
| 关闭 Nginx:sudo /etc/init.d/nginx stop; | |
| 重启 nginx:sudo /etc/init.d/nginx restart; | |
| 2. 安装 PHP,输入以下命令: | |
| sudo apt-get install php5-cli php5-cgi php5-fpm php5-mcrypt php5-mysql | |
| 配置Nginx站点,设置: | |
| sudo vi /etc/nginx/sites-available/default | |
| 修改 “index” 为:“index index.html index.htm index.php;” | |
| 测试,创建网站目录 | |
| sudo mkdir /var/www/ | |
| 建立一个虚拟站点: | |
| sudo vi /etc/nginx/sites-available/default | |
| 修改rolocation ~ \.php$ { | |
| fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
| # # NOTE: You should have “cgi.fix_pathinfo = 0;” in php.ini | |
| # | |
| # # With php5-cgi alone: | |
| fastcgi_pass 127.0.0.1:9000; | |
| # # With php5-fpm: | |
| # fastcgi_pass unix:/var/run/php5-fpm.sock; | |
| # fastcgi_index index.php; | |
| include fastcgi_params; | |
| } | |
| root目录: “root /var/www;” | |
| 建立一个测试页面: | |
| sudo vi /var/www/test.php | |
| 在测试页面test.php中加入以下代码: | |
| 重启nginx | |
| sudo /etc/init.d/nginx restart | |
| 浏览器输入以下地址 | |
| http://localhost/test.php | |
| 3.安装 MySQL 数据库: | |
| sudo apt-get install mysql-server | |
| 4.phpmyadmin | |
| sudo apt-get install phpmyadmin | |
| sudo ln -s /usr/share/phpmyadmin /var/www | |
| 邮件服务 : 安装postfix,执行命令: | |
| # apt-get install postfix popa3d | |
| 如果不需要pop3服务,把popa3d去掉 | |
| ---------------------------------------------------------------------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment