Centos 7.3 Permission_denied problem

Added by volkan yalcin about 1 year ago


I installed Redmine 3.3.3 into the Centos 7.3. I used MySQL as a database and Apache2 for web server. I followed many different guide during the setup process. At the end of the setup, project was reachable but I was not able to reach https://projectUrl:8080/my/account URL. Then I checked the log and log was saying:

App 7470 stderr: ActionView::Template::Error (Permission denied @ dir_s_mkdir - /var/www/redmine/tmp/cache/D3B/440):
App 7470 stderr: 22: <p><%= f.text_field :lastname, :required => true ></p>
App 7470 stderr: 23: <p><
= f.text_field :mail, :required => true ></p>
App 7470 stderr: 24: <
unless @user.force_default_language? >
App 7470 stderr: 25: <p><
= f.select :language, lang_options_for_select ></p>
App 7470 stderr: 26: <
end >
App 7470 stderr: 27: <
if Setting.openid? >
App 7470 stderr: 28: <p><
= f.text_field :identity_url %></p>
App 7470 stderr: lib/redmine/i18n.rb:113:in `languages_options'
App 7470 stderr: app/helpers/application_helper.rb:1041:in `lang_options_for_select'
App 7470 stderr: app/views/my/account.html.erb:25:in `block in app_views_my_account_html_erb_2315655229762656785_33446580'
App 7470 stderr: app/helpers/application_helper.rb:1051:in `labelled_form_for'
App 7470 stderr: app/views/my/account.html.erb:14:in `_app_views_my_account_html_erb__2315655229762656785_33446580'
App 7470 stderr: lib/redmine/sudo_mode.rb:63:in `sudo_mode'

After I saw the "Permission denied" message I reviewed the permissions and everything was fine. Even in one step I gave 777 to all Redmine directory to see what happens but not worked.

After I spent hours, I found a website which has a some extra information about the Remine installation to Centos 7:

  1. Enable the serving of files off Apache
    sudo chcon -R -t httpd_sys_content_t /var/www/redmine
  1. Allow httpd to write only to specific folders
    sudo chcon -R -t httpd_sys_rw_content_t /var/www/redmine/log
    sudo chcon -R -t httpd_sys_rw_content_t /var/www/redmine/tmp/cache
    sudo chcon -R -t httpd_sys_rw_content_t /var/www/redmine/files

I applied the these lines besides the proper permissions then my problem solved. Now I am able open my account page in Redmine.