使用Nginx安装错误设置Codiad

时间:2014-12-02 13:46:10

标签: nginx ide digital-ocean

我正在尝试使用Nginx在我的Droplet中设置Codiad,虽然我已将Codiad文件的所有权限设置为我的用户,当我导航到那些文件时,Codiad不断向我发送“安装错误”消息,这是以下内容:

Installation Error

Please make sure the following exist and are writeable: 
[SYSTEM]/config.php - ERROR 
[SYSTEM]/workspace - ERROR 
[SYSTEM]/plugins - ERROR 
[SYSTEM]/themes - ERROR 
[SYSTEM]/data - ERROR

这是我的nginx配置:

server { 
listen 8081; ## listen for ipv4; this line is default and implied 
listen [::]:8081 default ipv6only=on; ## listen for ipv6

root /var/www/html/codiad; 
index index.php index.html index.htm;

# Make site accessible from http://localhost/ 
server_name domain;

location / { 
# First attempt to serve request as file, then 
# as directory, then fall back to index.html 
try_files $uri $uri/ /index.html; 
}

error_page 404 /404.html;

# redirect server error pages to the static page /50x.html 
error_page 500 502 503 504 /50x.html; 
location = /50x.html { 
root /var/www/html; 
}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 
location ~ \.php$ { 
try_files $uri =404; 
fastcgi_pass unix:/var/run/php5-fpm.sock; 
fastcgi_index index.php; 
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
include fastcgi_params; 
} 
}

此外,这些是当前设置的权限:

ls -l /var/www/html/codiad/

total 124 
-rwxrwxr-x 1 cae cae 370 Dec 2 05:01 AUTHORS.txt 
-rw-rw-r-- 1 cae cae 11357 Dec 2 05:01 common.php 
drwxrwxr-x 16 cae cae 4096 Dec 2 05:01 components 
-rw-rw-r-- 1 cae cae 1127 Dec 2 05:01 composer.json 
-rw-rw-r-- 1 cae cae 1612 Dec 2 05:01 config.example.php 
-rw-rw-r-- 1 cae cae 1612 Dec 2 05:02 config.php 
-rwxrwxr-x 1 cae cae 1489 Dec 2 05:01 CONTRIBUTING.md 
drwxrwxr-x 2 cae cae 4096 Dec 2 05:01 data 
-rwxrwxr-x 1 cae cae 1150 Dec 2 05:01 favicon.ico 
-rwxrwxr-x 1 cae cae 17210 Dec 2 05:01 index.php 
-rwxrwxr-x 1 cae cae 634 Dec 2 05:01 INSTALL.txt 
drwxrwxr-x 2 cae cae 4096 Dec 2 05:01 js 
drwxrwxr-x 2 cae cae 4096 Dec 2 05:01 languages 
drwxrwxr-x 2 cae cae 4096 Dec 2 05:01 lib 
-rwxrwxr-x 1 cae cae 1133 Dec 2 05:01 LICENSE.txt 
drwxrwxr-x 2 cae cae 4096 Dec 2 05:01 plugins 
-rwxrwxr-x 1 cae cae 672 Dec 2 05:01 README.md 
-rwxrwxr-x 1 cae cae 24394 Dec 2 05:01 style_guide.php 
drwxrwxr-x 3 cae cae 4096 Dec 2 05:01 themes 
drwxrwxr-x 2 cae cae 4096 Dec 2 05:01 workspace

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

您的权限似乎属于您的用户。您将不得不将目录的所有权更改为www-data。运行以下命令:

sudo chown -R www-data:www-data ./*