Domanda

I have a regular Linux/Apache server (hired hosting) where I host a PHP website that I update regularly through FTP. I wanted to automatically deploy changes to the server when I push a change to its Bitbucket repository.

To start, I SSH to the server and clone the repository to a dir (say, myapp):

git clone [myapp GIT URL]

When I go to http://mydomain.com/myapp I get Internal Server Error (500). I figured it had something to do with permissions or file ownership. Through FTP, i chmod all files to 777 and it still throws the same error. In fact, I can delete the directory's content and upload the app manually through FTP and the error will persist (The dir's permissions are also set to 777). The only way to fix it is to delete the directory and create it again and upload the app manually.

Like I said, it's a paid hosting service so I do not own the server or have any sort of advanced control over it.

Why does this happen? Is it fixable from my end?

È stato utile?

Soluzione

Just found this question because I had the same problem and i couldn't find an answer anywhere so this is for everyone in the future that'll find this question.

You have to edit your bashrc file

$ vim ~/.bashrc

And add this to the bottom of the file

umask 022

After this you have to logout and login before this will take effect (if you're logged in using ssh just connect again) or execute the file

.  ~/.bashrc

Now you can git clone again and it'll work.

You can find the documentation for umask here

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top