Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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>
share|improve this answer
    
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

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.

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.