0

I recently had to reinstall Ubuntu and everything else as my SSD crashed.

I've got Apache/MySQL/PHP set up and can access localhost/ without problems. Running PHP and MySQL works fine as well.

I keep my projects in a Dropbox folder (since the crash) located at /home/powerbuoy/Dropbox/Projects/ and have set up VHOSTs that point to some of the projects in there. I've also set up /etc/hosts so that I can access my projects through http://project-name.dev.

However, when I try to visit http://any-project.dev all I get is 403 forbidden. I've run chmod -R 777 Projects/ and all the files and folders are now green in the terminal. That didn't help.

I checked the error-logs and they say:

[crit] [client 127.0.0.1] (13)Permission denied: /home/powerbuoy/Dropbox/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

But there isn't even supposed to be a .htaccess file anywhere there.

I even set up a completely empty project (/home/powerbuoy/Dropbox/Projects/test/index.php with just <?php phpinfo() inside), set up a VHOST and a http://test.dev URL. I get the same error here.

Any ideas?

Thanks

Edit: I tried moving my test project to the desktop (/home/powerbuoy/Desktop/test/) and now it works :P

Perhaps it has something to do with the projects being located inside the Dropbox folder??

4

3 に答える 3

8

ほとんどの場合、これは chmod の問題です。すべてのツリーの chmod 設定を変更する必要があります。ssh アクセスできる場合は、次のコマンドを試すことができます。

chmod 755 $(find /home/user/public_html -type d)
chmod 644 $(find /home/user/public_html -type f)

/home/user/public_html の部分を「実際のパス」に置き換えてください。

于 2014-01-24T23:07:34.220 に答える
2

どうやらchmod、プロジェクトが置かれているディレクトリを単に作成するだけでは十分ではありませんでした。ツリーの上位にchmodあるすべてのディレクトリも同様に実行する必要がありました。

ですから、私のVHOSTが/home/powerbuoy/Dropbox/Projects/AProject/単にchmodingを指摘したとしても、/AProject/それだけでは十分ではありませんが、それはそれからずっと行われなければならない/home/powerbuoy/ようです。

于 2013-03-15T16:09:46.830 に答える
1

ディレクトリ ツリーを上っていくパーミッションを chmod しなければならなかった理由は、Linux ではフォルダに/home/jsmith/my_folder直接アクセスするなどの単純なアクセスが許可されていないためです。/ /home/およびに対する実行権限も必要 /home/jsmithです。実行ビットにより、影響を受けるユーザーはディレクトリに入り、その中のファイルやディレクトリにアクセスできます。

于 2013-03-15T16:16:24.490 に答える