CentOS 6.4使用Nginx配置文件服务器
2015-05-18 23:44
651 查看
目的:通过http协议访问ftp目录中的文件
步骤:一:安装nginx,并修改其目录 二:安装vsftp(在另一篇博文中有)
1、配置CentOS 6.2 第三方yum源(CentOS默认的标准源里没有nginx软件包):
yum install wget #安装下载工具wget
wget http://www.atomicorp.com/installers/atomic #下载atomic yum源
sh ./atomic #安装
yum check-update #更新yum软件包
2、安装nginx:
yum install nginx #安装nginx,根据提示,输入Y安装即可成功安装
#修改配置文件,这里省略,主要是将目录指定到 /home/ngmsw-files
service nginx start #启动
chkconfig nginx on #设为开机启动
更改nginx网站根目录方法:
默认网站根目录为/usr/local/nginx/html,要将它改成/homw/www
vi /usr/local/nginx/conf/nginx.conf
将其中的
location / {
root html;
index index.php index.html index.htm;
}
改为
location / {
root /home/www;
index index.php index.html index.htm;
}
然后再将
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
改为
location ~ \.php$ {
root /home/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
然后重启nginx
已经安装了samba,所以要将vi /etc/samba/smb.conf中的[public]下的path值改为
path = /home/www/
步骤:一:安装nginx,并修改其目录 二:安装vsftp(在另一篇博文中有)
1、配置CentOS 6.2 第三方yum源(CentOS默认的标准源里没有nginx软件包):
yum install wget #安装下载工具wget
wget http://www.atomicorp.com/installers/atomic #下载atomic yum源
sh ./atomic #安装
yum check-update #更新yum软件包
2、安装nginx:
yum install nginx #安装nginx,根据提示,输入Y安装即可成功安装
#修改配置文件,这里省略,主要是将目录指定到 /home/ngmsw-files
service nginx start #启动
chkconfig nginx on #设为开机启动
更改nginx网站根目录方法:
默认网站根目录为/usr/local/nginx/html,要将它改成/homw/www
vi /usr/local/nginx/conf/nginx.conf
将其中的
location / {
root html;
index index.php index.html index.htm;
}
改为
location / {
root /home/www;
index index.php index.html index.htm;
}
然后再将
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
改为
location ~ \.php$ {
root /home/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
然后重启nginx
已经安装了samba,所以要将vi /etc/samba/smb.conf中的[public]下的path值改为
path = /home/www/
相关文章推荐
- CentOS 6.4 i386 版本安装 FastDFS、使用Nginx作为文件访问WEB服务器
- 服务器文件[置顶] nginx的配置和使用
- CentOS 6.4 安装 FastDFS、使用Nginx作为文件访问WEB服务器
- 使用数据卷容器,配置Nginx Docker作为静态文件服务器
- RedHat Enterprise Linux 6.4使用Centos 6 的yum源 分类: 服务器搭建 Nginx 2015-07-14 14:11 5人阅读 评论(0) 收藏
- centos 6.3安装nginx 配置文件服务器
- Nginx服务器安装及配置文件与使用详解
- 使用nginx反向代理到不同服务器(共享同一端口)配置文件
- window下使用nginx提供文件下载服务器配置
- 记一次线上centOS服务器,nginx的https配置
- centos 6.5 搭建ftp 服务器(vsftpd的配置文件说明)
- 使用Nginx配置反向代理服务器
- nginx服务器安装及配置文件详解
- Nginx实现跨域使用字体文件的配置详解
- nginx配置1:借助Nginx搭建反向代理服务器与缓存静态文件
- nginx配置1:借助Nginx搭建反向代理服务器与缓存静态文件
- 2017.7.1 ftp文件服务器安装与配置(已验证可使用)
- Nginx 服务器安装及配置文件详解
- 配置nginx 文件,使用二级域名访问