Find the answer to your Linux question:
Results 1 to 10 of 10
I can't seem to access my ROOT folder when I link to a file in it from one in var/ w ww. if (my ip):80 links to va r / ...
  1. #1
    Just Joined!
    Join Date
    Nov 2010
    Posts
    25

    Web Servers in Ubuntu

    I can't seem to access my ROOT folder when I link to a file in it from one in var/ w ww.

    if (my ip):80 links to va r / w ww, and jsp only works in tomcat / webapps /ROOT, and I have tomcat / webapps / ROOT installed in var / w ww, then I thought I would try to do something like this, to make my jsp work:

    I tried using this:

    Code:
    file:  / / / var / www/ tomcat/ webapps/ ROOT/ filename
    or
    Code:
    (my ip) : 80 / filename
    What am I doing wrong?

    Is there a way to simply redirect webapps / ROOT to var / www and put all of the files there?

    Similar/same problem with default-site directory in Apache2

  2. #2
    Just Joined! barriehie's Avatar
    Join Date
    Apr 2008
    Posts
    81
    Quote Originally Posted by EdCompSci View Post
    I can't seem to access my ROOT folder when I link to a file in it from one in var/ w ww.

    if (my ip):80 links to va r / w ww, and jsp only works in tomcat / webapps /ROOT, and I have tomcat / webapps / ROOT installed in var / w ww, then I thought I would try to do something like this, to make my jsp work:

    I tried using this:

    Code:
    file:  / / / var / www/ tomcat/ webapps/ ROOT/ filename
    or
    Code:
    (my ip) : 80 / filename
    What am I doing wrong?

    Is there a way to simply redirect webapps / ROOT to var / www and put all of the files there?

    Similar/same problem with default-site directory in Apache2
    Let's see if I understand this correctly. DocumentRoot is /var/www and the files you're trying to access are in /var/www/tomcat/webapps/ROOT/<SomeFileName>?

    If that's the case then:
    Code:
    ln -s /var/www/tomcat/webapps/ROOT/<SomeFileName> /var/www/

  3. #3
    Just Joined!
    Join Date
    Nov 2010
    Posts
    25

    That's great as a command line

    Thanks.


    Looks like I would have to do that in a shell script for every single file and every time I reboot. I'm looking more for maybe some kind of environment variable, like the way JAVA-HOME is set, so that every file in the folder is redirected.

  4. #4
    Linux User ptkobe's Avatar
    Join Date
    Feb 2008
    Location
    Torres Vedras, PT
    Posts
    274
    1- check if your web root is /var/www or /var/www/html

    2 -
    Quote Originally Posted by EdCompSci View Post
    Looks like I would have to do that in a shell script for every single file and every time I reboot.
    No. One time done, is done, and with ln -s you may soft link all dirrectories

    3-
    Quote Originally Posted by EdCompSci View Post
    I'm looking more for maybe some kind of environment variable, like the way JAVA-HOME is set, so that every file in the folder is redirected.
    Apache aliases may be what your are looking for.
    On /etc/apache2/apache2.conf (or on a file in /etc/apache2/conf.d/) you may set aliases

    Exp:
    Alias /mediawiki /var/lib/mediawiki

    Then http://your_host/mediawiki will show files on /var/lib/mediawiki

    Hope that helps
    Luis

  5. #5
    Just Joined!
    Join Date
    Nov 2010
    Posts
    25

    I will try aliases, thanks

    I found this link as well. I am sure it will be what I need. I would post it, but I haven't yet made 15 posts on this forum. The site is The Web Hosting Hero.

    As for answering if my website was in var/ www/ or var/ www/ html, I don't have an html folder in that location.
    Last edited by EdCompSci; 11-14-2010 at 10:11 PM. Reason: less than 15 posts and tried to post a url

  6. #6
    Linux User ptkobe's Avatar
    Join Date
    Feb 2008
    Location
    Torres Vedras, PT
    Posts
    274
    That's it, then

    If you are new to apache, you may take a look at
    $ cat /etc/apache2/sites-available/default
    and see why your DocumentRoot is /var/www.

    Also, if you install apache2-doc, you'll have the apache docs at http://your_host/manual - another alias, set in the file /etc/apache2/conf.d/apache2-doc.
    ...
    Alias /manual /usr/share/doc/apache2-doc/manual/

    Good luck
    Luis

  7. #7
    Just Joined!
    Join Date
    Nov 2010
    Posts
    25

    Thanks, that's helpful

    So then, with the default file in sites-avaailable, can I just change the path in there to my tomcat ROOT directory and put all of my files there?

  8. #8
    Linux User ptkobe's Avatar
    Join Date
    Feb 2008
    Location
    Torres Vedras, PT
    Posts
    274
    I never installed tomcat, so I'll say yes, I guess.

    I'll have to change
    DocumentRoot /var/www
    [...] and
    <Directory /var/www/>
    in the same manner

    reboot apache, and see if it works

    Note site-available and site-enable dirs are designed for multi site configuration, what apache call virtual hosts, as you may have already see.
    If you are just running one site, you don't need to do anything more, just use the default file.
    Any way, vhosts are enabled/disabled with a2ensite or a2dissite, like a2enmod and a2dismod commands for mods. It just creates/removes symlinks on the enable dir.

    Good luck
    Luis

  9. #9
    Just Joined!
    Join Date
    Nov 2010
    Posts
    25

    Hey that worked

    I guess though, that's not what I needed to do to get my jsp to work. All the code still displays on the page instead of the actual page content displaying. Must have something to do with my J2EE configuration.

    Thanks though, now I, and I guess you too, know that does work.

  10. #10
    Just Joined!
    Join Date
    Nov 2010
    Posts
    25

    Is this on subject?

    * Admin Edit: hello Ed, I've removed the quoted post you had here because that post has been deleted and the user banned because it was spam only, so in answer to your question, no it wasn't on subject. Just wanted to let you know what happened with that part of your post.


    Anyway, I just reinstalled my Jaunty upgraded to Maverick with just straight Maverick and am starting over. I think I'll just install Glassfish and see what I can do.
    Last edited by oz; 12-02-2010 at 03:45 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...