1

i've installed a phusion-passenger website in Apache2, the site sits at 192.168.0.50 in my network.

here it is the VirtualHost element

<VirtualHost *:80>
        ServerName my_web_host

        DocumentRoot /var/www/redmine
        ServerAdmin user@server.com
        LogLevel debug
        ErrorLog /var/log/apache2/redmine_error
        CustomLog /var/log/apache2/redmine_access combined

        <Directory /var/www/redmine>
        RailsBaseURI /redmine
        PassengerResolveSymlinksInDocumentRoot on
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
        </Directory>
    </VirtualHost>

now, this is how i have suceeded accessing it so far:

  • to be able to access the site from another machine in the LAN** i need to add my_web_host to my /etc/hosts file and access it from a browser with http://my_web_host

things that annoys me and want to change are that

  • if i access the machine directly with http://192.168.0.50/ i see a generic message from Apache telling me that 'it works', but i would like it to redirect me to the redmine site if possible

  • totally unacceptable is the fact that if i access the machine with http://192.168.0.50/redmine i get to see all the files and folders that actually sit at /var/www/website (which is actually a symbolic link to the redmine public installation folder)

** this is meant as a LAN only website so i really don't care about WAN access,but if you feel like educating me on how to fix this when the website is also accessed over public internet, please by all means, feel free to do so

lurscher
  • 172
  • 1
  • 3
  • 17

2 Answers2

1

You can set the passenger options for your default document root (should be in /etc/apache2/sites-available/default , depending on your OS) or bind your virtual host to the IP address:

<VirtualHost 192.168.0.50:80>
freddy K.
  • 165
  • 1
  • 6
  • will this also avoid showing up the contents of the web folder? what if i access the website using the hostname? will still show up? – lurscher Jun 10 '11 at 18:39
  • No, the content won't show up anymore, and yes, the hostname will still be valid. – freddy K. Jun 10 '11 at 19:25
0

Is there a reason you are using name-based virtual hosting? From your description it seems this is your only site being hosted on the server. If this is correct, get the name based virtual hosting out of the equation.

Is there a reason you have to have the website files in /var/www/redmine instead of in the regular apache web folder? If not, put the files in the normal, place (/var/www/html on Redhat systems).

I'm a firm believer in keeping things as simple as possible, and it seems you are adding needless complexity to your setup.

Bart.

Bart B
  • 3,457
  • 6
  • 31
  • 42
  • the reason i'm using it in this way is that i simply don't know better; i've dragged through couple of guides for redmine setup and i've beated it repeatedly into compliance – lurscher Jun 10 '11 at 13:09