“服务器笔记“
liunx查看文件下文件的数量
命令1: ls |wc -l //当前目录的下的文件和文件夹数量 命令2: find -type f |wc -l //当前目录下以及当前目录下文件夹内的文件数量 这两个命令都可以!
linux安装samba服务并使得在window下快速开发
linux:centos 环境:lamp 一、安装及配置samba yum –y install samba* –skip-broken vim /etc/samba/smb.conf [web] path=/usr/local/apache2/htdocs/ browseable=yes writable=yes 二、创建用户并且acl权限配置 1.useradd apache 2.setfacl -m u:apache:rwx -R /usr/local/apache2/htdocs 3.setfacl -m d:u:apache:rwx -R /...
让nginx支持ThinkPHP3.2.2的URL重写并可通过网址访问
server { listen 80; server_name www.xingdong365.com; location / { #root /usr/share/nginx/html; root /data/www/xingdong365/; index index.html index.htm index.php; if (!-e $request_filename) { rewrite ^/(.*)$ /ind...
vim常用命令
插入 i: 大家都知道 A: 在行末添加新文本 I: 在行首添加新文本 移动光标 h: 向左移动一个字符 j: 移动到下一行 k: 移动到上一行l: 向右移动一个字符 $: 移动到行尾 0: 移动到行首H: 移动到屏幕顶端M: 移动到屏幕中间 L: 移动到屏幕底端 定位 :set nu -> 显示行号 :set nonu -> 取消行号 显示 gg -> 到第一行 :G -> 到最后一行 :num -> 到指定第num行 删除 :x -> 删除当前字符(类似win下的delete键)nx: 删除从当前光标开始n个字符 ...
linux下查看和更改文件的所有者
linux下查看文件的所有者 ls -ali 或者 ls -lli chown命令更改文件拥有者 基本语法: chown [-R] 账号名称 文件或目录 chown [-R] 账号名称:用户组名称 文件或目录 chgrp命令更改文件所属用户组 基本语法: chgrp [-R] 用户组名称 dirname/filename ...
linux下访问smarty模板的程序文件出现空白
把用smarty模板做的一个程序文件放到linux服务器下,访问出现空白,于是从访问文件头部开始一点一点找原因,最终找到是因为 $smarty->display('welcome.htm'); 没有执行,耽误了半天才发现是模板文件目录的权限问题,于是执行chmod -R 777 theme/,就可以正常访问了(theme是模板目录,welcome.htm在里面)
ubuntu下安装php的gd,mysql扩展库
sudo apt-get install php5-gd sudo apt-get install php5-mysql sudo /etc/init.d/apache2 restart
centos6.5下安装配置smb
选择上光驱内容 mount /dev/cdrom /mnt/cdrom 如果/mnt下没有cdrom则需要创建 service iptables stop 关闭防火墙,或者修改配置文件添加需要的端口 vi /etc/selinux/config修改 SELINUX=disabled关闭SELINUX yum -y install samba* --skip-broken chkconfig smb on 设置开机启动 chkconfig nmb on 设置开机启动 vim /etc/samba/smb.conf 加入(在homes后面) [web]...
nginx下支持thinkphp3.1.3的url重写
nginx下支持thinkphp的url重写,项目分组后localhost://project/index.php/Admin //二级目录 location /project/ { index index.php; if (!-e $request_filename) { rewrite ^/project/(.*)$ /project/index.php/$1 last; break; } } location ~ .+.php($|/) { set $script $uri; set $path_info "/"; if ($...
centos6.5下php安装redis扩展
先下载扩展文件: 下载:https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz(我用的是这个) 上传到根目录下的lnmp下(我自己新建的) cd /lnmp/ tar zxvf phpredis-2.2.4.tar.gz cd phpredis-2.2.4 /usr/local/bin/phpize #用phpize生成configure配置文件(我的phpize路径是这样) ./configure --with-php-config=/usr/local/bin/php-config #配...