incorrect redmine installation - apache

I am trying to install redmine 3.2.0 like in the following article.
The point 2.4 Test Redmine works fine, i.e. I am able to open redmine using http://MY_IP:3000.
After this, I did:
sudo chown -R www-data files log tmp public/plugin_assets
sudo chmod -R 755 files log tmp public/plugin_assets
sudo ln -s /opt/redmine/redmine-3.2.2/public/ /var/www/html/redmine
Added Listen 89 into /etc/apache2/ports.conf.
Created the following sudo vim /etc/apache2/sites-available/redmine.conf:
<VirtualHost MY_IP:89>
ServerAdmin email#example
DocumentRoot /var/www/html/
<Location /redmine>
RailsEnv production
RackBaseURI /redmine
Options -MultiViews
</Location>
</VirtualHost>
Enabled redmine.conf: sudo a2ensite redmine.conf.
Added PassengerUser www-data into /etc/apache2/mods-available/passenger.conf. Now passenger.conf contains the following:
<IfModule mod_passenger.c>
PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
PassengerDefaultRuby /usr/bin/ruby
PassengerUser www-data
</IfModule>
And restarted apache: sudo service apache2 restart.
So /var/www/html/ contains:
drwxr-xr-x 2 root root 4096 Jan 25 09:32 .
drwxr-x--x 7 root root 4096 Jan 22 07:21 ..
-rw-r--r-- 1 root root 11104 Jan 22 02:57 index.html
lrwxrwxrwx 1 root root 34 Jan 25 09:32 redmine -> /opt/redmine/redmine-3.2.0/public/
Now if I am going to http://MY_IP:89 then /var/www/html/index.html is opened instead of redmine home page.
Could you please advise where I did an error?
Thanks in advance!
UPDATE:
If I use the following redmine.conf:
<VirtualHost MY_IP:89>
DocumentRoot /var/www/html/redmine
<Directory /var/www/html/redmine>
RailsBaseURI /
PassengerResolveSymlinksInDocumentRoot on
AllowOverride None
RailsEnv production
Options -MultiViews
</Directory>
</VirtualHost>
Redmine won't start, only shows index of (/var/www/html/redmine/).

I SOLVED THE ISSUE:
I did gem install passenger. And I use the following redmine.conf:
<VirtualHost MY_IP:89>
DocumentRoot /var/www/html/redmine
<Directory /var/www/html/redmine>
RailsBaseURI /
PassengerResolveSymlinksInDocumentRoot on
AllowOverride None
RailsEnv production
Options -MultiViews
</Directory>
</VirtualHost>

From passenger 5.2.0 which was released in January 2018 "PassengerResolveSymlinksInDocumentRoot on" is no longer supported
in your /etc/apache2/sites-available/xxx.conf
make the following changes:
# Not supported from passenger 5.2.0 on wards
# PassengerResolveSymlinksInDocumentRoot on
PassengerAppRoot /opt/redmine/redmine-3.2.0/public/

My redmine works on apache with this config.
LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.21/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.21
PassengerDefaultRuby /usr/local/rvm/gems/ruby-1.9.3-p551/wrappers/ruby
</IfModule>
<VirtualHost redmine.domain:80>
ServerName redmine.domain
ServerAlias redmine
DocumentRoot /opt/redmine/redmine-3.2.0/public/
<Directory /opt/redmine/redmine-3.2.0/public/>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
allow from all
</Directory>

Related

Apache2 Virtual Host fails with Name or service not known

Moving from Ubuntu 17.10 to Mint 18.3 and migrating virtual host config files fails with
[core:error] [pid 3012] (EAI 2)Name or service not known: AH00547: Could not resolve host name
On my fresh installed Mint i have done this first
1) sudo a2dissite 000-default.conf
This is my standard Config File using for Vhosts
<VirtualHost *.domain.localhost:80>
ServerName domain.localhost
ServerAlias www.domain.localhost api.domain.localhost
ServerAdmin webmaster#localhost
DocumentRoot /home/dev/projects/domain/web/html/
<Directory /home/dev/projects/domain/web/html/>
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature Off
</VirtualHost>
BTW: This steps i'm doing for every project
1) sudo chown -R www-data:www-data PATH_TO_DIR
2) sudo chmod 660 -R PATH_TO_DIR
3) sudo chmod -R -x+X PATH_TO_DIR
4) sudo find PATH_TO_DIR -type d -exec chmod g+s {} \;
5) sudo setfacl -R -d -m u::rwX,g::rwX,o::- PATH_TO_DIR
UPDATE:
adding domains to /etc/hosts, reloading server leads again to the default
I have solved it by modifying "000-default.conf" DocumentRoot Path, then modifying "/etc/apache2/apache2.conf" by adding these lines
<Directory /home/mdev/_projects/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Also this had to be changed from
<VirtualHost *.domain.localhost:80>
to
<VirtualHost *:80>
No entries at /etc/hosts neccassary!

Apache virtualhost with debian 8

