当前位置:网站首页 / Linux / 正文

NanoPi NEO安装nginx并开启目录浏览

时间:2019年02月28日 | 作者 : liuhui | 分类 : Linux | 浏览: 5111次 | 评论 0

阿里云限量代金券 | 此广告位出租25元/月

更新系统

apt-get update

apt-get upgrade

安装nginx

sudo apt-get install nginx-full -y

sudo apt-get install nginx -y

创建nginx虚拟主机文件

nano /etc/nginx/conf.d/file.conf

配置内容

{
    listen 80;
    server_name www.abc.com abc.com;
    index index.php index.html index.htm default.php default.htm default.html;
    root /var/www/file;
    charset utf-8;
    location / {
    autoindex on;
    autoindex_localtime on;
    }

    access_log  /root/file.log;
    error_log  /root/file.error.log;
}

创建目录

mkdir /var/www/file

重启nginx

sudo /etc/init.d/nginx restart

推荐您阅读更多有关于“”的文章

猜你喜欢

网站分类
关注电脑博士
友情链接

分享:

支付宝

微信