I have just installed Redmine(2.5.2) on Ubuntu 14.04.
I am using Apache2+Passenger
The site works fine but it does not load css files like the following screenshot.
When I inspect, this is what I get.
My VirtualHost is shown below.
ServerAdmin admin#example.com
ServerName redmine.example.com
DocumentRoot /usr/local/redmine/public
RailsEnv production
RailsBaseURI / <Directory /usr/local/redmine/public>
Options Indexes FollowSymLinks
AllowOverride All </Directory>
ErrorLog ${APACHE_LOG_DIR}/redmine.example.com-error.log </VirtualHost>
Does anyone have a suggestion on how to fix this problem?
Than you!!!
Update
This is apache error log
[Mon Sep 22 09:00:58.736635 2014] [authz_core:error] [pid 20338] [client 175.130.114.60:56351] AH01630: client denied by server configuration: /usr/local/redmine/public/stylesheets/application.css
I don't see any error in redmine/log/production.log
I found the solution to this.
I got an answer from this SO article
The issue lied with my VirtualHost configuratoin
I added the following line
Require all granted
Related
On my my VPS with cpanel (CentOs) I have two rails projects on different virtual hosts served by Passenger.
The second project is a branch of first, so now they are equal.
Directories of them are:
/home/web/public_html/msystem
/home/web/public_html/msystem2
Settings in httpd.conf:
<VirtualHost My.host.IP.adress:80>
ServerName msystem.mydomain.com
ServerAlias www.msystem.mydomain.com
DocumentRoot /home/web/public_html/msystem
CustomLog /usr/local/apache/domlogs/msystem.mydomain.com combined
CustomLog /usr/local/apache/domlogs/msystem.mydomain.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
ScriptAlias /cgi-bin/ /home/web/public_html/msystem/cgi-bin/
Include "/usr/local/apache/conf/userdata/std/2_2/web/msystem.mydomain.com/*.conf"
</VirtualHost>
/usr/local/apache/conf/userdata/std/2_2/web/msystem.mydomain.com/msystem.conf:
DocumentRoot /home/web/public_html/msystem/public/
<Directory /home/web/public_html/msystem/public/>
AllowOverride all
Options -MultiViews
</Directory>
I removed all standard cpanel lines. The second VirtualHost is the same, except replacing msystem -> msystem2.
The first project works, the second no.
There is a Delayed Job in project. And in both projects I set my logger in initializers/delayed_job.rb:
Delayed::Worker.logger = Logger.new(Rails.root.join('log', 'dj.log'))
The second project raises with error:
Permission denied # rb_sysopen - /home/web/public_html/msystem2/log/dj.log (Errno::EACCES)
This dj.log in both projects has equal permissions:
# ls -l msystem/log/dj.log
-rw-r--r-- 1 nobody nobody 10604043 Aug 7 12:34 msystem/log/dj.log
# ls -l msystem2/log/dj.log
-rw-r--r-- 1 nobody nobody 66 Aug 8 09:25 msystem2/log/dj.log
Passenger on error page says that he runs by nobody:nobody user.
User and groups
uid=99(nobody) gid=99(nobody) groups=99(nobody)
I read many topics on stackoverflow.com about this error. I tryed to change owner to root or permissions to 777. Tryed to restart Apache, Passenger.
First works, second not. What is it? May be I forgot something?
This question has an answer:
Ruby on Rails: permission denied when using "rails generate controller welcome"
chmod 1644 msystem2/log
I just installed redmine and I would like to reach it from redmine.domain.com instead of domain.com/redmine.
I first tried to do this by myself with my few Apache knowledge but I got the following error:
So I looked for a support on the internet and found this page. I consequently adapted my Apache configuration file:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName redmine.mydomain.com
ServerAdmin admin#mydomain.com
DocumentRoot /var/www/redmine
<Directory /var/www/redmine>
Allow from all
Options -MultiViews
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined
SSLEngine on
SSLCertificateFile /etc/ssl/private/redmine.mydomain.com.crt
SSLCertificateKeyFile /etc/ssl/private/redmine.mydomain.com.key
</VirtualHost>
</IfModule>
And made some check ups, all seems good. However, when I go to my redmine.mydomain.com I see the hierarchy of /usr/share/redmine/public.
To cite from the page you linked to:
The virtual host’s document root must point to your Rack application’s public folder.
Thus, you have to configure Apache's DocumentRoot to point to /var/www/redmine/public.
In an attempt to serve my precompiled assets with Apache, per this Rails Guide I try to change this:
<VirtualHost *:82>
ServerName localhost
DocumentRoot "C:/RubyStack-3.2.5-0/projects/release_checklist/public"
<Directory "C:/RubyStack-3.2.5-0/projects/release_checklist/public">
Allow from all
Options -MultiViews
</Directory>
ProxyPass / http://localhost:3001/
ProxyPassReverse / http://localhost:3001/
ProxyPreserveHost On
</VirtualHost>
To this:
<VirtualHost *:82>
ServerName localhost
DocumentRoot "C:/RubyStack-3.2.5-0/projects/release_checklist/public"
<Directory "C:/RubyStack-3.2.5-0/projects/release_checklist/public">
Allow from all
Options -MultiViews
</Directory>
ProxyPass / http://localhost:3001/
ProxyPassReverse / http://localhost:3001/
ProxyPreserveHost On
<LocationMatch "^/assets/.*$">
Header unset ETag
FileETag None
# RFC says only cache for 1 year
ExpiresActive On
ExpiresDefault "access plus 1 year"
</LocationMatch>
</VirtualHost>
in my httpd.conf file. However, the Apache server won't start when the second option has been added. What am I doing wrong?
What error does it give you? Are you sure you have mod_expires compiled into apache and that the module is loaded?
Invalid command 'ExpiresActive', perhaps misspelled or defined by a module not included in the server configuration
Yeah, that's usually the error you get if you use a directive that's mapped to a module that isn't loaded (or just a mispelled directive, which appears the same to apache). You'll need to check httpd.conf and make sure the LoadModule expires_module modules/mod_expires.so line is not commented out, of if it's missing, to add it. Depending on your apache's version, the line can be slightly different.
Everything works on the Ror's own server (Webrick), but when I tried out on Apache(+Passenger mod) I got always 404 (not found) error.
You can check this here: http://keidan.hopto.org/rails/phoenix/public/guild.
I think the main problem is that I can't access the app's public folder...
My vhost file:
ServerName keidan.hopto.org
ServerAlias keidan.hopto.org
DocumentRoot /var/www/
RackBaseURI /rails/phoenix/public
<Directory /var/www/rails/phoenix/public >
AllowOverride all
Options Indexes FollowSymLinks -MultiViews
Order allow,deny
Allow from all
</Directory>
...
How do you set up apache to show the rails app once it is on the server? My rails app works perfectly on the localhost, but when I go to the external site it gives me the index information
like this
Name Last modified Size Description
[TXT] 404.html 21-May-2012 21:38 728
[TXT] 422.html 21-May-2012 21:38 711
[TXT] 500.html 21-May-2012 21:38 643
[IMG] favicon.ico 21-May-2012 21:38 0
[TXT] robots.txt 21-May-2012 21:38 204
This is my virtual host information
<VirtualHost *:80>
ServerAdmin example#example.com
ServerName server.example.com
# ServerAlias
DocumentRoot /var/www/sample_app/current/public
ErrorLog /var/www/sample_app/error.log
RailsEnv production
<Directory "/var/www/sample_app/current/public">
Options Indexes FollowSymLinks MultiViews
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
OK that might not be it, but here's what Passenger's documentation recommends:
<VirtualHost *:80>
ServerName www.mycook.com
DocumentRoot /webapps/mycook/public
<Directory /webapps/mycook/public>
Allow from all
Options -MultiViews
</Directory>
</VirtualHost>
It's clearly stated that MultiViews is not compatible with Passenger.
So you could try:
Removing the Indexes option
Specifying -MultiViews instead of MultiViews
To be honest, I've tried adding Indexes to a production app of mine, as I thought that might just be this option that caused the problem, but it didn't change anything... so it's a bit of a "wild guess" that it might fix things on your side.
UPDATE
From another answer, what you could try is adding the PassengerResolveSymlinksInDocumentRoot option:
<VirtualHost *:80>
ServerName www.mycook.com
DocumentRoot /webapps/mycook/public
<Directory /webapps/mycook/public>
Allow from all
Options -MultiViews
PassengerResolveSymlinksInDocumentRoot on
</Directory>
</VirtualHost>