I would like to configure an apache virtualhost with Debian 8
I have installed apache2
I have create a configuration in sites-available
<VirtualHost *:80>
ServerName wiki.domain.com
ServerAlias wiki.domain.com
DocumentRoot /home/www/htdocs/wiki/
<Directory /home/www/htdocs/wiki/>
Options -Indexes FollowSymLinks
AllowOverride All
</Directory>
ErrorLog /home/www/logs/wiki/wiki_error.log
LogLevel warn
CustomLog /home/www/logs/wiki/wiki_access.log combined
ServerSignature Off
</VirtualHost>
Create a symbolic link in sites-enabled
ln -s /etc/apache2/sites-available/wiki /etc/apache2/sites-enabled/wiki
And reboot apache
/etc/init.d/apache2 restart
This configuration works with Debian 7 but with Debian 8 i am not redirected to my wiki directory when I use my domain wiki.domain.com
Add Require all granted in the directory to allow apache to access to your directory
Here is an easiest and recommanded way to enable a site with apache2:
a2ensite wiki && service apache2 restart

403 Forbidden Error setting up Virtual Hosts

I've run into this problem on other servers before, but this time I can't figure it out. I've tried looking at all the solutions on Stack Overflow, but no luck so far.
The Error: domain1 works just fine, but trying to access the index on domain2 fails.
Forbidden
You don't have permission to access /index.html on this server.
My httpd.conf
Note: domain1 is a symfony site, so the web root is /web, where as domain2 is just a static html site.
LoadModule vhost_alias_module modules/mod_vhost_alias.so
DocumentRoot "/var/www/html/domain1.com/web"
<Directory "/var/www/html/domain1.com/web">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin jason#domain2.com
DocumentRoot /var/www/html/domain2.com
ServerName domain2.com
ErrorLog logs/domain2.com-error_log
CustomLog logs/domain2.com-access_log common
</VirtualHost>
<Directory "/var/www/html/domain2.com">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride None
Allow from all
</Directory>
ls -l in /var/www/html
drwxr-xr-x 2 apache apache 4096 Jan 12 17:06 domain2.com
drwxr-xr-x 8 apache apache 4096 Jan 12 15:58 domain1.com
Other
I've already tried disabling selinux with "setenforce 0"
I've made sure to restart apache each time after changing httpd.conf by running "service httpd restart"
I've rebooted the server itself
Apache Version: 2.2.15
CentOS Version: 6.5

Enable multiple webroot for apache2 on Ubuntu

I'm using apache2 on my ubuntu 13.10 machine, I have added another config file named paul under /etc/apache2/sites-available directory to make my file under /home/paul/public_html/ accessible on internet:
root#localhost:/etc/apache2/sites-available# ls -ltr
-rw-r--r-- 1 root root 950 Feb 7 2012 default
-rw-r--r-- 1 root root 978 Jun 23 10:54 paul
After than changes, my files under /var/www is not accessible on URL anymore, unless I change DocumentRoot from /home/paul/public_html to /var/www , but that would disable accessibility for /home/paul/public_html/
/etc/apache2/sites-available/paul :
DocumentRoot /home/paul/public_html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
Is there any way of configuration to enable /var/www and /home/paul/pubilc_html as webroot at the same time? Is it required any setting on /etc/apache2/apache2.conf ? Any ideas would be appreciated, thanks.
You can accomplish this easily with an alias directive. In /etc/apache2/sites-available/default just add an Alias for the URL.
<VirtualHost *:80>
ServerName www.example.com
ServerAdmin webmaster#localhost
DocumentRoot /var/www/
Alias /paul /home/paul/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Now the contents of /home/paul/public_html should be available at www.example.com/paul

Need help setting up passenger with apache

I'm trying to setup passenger with apache on Fedora 14. The install went ok but I'm unable to configure apache correctly.
I made these changes to the file. I cannot start apache unless I comment out the virtual host portion.
LoadModule passenger_module
/usr/lib/ruby/gems/1.8/gems/passenger-3.0.7/ext/apache2/mod_passenger.so
PassengerRoot
/usr/lib/ruby/gems/1.8/gems/passenger-3.0.7
PassengerRuby /usr/bin/ruby
<VirtualHost *:80>
ServerName localhost
DocumentRoot /home/antarr/pull/public
<Directory /home/antarr/pull/public>
AllowOverride all
Options -MultiViews
</Directory>
</VirtualHost>
You also need the following two lines in your apache2.conf or in a conditionally loaded, module specific conf file:
PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7
PassengerRuby /usr/local/bin/ruby
Instead of modifying httpd-vhosts.conf override DocumentRoot in your httpd.conf
# Override default DocumentRoot with you root
DocumentRoot "/home/antarr/pull/public"
<Directory "/home/antarr/pull/public">
Allow from all
Options -MultiViews
Require all granted
</Directory>
Before restarting server make sure your conf change is reflected
apachectl -S
The Document root should point to your root folder. And restart apache.