cd /tmp wget http://tengine.taobao.org/download/tengine-2.1.0.tar.gz tar zxvf tengine-2.1.0.tar.gz chown -R root:root tengine-2.1.0 cd tengine-2.1.0 ./configure --prefix=/usr/local/tengine/tengine-2.1.0 --user=nginx make make install
修改配置
1 2 3 4 5 6 7 8 9 10
cd /usr/local/tengine/tengine-2.1.0 mkdir conf/conf.d vi conf/nginx.conf # 1. 启用 "log_format main ..." # 2. 在 "http {...}" 的 最后一行 加入 "include conf.d/*.conf;" # 3. 在最开始,设置 `user www`, 以非root 用户运行 # 4. 修改 worker_process 为 CPU 核心数量
useradd www chown -R www:www logs
centos 7
新建 systemd 所需的 service 文件: vi /usr/lib/systemd/system/tengine.service :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
[Unit] Description=Tengine Server After=network.target
View -> 取消选中 'toolbar' Edit -> Preferences : View -> 选中 'Display line numbers' -> 选中 'Highlight current line' -> 选中 'Highlight matching brackets' Editor -> Tab width 设置为 4 -> 选中 'Insert spaces instead tabs' -> 选中 'Enable automatic indentation' -> 取消选中 'Create a backup copy of files before saving' -> 取消选中 'Autosave files every 10 minutes' Font & Colors -> 选择一个自己喜爱的 Color Schema
gnome-terminal
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
gnome-terminal : Edit : Profiles : New : xxx : 并设置默认为该 profile : General : 取消选中 Use the system fixed width font,并选择使用 Monospace 14 / ubuntu mono 14 : 选中 Use custom default terminal size : 120x30 : Title and Command : 选中 Run command as login shell // : 选中 Run a cunstom command instead of my shell,并输入 `env TERM=xterm-color /bin/bash`
# gnome-terminal 彩色显示 vi /etc/profile.d/xxx.sh export TERM=xterm-color
# 使命令行提示符只显示父目录,而非整个路径 vi ~/.bashrc 查找 PS1 并将其中最后的 \w 替换为 \W 修改ll别名 alias ll='ls -lF'
常用快捷键
hot key
descrption
Alt+1
主键盘上的额数字键,可以快速切换至第N个标签页
Ctrl+Shift+T
开启新的标签页
Ctrl+Shift+C
复制
Ctrl+Shift+V
粘贴
Ctrl+E
清屏
Ctrl+R
搜索历史命令
Ctrl+W
向后删除一个词
Ctrl+C
取消当前行的输入,新开始一行
Ctrl+U
清空当前输入行
Ctrl+D
如果当前行是空白行时,可以退出登录,直到退出当前窗口。
文件管理器 PCManFM
1 2 3
Edit : Preference : General : Default View : Detailed list view Layout : 选中 Filesystem root
<!-- Take a screenshot of the current window with scrot when Alt+Print are pressed --> <keybind key="A-Print"> <action name="Execute"> <!--<command>lxsession-default screenshot window</command>--> <command>scrot -u -b</command> </action> </keybind> <!-- Launch scrot when Print is pressed --> <keybind key="Print"> <action name="Execute"> <!--<command>lxsession-default screenshot</command>--> <command>scrot</command> </action> </keybind>
sudo apt-get install nginx sudo apt-get install php5-fpm php5-cli php5-cgi php5-mysql sudo service php5-fpm status
sudo vi /etc/php5/fpm/php.ini cgi.fix_pathinfo=0
sudo vi /etc/php5/fpm/pool.d/www.conf owner = www-data group = www-data listen.owner = www-data listen.group = www-data listen.mode = 0660
sudo vi /etc/nginx/sites-available/default location ~ \.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; }
sudo service php5-fpm restart sudo service nginx restart
vi /usr/share/nginx/html/my.php <?php phpinfo(); ?>
# 访问浏览器 http://localhost/my.php
自动挂载Windows分区
1 2 3 4
sudo blkid # 查看各个分区的UUID id # 查看自己当前账户的uid和gid sudo vi /etc/fstab UUID=519CB82E5888AD0F /media/Data ntfs defaults,gid=1000,uid=1000 0 0
## 错误提示 Error mounting /dev/sdb4 at /media/xxx/xx: Command-line`mount -t "ntfs" -o"uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177""/dev/sdb4" "/media/eden/文檔"' exited with non-zero exit status14: The disk contains an unclean file system (0, 0).