I have worked with Apache before, so I am aware that the default public web root is typically /var/www/
.
我最近开始与原教旨合作,但我似乎无法找到缺省公共网根。
在什么地方,我可以找到虚构的公共网络根基?
I have worked with Apache before, so I am aware that the default public web root is typically /var/www/
.
我最近开始与原教旨合作,但我似乎无法找到缺省公共网根。
在什么地方,我可以找到虚构的公共网络根基?
如果您的配置不包括<条码>/日码/月/日;条码>说明,或包含使用诸如<条码>等相对途径的说明/编号;条码>,则由此产生的道路取决于汇编时间的选择。
或许,如果你downloaded,并汇编了来文方。 在这种情形下,这些途径与使用<代码>-prefix的相对。 如果您不作改动,则该编码为<代码>/usr/ local/nginx。 您可以通过<代码>nginx-V汇编这些参数。
Since the root
directive defaults to html
, this would, of course, result in /usr/local/nginx/html
being the answer to your question.
然而,如果你以任何其他方式安装了gin子,则所有 be都是在外。 你的分布可能会使用完全不同的缺省道路。 了解你如何分配选择用途,是另一个完全的任务。
如在乌兰巴托安装,使用吸收植被,可尝试/usr/comm/nginx/www
。
<>光线>
On more recent versions the path has changed to:
/usr/share/nginx/html
<>2019 EDIT:
Might Trial in /var/www/html/index.nginx-debian.html
.
Debian的违约Nginx目录为/var/www/nginx-default
。
查阅文件:/etc/nginx/sites-enabled/default
发现
server {
listen 80 default;
server_name localhost;
access_log /var/log/nginx/localhost.access.log;
location / {
root /var/www/nginx-default;
index index.html index.htm;
}
根源在于违约地点。
缺省公共网络根基可以从原产地-V产出中找到:
nginx -V
nginx version: nginx/1.10.1
built with OpenSSL 1.0.2h 3 May 2016
TLS SNI support enabled
configure arguments: --prefix=/var/lib/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --pid-path=/run/nginx/nginx.pid --lock-path=/run/nginx/nginx.lock --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --user=nginx --group=nginx --with-ipv6 --with-file-aio --with-pcre-jit --with-http_dav_module --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module --with-http_v2_module --with-http_auth_request_module --with-mail --with-mail_ssl_module
the --prefix value is the answer to the question. for the sample above the root is /var/lib/nginx
乌班图和码头图像:
/usr/share/nginx/html/
关于麦克雷 X 安装有rew子的gin子,使缺损目录:
/usr/local/var/www
因此:
root html
手段
root /usr/local/var/www/html
没有任何html的名录,因此必须手工制作。
正如这里的大多数用户所说的那样,它正在这条道路上:
/usr/share/nginx/html
这是一条不停的道路,但你可以做到。
你们都需要在网络服务器根树上打一个树,给它一些“而不是777”的许可,只允许一个用户,只让一个用户看上去,但是,由于道路的结束,你的文件和文件将被公众看到。
例如,你可以这样作:
home_web/site1/public_html/www/
每当你在Nginx成为虚拟东道国时,你就能够定制自己的根本道路,在你的服务器栏中添加类似内容:
server {
listen 80;
server_name yoursite.com;
root /home_web/site1/public_html/www/;
}
页: 1 网址根切:
nano /etc/nginx/sites-enabled/default
在<>dstrong>default文档中,在服务器标签上查阅root,并更换网站的缺省夹,例如,我的网址是/var/www。
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /var/www; <-- Here!
...
When I was evaluating nginx, apache2 and lighttpd, I mapped all of them to my website sitting at /var/www. I found this the best way to evaluate efficiently.
然后,你可以开始/穿过你所选择的服务器,看看哪一个是最佳的。
e.g.
service apache2 stop
service nginx start
Btw, 根基实际上非常快!
Look into nginx config file to be sure. This command greps for whatever is configured on your Machine:
cat /etc/nginx/sites-enabled/default |grep "root"
在我的机器上是:root /usr/comm/nginx/www;
。
根基X的缺电网夹取决于你是如何安装的,但通常位于这些地点:
/usr/local/nginx/html
/usr/nginx/html
指令nginx -V
,并查询-prefix
。 利用这一条目确定你的违约道路。
假设组合:
$ nginx -T
...
server {
...
location / {
root /usr/share/nginx/html;
...
}
...
}
您可能有所不同,因为它取决于您的<代码>nginx是如何组合的。
参考资料:
更新:在<代码>纳克inx上添加<代码>>-T选项的问题上有一些混淆。 https://github.com/vl-homutov“rel=“noretinger”>vl-homutov。 6月16日,成为v1.9.2 发布。 在https://github.com/nginx/nginx/commit/4b768adc2e55e828cd7fb973032749fc5f4762c” rel=“noreferer”发布说明。 <代码>-T选项载于每一条<代码>nginx。 释放后,包括乌班图16.04.1 LTS的释放:
root@23cc8e58640e:/# nginx -h
nginx version: nginx/1.10.0 (Ubuntu)
Usage: nginx [-?hvVtTq] [-s signal] [-c filename] [-p prefix] [-g directives]
Options:
-?,-h : this help
-v : show version and exit
-V : show version and configure options then exit
-t : test configuration and exit
-T : test configuration, dump it and exit
-q : suppress non-error messages during configuration testing
-s signal : send signal to a master process: stop, quit, reopen, reload
-p prefix : set prefix path (default: /usr/share/nginx/)
-c filename : set configuration file (default: /etc/nginx/nginx.conf)
-g directives : set global directives out of configuration file
在Mac 安装有制鞋的 n:
/usr/ local/etc/nginx/nginx.conf
location / {
root html; # **means /usr/local/Cellar/nginx/1.8.0/html and it soft linked to /usr/local/var/www**
index index.html;
}
对于CentOS、Utub和Fedora,缺省名录为/usr/comm/nginx/html
。
For AWS EC2 页: 1
/usr/share/nginx
在我的案件中,见/usr/comm/nginx/html>。
您可以尝试进行搜查。
find / -name html
仅指出,原始服务器的违约指数页也将显示根基。 从亚马孙湖农庄 n(1.4.3)到:
这是一种缺省指数.html页,在亚马孙湖工业部长会议上用原子分发。 它位于/usr/comm/nginx/html。
你们现在应当把你们的内容放在你们选择的某个地点,并将根基配置指令植根于根基配置文件/etc/nginx/nginx。
如果你在乌班图14.04上,你可以找到 n子:www.archy。
yusuf@yusuf-he:/usr/share/nginx/html$ pwd
/usr/share/nginx/html
yusuf@yusuf-he:/usr/share/nginx/html$
无论在什么地方,你都可以寻找这个系统(系统管理或新版的gin)。
find / -name nginx
*default pages web allocated in var/www/html *default configuration server etc/nginx/sites/avaliable/nginx.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.php;
server_name _;
location /data/ {
autoindex on;
}
location /Maxtor {
root /media/odroid/;
autoindex on;
}
# This option is important for using PHP.
location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
}
}
<*default configuracion services等/nginx/nginx.conf>
content..
user www-data;
worker_processes 8;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}
<default accesslog with theipuser var/log/nginx/...
If you need to find out nginx public root folder that was defined at compile time you can just check your access.log file.
此处是nginx.confhttp://strong>与log_format指令的http://strong>一节的一个实例,在插图开头添加“文件”:
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
## ADD $document_root HERE ##
log_format main $document_root $remote_addr - $remote_user [$time_local] "$request"
$status $body_bytes_sent "$http_referer"
"$http_user_agent" "$http_x_forwarded_for" ;
access_log /var/log/nginx/access.log main;
etc. .......
接着,支持所有组合文件* ,编汇目录,并编造文件test.conf,行文如下:
server{
listen 80;
server_name localhost;
}
加入以下条目:127.0.0.1
Reload nginx Format:nginx -s reload
Send GET request to : http:// localhost
查阅的最后一行:log :tail -n 1 /var/log/nginx/access.log
这里是该指挥部的样本输出,其中/etc/nginx/html是汇编时间界定的缺省文件根基:
/etc/nginx/html 127.0.0.1 - - [15/Mar/2017:17:12:25 +0200] "GET / HTTP/1.1" 404 169 "-" "curl/7.35.0" "-"
you can access file config nginx,you can see root /path. in this
default of nginx apache at /var/www/html
My nginx on Ubuntu is "nginx version: nginx/1.9.12 (Ubuntu)" and root path is /var/www/html/
Ubuntu info is : No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04 LTS Release: 16.04 Codename: xenial
实际上,如果你刚刚在乌兰巴托安装了正文,那么你可以去“/etc/nginx/sites- available”并核对缺省档案,就有一个配置,如“root /web/root/path/goes/here”。 这正是你所期待的。
In Ubuntu,
Nginx default root Directory location is /usr/share/nginx/html
You can find it in /var/www/ that is default directory for nginx and apache but you can change it. step 1 go to the following folder /etc/nginx/sites-available
第2步的违约卷宗是,你可以找到一个服务器组,因为有一条线被称作是确定地点的根本。
in ubuntu 19.04, we found it on
/usr/comm/nginx/html
www.un.org/spanish/ecosoc nginx/1.4.6(Ubuntu)
/etc/nginx$ cat /etc/nginx/sites-available/default | grep -i root
- root /usr/share/nginx/html;
我在“数字海洋”上也曾有过这个议题,它有一个有gin的言语网站。
My solution was to do the following:
/etc/nginx/nginx.conf
file with the following:server {
root /var/www/html;
}
然后,我不得不打上<条码>。
http://www.un.org -V的指挥还显示贵方根基X config文档的位置(在/etc/nginx/nginx.conf
上标明)
The default is related to the prefix
option of the configure
script when nginx is compiled; here s some strange sample from Debian:
% nginx -V | & tr "
" | fgrep -e path -e prefix
--prefix=/etc/nginx
--conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log
--http-client-body-temp-path=/var/lib/nginx/body
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi
--http-log-path=/var/log/nginx/access.log
--http-proxy-temp-path=/var/lib/nginx/proxy
--http-scgi-temp-path=/var/lib/nginx/scgi
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi
--lock-path=/var/lock/nginx.lock
--pid-path=/var/run/nginx.pid
随后,root
,。 (根据http://nginx.org/r/root” rel=“nofollow noreferer”>,root
Directive, 可在prefix
内查阅,可在 编码<_document_root/code>上查到>。 简编文件变量:
# printf server{listen 4867;return 200 $document_root\n;}
>/etc/nginx/conf.d/so.10674867.conf
# nginx -s reload && curl localhost:4867
/etc/nginx/html
然而,象德比亚这样的邪恶分布似乎在改观,使你感到不快:
% fgrep -e root -e include /etc/nginx/nginx.conf
include /etc/nginx/mime.types;
#include /etc/nginx/naxsi_core.rules;
#passenger_root /usr;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
% fgrep -e root -e include
/etc/nginx/conf.d/*.conf /etc/nginx/sites-enabled/*
/etc/nginx/conf.d/so.10674867.conf:server{listen 4867;return 200 $document_root
;}
/etc/nginx/sites-enabled/default: root /usr/share/nginx/www;
/etc/nginx/sites-enabled/default: # include /etc/nginx/naxsi.rules
/etc/nginx/sites-enabled/default: # root /usr/share/nginx/www;
/etc/nginx/sites-enabled/default: # include fastcgi_params;
/etc/nginx/sites-enabled/default: # deny access to .htaccess files, if Apache s document root
/etc/nginx/sites-enabled/default:# root html;
/etc/nginx/sites-enabled/default:# root html;
因此,就Debian一案而言,你可以看到,最终将根基定在<代码>/usr/comm/nginx/www上。
但是,正如你看到的,将使用其<代码>的文件_root的抽样服务器配置。 http://www.un.org/french/ga/president
甲型六氯环己烷根本没有任何违约地点。 The file /etc/nginx/conf.d/default.conf
说:
# Everything is a 404
location / {
return 404;
}
# You may need this to prevent return 404 recursion.
location = /404.html {
internal;
}
用<代码>root /var/www/ localhost/htdocs等行文取代。 接着,<代码>sudo Service nginxstart 重新启用。
I have used docker image nginx:1.18.0-alpine previously and below is the conf. It works as expected app.localhost --> points to the block wit server_name app.* localhost --> points to the other ...
I m having a problem getting more memory out of PHP. This is the error message: Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 82 bytes) in ... Yet: I ve set ...
Ok. Im little bit confused about those permissions in linux so please people help me out. The trouble is that I dont want to run server as root, so I created another user with sudo privileges so he ...
what I m looking for is the ability for nginx to detect that a url has the query string variable cid. for example www.adomain.com/froggy?cid=12&as=false (query string can be solo or mixed with ...
I upload images to my App using Ajax and an Iframe. In Development everything works like a charm. But in production Nginx suddenly raises a 404 error. When I look into the log, the request never hits ...
I use nginx along with fastcgi. I see a lot of the following errors in the error logs readv() failed (104: Connection reset by peer) while reading upstream and recv() failed (104: Connection ...
We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...
Essentially, my route is working perfectly, Passenger seems to be loading - all is hunky-dory. Except that nothing Railsy happens. Here s my Nginx log from starting the server to the first request (...