PHP read permissions messed up

I’ll try to be as clear as possible.

On my server which runs on ubuntu 14 i installed mutlicraft (a minecraft control panel which uses YII).

After uploading the server i noticed that the server wont run. Thats because each server needs hiw own user. In my case i had to change the ownership from root user to mc1.

Accidentally i typed chown -R mc1 * Yes! I typed -R and took ownership of EVERYTING on the user mc1.

The directory:

The multicraft server directory: /home/minecraft/servers/server1

The multicraft web panel: /var/www/multicraft

The Actual problem

After doing this the panel is not accessible. Why? Because of this:

2014/10/10 16:19:07 [error] 1368#0: *15 FastCGI sent in stderr: "PHP message: PHP Fatal error:            Uncaught exception 'CException' with message 'Application runtime path             "/var/www/multicraft/protected/runtime" is not valid. Please make sure it is a directory writable by  the Web server process.' in /var/www/multicraft/protected/yii/base/CApplication.php:271

Stack trace:

#0 /var/www/multicraft/protected/yii/base/CApplication.php(258): CApplication-   >setRuntimePath('/var/www/multic...')

#1 /var/www/multicraft/protected/yii/base/CStatePersister.php(67): CApplication->getRuntimePath()

#2 /var/www/multicraft/protected/yii/base/CModule.php(388): CStatePersister->init() 

#3 /var/www/multicraft/protected/yii/base/CApplication.php(458): CModule->getComponent('statePersister')

#4 /var/www/multicraft/protected/yii/base/CApplication.php(651): CApplication->getStatePersister()

#5 /var/www/multicraft/protected/yii/base/CApplication.php(592): CApplication->loadGlobalState()

#6 /var/www/multicraft/protected/yii/base/CSecurityManager.php(101): CApplication->getGlobalState('Yii.CSecurityMa" while reading response header from upstream, client:, server: localhost, request: "GET /multicraft/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: ""

After doing this i hit chown -R mc1 * in order to reverse the action and it worked except from the www

Is it possible to fix this?

Why not just go to /var/www/multicraft/protected/ and make sure runtime is writeable by php?

How can i do that?


chmod 0775 runtime

chown mc1:www-data runtime

Where the folder runtime should be located?

It says here in error message: /var/www/multicraft/protected/runtime