我有Nginx设置并正确显示测试页面.如果我尝试更改根路径,即使所有权限都相同,我也会收到403 Forbidden错误.此外,nginx用户存在.
nginx.conf:
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
index index.html index.htm;
server {
listen 80;
server_name localhost;
root /var/www/html; #changed from the default /usr/share/nginx/html
}
}
Run Code Online (Sandbox Code Playgroud)
namei -om /usr/share/nginx/html/index.html
f: /usr/share/nginx/html/index.html
dr-xr-xr-x root root /
drwxr-xr-x root root usr
drwxr-xr-x root root share
drwxr-xr-x root root nginx
drwxr-xr-x root root html
-rw-r--r-- root root index.html
Run Code Online (Sandbox Code Playgroud)
namei -om /var/www/html/index.html
f: /var/www/html/index.html
dr-xr-xr-x root root /
drwxr-xr-x root root var
drwxr-xr-x root …
Run Code Online (Sandbox Code Playgroud) 我正在运行一个返回两列和X行的SQL查询.这两列是选择框的值和文本:
value: 1 text: Boston
value: 2 text: NYC
value: N text: Whatever
Run Code Online (Sandbox Code Playgroud)
我想在查询完成时向结果集中添加另一行,以便我得到的结果如下:
value: 0 text: Select a city
value: 1 text: Boston
value: 2 text: NYC
value: N text: Whatever
Run Code Online (Sandbox Code Playgroud)
我不想将新行添加到DB,只是添加到结果集.我想这样做的原因是CMS使用查询,我想避免入侵它.我见过一些涉及UNION或JOIN的解决方案,但我宁愿不将文本存储在别处.
这是我现在的问题:
SELECT id AS value, city AS text FROM #__cities
Run Code Online (Sandbox Code Playgroud)
有什么相似的吗?
SELECT id AS value, city AS text FROM #__cities *APPEND id=0, formal_name='Select a city'*
Run Code Online (Sandbox Code Playgroud)