Forums » Help »
I’m having trouble accessing Redmine 2.4.3 under CentOS Apache 2.2.15
I followed the instructions on http://www.redmine.org/projects/redmine/wiki/RedmineInstall and http://www.redmine.org/projects/redmine/wiki/Redmine_on_CentOS_installation_HOWTO#Rename-dispatch-CGI-files-in-redminepublic
I got redmine running on webrick, but when I followed the steps for setting up Apache I only get 403 Forbidden errors. I’ve tried installing mod_fcgid but haven’t had any luck with that either.
Here is my bundle install
[webadmin@server redmine-2.4.3]$ bundle install --without development test Using rake (10.1.1) Using i18n (0.6.9) Using multi_json (1.8.4) Using activesupport (3.2.16) Using builder (3.0.0) Using activemodel (3.2.16) Using erubis (2.7.0) Using journey (1.0.4) Using rack (1.4.5) Using rack-cache (1.2) Using rack-test (0.6.2) Using hike (1.2.3) Using tilt (1.4.1) Using sprockets (2.2.2) Using actionpack (3.2.16) Using mime-types (1.25.1) Using polyglot (0.3.3) Using treetop (1.4.15) Using mail (2.5.4) Using actionmailer (3.2.16) Using arel (3.0.3) Using tzinfo (0.3.38) Using activerecord (3.2.16) Using activeresource (3.2.16) Using coderay (1.1.0) Using fastercsv (1.5.5) Using rack-ssl (1.3.3) Using json (1.8.1) Using rdoc (3.12.2) Using thor (0.18.1) Using railties (3.2.16) Using jquery-rails (2.0.3) Using mysql2 (0.3.15) Using net-ldap (0.3.1) Using ruby-openid (2.3.0) Using rack-openid (1.4.2) Using bundler (1.5.3) Using rails (3.2.16) Using rmagick (2.13.2) Your bundle is complete! Gems in the groups development and test were not installed. Use `bundle show [gemname]` to see where a bundled gem is installed.
And my script/about
:
[webadmin@server redmine-2.4.3]$ script/about sh: svn: command not found sh: darcs: command not found sh: bzr: command not found Environment: Redmine version 2.4.3.stable Ruby version 1.8.7-p352 (2011-06-30) [x86_64-linux] Rails version 3.2.16 Environment production Database adapter Mysql2 SCM: Mercurial 2.2.2 Git 1.8.4.4 Filesystem Redmine plugins: no plugin installed
(NOTE: When I had Redmine running w/ webrick I turned off all non-HG repositories, hence hte above 3 errors)
and the VirtualHost portion of my httpd.conf
:
# Redmine (IST) Listen 3000 <VirtualHost *:80> ServerName it.domain.com ServerAdmin support@domain.com DocumentRoot /home/webadmin/redmine-2.4.3/public ErrorLog logs/redmine_error_log #If you are using mod_fcgid and are going to upload files larger than #131072 bytes you should consider adding the following line #that allows to upload files up to 20 mb MaxRequestLen 20971520 <Directory "/home/webadmin/redmine-2.4.3/public"> Options Indexes ExecCGI FollowSymLinks -MultiViews Order allow,deny Allow from all AllowOverride all </Directory> </VirtualHost>
My Apache error log shows:
[Mon Feb 10 16:44:13 2014] [error] [client 10.1.1.55] (13)Permission denied: access to /favicon.ico denied [Mon Feb 10 16:44:13 2014] [error] [client 10.1.1.55] (13)Permission denied: access to / denied
I am not a Ruby dev so I know almost nothing about this ecosystem. Any help would be appreciated.
Thanks!
I was working on installing and running Redmine on the Ubuntu server. I’m trying to run Redmine on Apache, so I went to the etc/apache2/sites-available
and created a file called sites.conf
.
<VirtualHost *:80>
ServerName redmine.mypage.com
DocumentRoot /var/www/redmine/public
<Directory /var/www/redmine/public>
DirectoryIndex index.html index.htm
Require all granted
</Directory>
ErrorLog /var/log/apache2/localhost-error_log
CustomLog /var/log/apache2/localhost-access_log common
</VirtualHost>
And then I linked the file to the sites-enabled
folder to make the Apache server recognize the configuration.
But still I get failed to access the domain, as it keeps saying 403 Forbidden - You don't have permission to access / on this server.
I checked out the log, and I believe this is the point that keeps causing the error to connect to the website.
[Tue Jul 04 17:56:37.825217 2017] [autoindex:error] [pid 4815] [client 192.168.5.6:51457] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
Выполняя просьбу alexander barakin, размещаю ответ на свой же вопрос.
Основная проблема как я выяснил оказалась связана с тем, что в одном из nginx конфиге для поддомена redmine я указал путь к дирктории redmine, в то время как необходимо было сформировать лишь проксирующий узел для скидывания запроса на виртуальный хост апача, с изменением порта обращения. Иными словами, запрос приходит на NGinx по 80 порту и поддомену, он разруливает по имени поддомена какой конфиг тягать, перекидывает запрос на виртуальный хост апача по 3000 порту. Важно: апач должен слушать этот порт. У меня выбран 3000 не набум, а из-за ruby машины, ну или pаssenger’a (точно не помню, но 1 из 2).
Таким обпразом привожу конфиги , которых более чем достаточно для проксирования через NGinx:
Конфиг NGinx:
server {
listen 80;
server_name redmine.example.com;
access_log /var/log/nginx/redmine.access.log;
error_log /var/log/nginx/redmine.error.log;
location / {
proxy_pass http://127.0.0.1:3000/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
И конфиг виртуального хоста на апаче:
<VirtualHost *:3000>
ServerName example.com
ServerAdmin webmaster@example.com
DocumentRoot /var/www/redmine/public
ErrorLog logs/redmine_error_log
RailsEnv development
RailsBaseURI /
<Directory "/var/www/redmine/public/">
Options Indexes ExecCGI FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Но нужно понимать, что у меня по 3000 порту обращение идет только к Redmine. В ином случае конфиг апача нужно писать чутка иначе, т.е. имя вирт хоста более точно, а не *:3000 — что значит все обращения по порту 3000.
Проблема моя возникла из-за прав на чтение конфигов, ну и конечно не правильно настроенные конфиги nginx. Последнему необходимо лишь отпроксировать запрос.
Вот собственно и все) Кому поможет ставте лайки или просто оповестите меня, будет приятно))
Rhel 6 + Nginx + Apache + Redmine 2.6 => 403 ошибка
Если вы столкнулись с ошибкой 403 Forbidden после установки Rhel 6 с Nginx и Apache, и пытаетесь настроить Redmine 2.6 на вашем сервере, вы не одиноки. Эта ошибка может иметь несколько причин, и в этой статье мы рассмотрим некоторые из наиболее распространенных сценариев, а также способы решения проблемы.
Первым шагом при настройке Rhel 6 с Nginx и Apache под Redmine 2.6 является установка необходимых компонентов. Убедитесь, что у вас установлены все необходимые зависимости.
# yum -y update # yum -y install epel-release yum-utils # yum -y install nginx # yum -y install httpd # yum -y install php php-mysql php-pdo php-gd php-mbstring php-dom mysql mysql-server
После установки необходимых пакетов необходимо настроить Nginx и Apache для работы с Redmine. Допустим, что у вас уже настроены виртуальные хосты для каждого службы. Давайте рассмотрим основной конфигурационный файл для Nginx:
# vim /etc/nginx/nginx.conf
http { server { listen 80; server_name example.com; root /var/www/html; } }
В этом примере мы слушаем на порту 80 и используем общий корневой каталог /var/www/html для всех виртуальных хостов.
Далее, вам нужно создать конфигурационный файл для виртуального хоста Redmine:
# vim /etc/nginx/conf.d/redmine.conf
server { listen 80; server_name redmine.example.com; root /opt/redmine-2.6/public; passenger_enabled on; passenger_ruby /usr/bin/ruby; location / { proxy_pass http://127.0.0.1:3000; } }
В этом примере мы настраиваем виртуальный хост для Redmine на порту 80, используя каталог /opt/redmine-2.6/public в качестве корневого. Мы также включаем модуль Passenger для обработки приложения Ruby on Rails и настраиваем прокси-перенаправление на порт 3000, где запущен Redmine.
Теперь перейдем к настройке Apache. Вам нужно создать конфигурационный файл для виртуального хоста Redmine:
# vim /etc/httpd/conf.d/redmine.conf
<VirtualHost *:80> ServerName redmine.example.com DocumentRoot /opt/redmine-2.6/public PassengerRuby /usr/bin/ruby <Directory /opt/redmine-2.6/public> Options FollowSymLinks AllowOverride None Require all granted </Directory> </VirtualHost>
Здесь мы указываем, что наше приложение Redmine находится в каталоге /opt/redmine-2.6/public, устанавливаем PassengerRuby для обработки приложения Ruby on Rails и разрешаем полный доступ к этому каталогу.
После настройки Nginx и Apache вам нужно создать базу данных для Redmine. Сначала войдите в MySQL:
# mysql -u root -p
Затем создайте базу данных, пользователя и назначьте привилегии:
mysql> CREATE DATABASE redmine character set utf8; mysql> CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'password'; mysql> GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost'; mysql> FLUSH PRIVILEGES; mysql> EXIT;
Теперь вам нужно настроить файл конфигурации Redmine, чтобы он использовал базу данных:
# cp /opt/redmine-2.6/config/database.yml.example /opt/redmine-2.6/config/database.yml # vim /opt/redmine-2.6/config/database.yml
production: adapter: mysql2 database: redmine host: localhost username: redmine password: password
После настройки базы данных вы можете выполнить несколько дополнительных команд, чтобы подготовить вашу установку Redmine:
# gem install bundler # cd /opt/redmine-2.6/ # bundle install --without development test # REDMINE_LANG=en bundle exec rake generate_secret_token # RAILS_ENV=production bundle exec rake db:migrate # RAILS_ENV=production bundle exec rake redmine:load_default_data
Теперь у вас должна быть установлена и настроена последняя версия Redmine.
Если вы все сделали правильно и следовали этим инструкциям, и все равно получаете ошибку 403 Forbidden при доступе к Redmine через браузер, возможно, у вас есть проблемы с SELinux. SELinux может блокировать доступ к файлам и каталогам, что приведет к 403 ошибке.
Вам можно проверить настройки SELinux, выполнив следующую команду:
# getenforce
Если результат команды показывает «Enforcing», это означает, что SELinux включен и удаленный доступ отключен. В этом случае вы можете отключить SELinux, выполнив следующую команду:
# setenforce 0
Однако, это временное решение, и при перезагрузке сервера SELinux будет включен снова. Чтобы отключить SELinux на постоянной основе, откройте файл конфигурации SELinux:
# vim /etc/selinux/config
Затем измените значение `SELINUX=enforcing` на `SELINUX=disabled`.
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of these three values: # targeted - Targeted processes are protected. # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted
Сохраните файл и перезагрузите сервер.
Если после выполнения всех этих шагов у вас все еще есть проблема с 403 ошибкой, вам, возможно, стоит включить дополнительное журналирование для Nginx и Apache, чтобы определить, какие конкретные действия вызывают эту ошибку. Для Nginx вы можете добавить следующие строки в файл конфигурации:
# vim /etc/nginx/nginx.conf
http { log_format detailed '$remote_addr - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent"'; server { listen 80; server_name example.com; root /var/www/html; access_log /var/log/nginx/access.log detailed; # add this line } }
Для Apache вы можете добавить эти строки в файл конфигурации:
# vim /etc/httpd/conf/httpd.conf
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent <VirtualHost *:80> ServerName redmine.example.com DocumentRoot /opt/redmine-2.6/public PassengerRuby /usr/bin/ruby <Directory /opt/redmine-2.6/public> Options FollowSymLinks AllowOverride None Require all granted CustomLog /var/log/httpd/access.log combined # add this line ErrorLog /var/log/httpd/error.log # add this line </Directory> </VirtualHost>
Сохраните файл и перезапустите Nginx и Apache:
# service nginx restart # service httpd restart
После этого вы можете проверить журналы доступа Nginx и Apache, чтобы увидеть более подробную информацию об ошибках и специфических действиях, вызывающих проблему.
Надеюсь, что эта статья помогла вам решить проблему с 403 ошибкой при настройке Rhel 6 с Nginx, Apache и Redmine 2.6. Не забывайте, что ваши конфигурации могут отличаться и требовать дополнительных настроек. Если у вас все еще есть проблемы, не стесняйтесь обратиться за помощью к сообществу Redmine или поставщику услуг поддержки. Удачи вам с вашим проектом Redmine!
I have a Redmine v4 instance running on Centos 7 with Nginx as the webserver. It was functioning perfectly fine for months, but then suddenly lost the ability to use its css. It still functions fine, but the pages are just plain text now. When I access the Console on Chrome I can see the following list of errors…
(index):13 GET http://redmine/stylesheets/jquery/jquery-ui-1.11.0.css?1586192448 net::ERR_ABORTED 403 (Forbidden)
(index):14 GET http://redmine/stylesheets/tribute-3.7.3.css?1586192449 net::ERR_ABORTED 403 (Forbidden)
(index):15 GET http://redmine/stylesheets/application.css?1586192449 net::ERR_ABORTED 403 (Forbidden)
(index):16 GET http://redmine/stylesheets/responsive.css?1586192449 net::ERR_ABORTED 403 (Forbidden)
(index):18 GET http://redmine/javascripts/jquery-2.2.4-ui-1.11.0-ujs-5.2.3.js?1586192448 net::ERR_ABORTED 403 (Forbidden)
(index):19 GET http://redmine/javascripts/tribute-3.7.3.min.js?1586192448 net::ERR_ABORTED 403 (Forbidden)
(index):20 GET http://redmine/javascripts/application.js?1586192449 net::ERR_ABORTED 403 (Forbidden)
(index):21 GET http://redmine/javascripts/responsive.js?1586192449 net::ERR_ABORTED 403 (Forbidden)
(index):24 Uncaught ReferenceError: $ is not defined
at (index):24
favicon.ico:1 GET http://redmine/favicon.ico?1586192449 403 (Forbidden)
When I check for the source of the Uncaught ReferenceError it is the same section on every page.
<script>
//<![CDATA[
$(window).on('load', function(){ warnLeavingUnsaved('The current page contains unsaved text that will be lost if you leave this page.'); });
//]]>
</script>
This CDATA section is preceded by the lines producing the 403 Forbidden errors on css files.
<link rel="stylesheet" media="all" href="/stylesheets/jquery/jquery-ui-1.11.0.css?1586192448" />
<link rel="stylesheet" media="all" href="/stylesheets/tribute-3.7.3.css?1586192449" />
<link rel="stylesheet" media="all" href="/stylesheets/application.css?1586192449" />
<link rel="stylesheet" media="all" href="/stylesheets/responsive.css?1586192449" />
<script src="/javascripts/jquery-2.2.4-ui-1.11.0-ujs-5.2.3.js?1586192448"></script>
<script src="/javascripts/tribute-3.7.3.min.js?1586192448"></script>
<script src="/javascripts/application.js?1586192449"></script>
<script src="/javascripts/responsive.js?1586192449"></script>
<script>
//<![CDATA[
$(window).on('load', function(){ warnLeavingUnsaved('The current page contains unsaved text that will be lost if you leave this page.'); });
//]]>
</script>
I checked the permissions on the directories it seems to be pointing to but found no issues. I have also tried installing a fresh new instance of Redmine on a new VM running Centos and migrating the files and database, but the issue persists. Any advice on where to look next for debugging would be much appreciated.