Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm on Ubuntu 9.10. My web application is in a directory on my /home/me/app . I want to configure Apache in such a way that I can access my app through a directory. For example:

People can access my machine through domain.com. What I would like to do is access my web application (located at /home/me/app) through a directory, using something like: domain.com/myapp.

How can I set up the Apache configuration for this kind of behavior? Of course, I do not want to move all my application to /var/www/myapp.

The Alias directive did not solve my problem. If try to enter something like mydomain.com/recommender/somedir. It won't find anything. Because the alias only covers the /recommender path

What I would like, is something like a VirtualHost, but instead of pointing to a ServerName, I want to point it to a directory name.

share|improve this question
    
See this page for more details about Alias: httpd.apache.org/docs/2.0/mod/mod_alias.html#Alias For me, adding the Alias line was enough to allow access to subdirectories. –  Brian Apr 27 '10 at 21:10
add comment

1 Answer

There are a couple of ways you could do it:

  1. Create a symbolic link to /home/me/app in /var/www

    ln -s /home/me/app /var/www/myapp

  2. Use the Alias directive in /etc/apache2/httpd.conf

    Alias /myapp /home/me/app

share|improve this answer
add comment

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.