简单使用nginx和mysql

简单使用nginx和mysql
Editor Feng / February 25, 2014 / No comments
/srv/www/wordpress/public_html;在使用树莓派搭建wordpress博客的过程中,
先做 apt-get
再对nginx进行配置:在/etc/nginx/sites-sites-enabled和sites-sites-available下需要配置相同文件,这里对命令的解释如下:
# Upstream to abstract backend connection(s) for php
upstream php {
server unix:/var/run/php5-fpm.sock;
}


server {


## Your only path reference.
root /srv/www/wordpress/public_html;//root用户在此加入文件,www目录,可以变化到其他位置
listen 80;
## Your website name goes here. Change to domain.ltd in VPS
server_name _;


access_log /srv/www/wordpress/logs/access.log;
error_log /srv/www/wordpress/logs/error.log; 日志名


## This should be in your http block and if it is, it’s not needed here.
index index.php index.html index.htm ;


location = /favicon.ico {
log_not_found off;
access_log off;
}


location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}


location / {
# This is cool because no php is touched for static content
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
#NOTE: You should have “cgi.fix_pathinfo = 0;” in php.ini
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_pass php;
}


location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
}


接下来需要进行权限设置:对www目录权限设置 chmod 775 /srv/www/wordpress/ -R


重启 service nginx restart


在配置好nginx后,我们可以使用mysql数据库


其进入命令行的方法为,, mysql -u root -p
接着进入enter输入密码
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值