创建目录
mkdir 目录名
chmod 777 目录名 变更权限
加入开机启动项服务
chkconfig --add php-fpm
chkconfig nginx on
查找文件位置 经常用于查找yum安装后各种配置文件及启动程序所在位置
find|grep php-fpm
服务启动
service nginx
start|stop|restart|condrestart|try-restart|force-reload|upgrade|reload|status|help|configtest
service nginx start
service php-fpm start
查看进程
ps -ef | grep java
查看进程
kill -9 进程id
http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpmrpm -qa | grep nginx 检查nginx 是否加入源路径
安装 php mysql nginx
yum install mysql mysql-server php php-mysql php-fpm nginx
默认default.conf修改
server {
listen 80;
server_name localhost;#自定义域名配置
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
location / {
root /home/www;#自定义目录设置
index index.html index.htm index.php;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#错误页处理
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /home/www;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
#root /home/www;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/tmp/php-cgi.sock;#这种方式听说性能提升比较多
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/www$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache‘s document root
# concurs with nginx‘s one
#
#location ~ /\.ht {
# deny all;
#}
}
其他*.conf 可自定义添加
server
{
listen 80;
server_name wx.vtz.cc;
index index.html index.htm index.php;
root /home/wwwroot/weixin;
location ~ .*\.(php|php5)?$
{
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
}
location /status {
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log /home/wwwlogs/weixin_access.log access;
}#listen = 127.0.0.1:9000 listen = /tmp/php-cgi.sock
chkconfig --add nginx chkconfig nginx on service nginx start
chkconfig --add php-fpm chkconfig php-fpm on service php-fpm start
yum安装nginx+mysql+php,布布扣,bubuko.com
原文:http://blog.csdn.net/lhb_blog/article/details/21603019