简单使用nginx和mysql
2014-05-09 22:16
267 查看
简单使用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输入密码
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输入密码
相关文章推荐
- ubuntu下使用nginx、mysql、python搭建一个简单的webserver
- 使用struts2+MySQL做简单的登录验证
- centos安装nginx+mysql+php+fastcgi+memcache最简单方法
- MySQL简单使用小结
- Nginx与tomcat组合的简单使用
- Mac OS下安装mysql及其简单使用
- 简单的使用PHP操作Mysql
- Linux命令:nginx及php和mysql安装使用
- 使用NGINX支持PHP,MYSQL
- HTTP和反向代理服务器-nginx在项目中的简单使用说明
- 使用nginx, memcached, libevent, mysql实现url排重
- Mysql的一些简单命令的使用
- 简单介绍MySQL中GROUP BY子句的使用
- MySql简单sql使用(二)
- nginx简单双机热备:backup参数的使用
- mysql管理工具percona-toolkit-3简单使用介绍
- 使用Django+MySQL+Apache+Linux创建简单的博客
- Mac OS使用brew安装Nginx、MySQL、PHP-FPM的LAMP开发环境
- mysql安装与简单使用
- <笔记>Mysql简单使用