摘要:修改php.ini中的session.auto_start=0为session.auto_start=1MAC 的php.ini 在 /private/etc/ 目录下修改的时候发现sudo 也是readonly,查看后发现没有写的权限,chmod u+w php.ini即可。
阅读全文
摘要:这个错误很常见,很明显找不到文件。原因是php-fpm找不到SCRIPT_FILENAME里执行的php文件,所以返回给nginx 404 错误。那么两种情况要么文件真的不存在,要么就是路径错误。location / { root /var/www/example.com; index index.html index.htm index.pl; }如果配置文件这样的,那么明显不好,也就是在location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index ind...
阅读全文
摘要:php-fpm 是预装在mac os上的,你只需要配置就好了。这个服务监听9000端口。1. 为配置文件准备一些目录mkdir -p /usr/share/php/var/runmkdir -p /usr/share/php/var/logmkdir -p /usr/share/php/var/session2. 修改配置文件cp /private/etc/php-fpm.conf.default /private/etc/php-fpm.conf找到pid等进行如下修改pid = /usr/share/php/var/run/php-fpm.piderror_log = /usr/share
阅读全文
摘要:git rm --cached ProjectFolder.xcodeproj/project.xcworkspace/xcuserdata/myUserName.xcuserdatad/UserInterfaceState.xcuserstategit commit -m "Removed file that shouldn't be tracked"
阅读全文
摘要:sudo adduser william sudo passwd william //两次输入密码赋予root权限visudo找到## Allow root to run any commands anywhereroot ALL=(ALL) ALL#添加william ALL=(ALL) ALL如果不想sudo输入密码 上面的william ALL=(ALL) NOPASSWD: ALL这时就可以 sudo su - 切换到root用户了删除用户userdel william路径同时删除userdel -r william
阅读全文
摘要:1. nginx php-rpm 包升级sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpmsudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm2. 安装mysqlsudo yum install mysql mysql-serversudo /etc/init.d/mysqld restartsudo /usr/bin/mysql_secure_installation3
阅读全文
摘要:1 stop mysqlUbuntu/Debian: sudo /etc/init.d/mysql stopCentOs: sudo /etc/init.d/mysqld stop2 启动safe模式但是要跳过用户的权限表也就是privileges 表sudo mysqld_safe --skip-grant-tables &3 登录mysql并使用mysql数据库这里不需要密码mysql -u rootuse mysql;4 设置新密码update user set password=PASSWORD("mynewpassword") where User=
阅读全文
摘要:If you downloaded and installed from .dmg package already, and mightbe sometime it sucks because of some reason like me, i gem install mysql2.1 Remove mysql from you Mac OS X1.1 backup your database by mysqldump, of course if you want to.1.2 stop the database. "sudo mysqladmin shutdown" or
阅读全文
摘要:这两个变量被设置了DYLD_LIBRARY_PATH*或*LD_LIBRARY_PATH, 用下面的明令查找一下,一般在.bash_profile, .bashrc 等文件中。执行brew doctor 你会发现,不建议设置这个变量。grep LD_LIBRARY_PATH ~/.*或grep DYLD_LIBRARY_PATH ~/.*
阅读全文
摘要:1G 顶部G 底部ctrl+F 前进ctrl+B 后退/text 向前搜索?text 向后搜索I i 插入字符串a 光标后插入字符A 跳到句末尾wq 写入并退出h k j l 上下左右移动光标/键盘上的箭头一样o 光标前打开新的一行输入文字O光标后打开新的一行输入文字yy复制光标的一行p将复制的行放到光标后边dd删除光标行x删除光标后的一个字符http://scottlab.ucsc.edu/xtal/vi_commands.html
阅读全文
摘要:一 用户相关操作1. 添加帐户useradd 选项 用户名 -ccomment指定一段注释性描述。 -d目录指定用户主目录,如果此目录不存在,则同时使用-m选项,可以创建主目录。 -g用户组指定用户所属的用户组。 -G用户组,用户组指定用户所属的附加组。 -sShell文件指定用户的登录Shell。 -u用户号指定用户的用户号,如果同时有-o选项,则可以重复使用其他用户的标识号。useradd -d /usr/sam -m sam创建sam, -d 和 -m wei登录名sam产生一个主目录/usr/sam (/usr 为默认的用户目录所在的父目录).useradd -s /b...
阅读全文
摘要:查看当前目录和文件权限ls -l文件属性 连接数 文件拥有者 所属群组 文件大小 文件修改时间 文件名drwxr-xr-x 4 william wheel 136 Apr 10 23:34 vendord:(-rw-r--r-- ) 第一个字符指定了文件类型,这个表示目录。通常一个目录也是一个文件,如果第一个字符是横线,那就是非目录文件。rwx: 文件拥有者属性。r-x:文件所属群组的属性。r-x:是对于其他用户的属性。chmod 用来修改文件或目录的访问权限chmod [who][+|-|=][mode] 文件名?参数:who下...
阅读全文
摘要:1 安装gem install capistrano// For mutiple stagesgem install capistrano-ext2 准备capify .这个命令会创建Capfile,和 config/deploy.rb 文件。Capfile会帮助加在一些合适的库文件和配置。配置deploy.rbset :application, "applciation_name"//gitset :scm, :gitset :repository, "git@www.xxx.com:/repository.git"set :scm_passphras
阅读全文
摘要:gem install unicornorgem 'unciron'1 install Nginxyum install ...2 Configurationvi /etc/nginx/nginx.confIt's adviced to run as a seperae user.Here is a example:sudo user add -s /sbin/nologin -r nginxsudo usermod -a -G web nginx ; add nginx user into web groupsudo mkdir /var/www ;this shou
阅读全文
摘要:brew install nginx 开机启动$ sudo cp `brew --prefix nginx`/homebrew.mxcl.nginx.plist /Library/LaunchDaemons/$ sudo sed -i -e 's/`whoami`/root/g' `brew --prefix nginx`/homebrew.mxcl.nginx.plisterror logsudo mkdir /var/log/nginx/nginx.conf:error_log /var/log/nginx/error.log;)Config file directory:
阅读全文
摘要:vim配置文件 ~/.vimrc 如果没有自己创建一个即可filetype plugin indent on #打开插件set number #显示行号syntax on #语法高亮set cindent #set transparency=15 #透明度set guioptions=aAce #去掉toolbarset shiftwidth=4 ...
阅读全文
摘要:curl -X POST -H "Content-Type:application/json" -d '{"comment":"I do love it, ;) ","place_id":"40","user_id":"3"}' http://localhost:3002/api/v1/xxx
阅读全文
摘要:cat *.sh 看一下你的那个sh文件看第一行是#!/bin/bash 还果 #!/bin/sh如果是/bin/bash就执行 bash your.sh如果是/bin/sh 就执行 sh your.sh也可以用chmod 755 your.sh命令加上执行属性,用./your.sh执行
阅读全文
摘要:可以yum或者下载源文件编译安装1 添加yum源创建文件/etc/yum.repos.d/nginx.repo 2 编辑文件[nginx]name=nginx repobaseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/gpgcheck=0enabled=1"os" 替换“rhel” 或者 “centos”,“OSRELEASE” 换成“5” 或“6”, 对应5.x 和 6.x
阅读全文