Menu

.css 404 no found for index.html file

Jared
2017-04-07
2017-04-07
  • Jared

    Jared - 2017-04-07

    Fairly new to switchmap, however I have it up and running. However I am using Apache to host the index file. When I browse to it locally I can see the stylesheet in a browser no problem. However from another system it does not load the CSS file. I have everything mapped locally in each of the files correctly. However I tried this before on a windows box with ii7 and saw the same issue. No formatting of the page is being done. I swapped over to ubuntu with apache and still have the same issue. Here is how I have everything mapped

    /var/www/switchmap is the directoryroot folder
    /usr/local/switchmap is where I extracted the files to
    /var/local/switchmap is where the statefiles are located

    I have tried using both <link href="./var/www/switchmap/SwitchMap.css" rel="stylesheet">
    and <link href="/var/www/switchmap/SwitchMap.css" rel="stylesheet">

    In the browser it shows up as follows in developer tools
    Name/Path
    SwitchMap.css
    http://x.x.x.x/var/www/switchmap

    Result/Description
    404 Not Found

    Content type
    text/html

    Initatior/Type
    index.html:9 parsedElement

    In the index file line 9 is as follows
    <link href="/var/www/switchmap/SwitchMap.css" rel="stylesheet" type="text/css">

    Any ideas guys/gals?
    Thank you

    -J

     
  • Pete Siemsen

    Pete Siemsen - 2017-04-07

    When I wrote SwitchMap, I put the code in a directory that my web server could access, and the program wrote output files to the "current directory". It was a choice of convenience. It doesn't matter to the web server that there are some non-HTML files in the directory. Later, when I started running the programs from cron jobs, I couldn't rely on the "current directory", so I made the $DestinationDirectory variable in ThisSite.pm, and made all the code write to that directory.

    SwitchMap.css is an interesting file - it's needed by the HTML files that are produced by SwitchMap, but it's static. It isn't really an "output file", so the program doesn't write the file to $DestinationDirectory. In other words, SwitchMap is written with the assumption that $DestinationDirectory is the directory that you installed the SwitchMap code in.

    It sounds like you have installed SwitchMap in one directory, and you're writing its HTML files to a different directory. So your $DestinationDirectory doesn't contain SwitchMap.css. If this is the case, you can "fix" things by copying SwitchMap.css to the $DestinationDirectory.

    A better fix would be to set $DestinationDirectory to directory that you installed SwitchMap in.

    Hope this helps.

     
  • Jared

    Jared - 2017-04-10

    Pete,

    Thanks for repsonding, however I did as you suggested and now everything is under one directory which is as follows:

    /var/www/switchmap

    I think my issue is with the $DestinationDirectoryRoot in ThisSite.pm. No matter what I set it to, in a browser it still shows http://x.x.x.x/www/switchmap error 404 not found. I followed on guide that said to set it to just '/switchmap'; however then the error is http://x.x.x.x/switchmap error 404 not found.

    Here is how I have my ThisSite.pm file configured

    $DestinationDirectory = ‘/var/www/switchmap’;

    $DestinationDirectoryRoot = ‘/switchmap’;

    $StateFileDirectory = ‘/var/www/switchmap’;

    I have modified all files i can find that are linked to /ports/web/nets/internal/portlists that I have found so far to /var/www/switchmap.

    Site seems to load, but does not load CSS style sheet nor does the top navigation links work either.

     
  • Jared

    Jared - 2017-04-10

    Pete,

    So I wiped everything and started from scratch.  I made directories 
    such as /usr/web/nets/interneral/portlists.
    
    However now I am getting Forbidden access when I try to navigate to the site.
    
    I'm scratching my head as when it was under /var/www/switchmap I did not get forbidden access, but when I moved everything under
    /usr/web/nets/internal/portlists now I am getting forbidden access....
    
     

    Last edit: Jared 2017-04-10
    • Pete Siemsen

      Pete Siemsen - 2017-04-10

      There may be a hint in the apache log files. On my system, they are
      /var/log/apache2/access.log or /var/log/apache2/error.log.

      Please check the file permissions on the /usr/web/nets/internal/portlists
      directory. It needs to be readable by "other".

      BTW, did you mean /usr/web/nets/interneral/portlists or
      /usr/web/nets/internal/portlists?

      On Mon, Apr 10, 2017 at 11:12 AM, Jared jrad101@users.sf.net wrote:

      Pete,

      So I wiped everything and started from scratch. I made directories such as /usr/web/nets/interneral/portlists.

      However now I am getting Forbidden access when I try to navigate to the site.

      I'm scratching my head as when it was under /var/www/switchmap I did not get forbidden access, but when I moved everything under /usr/web/nets/internal/portlists now I am getting forbidden access....


      .css 404 no found for index.html file
      https://sourceforge.net/p/switchmap/discussion/378009/thread/7ed28198/?limit=25#d32f


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/switchmap/discussion/378009/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
  • Jared

    Jared - 2017-04-10

    Pete,

    I meant /usr/web/nets/internal/portlists, quick typing on my part. I rebuild the server as I think it had some lingering issues from when I built it under different directories. Fingers crossed this fixes it.

     
  • Jared

    Jared - 2017-04-10

    Pete,

    I fixed the permission issue (it was in the apache .conf file). Not sure how that changed, but now I'm back to the begning were even though everything is in /usr/web/nets/internal/portlists I still do not get the correct css stylesheet nor does the navigation links work.. 0_o

    I have attached a screen shot of what it looks like from the IE developer tools

     

    Last edit: Jared 2017-04-10
  • Jared

    Jared - 2017-04-11

    So today I am back to where I was at the begining. Which is the CSS styelsheet is not found by apache, and the top navigation links do not work.

    Everything is under /usr/web/nets/internal/portlists
    ThisSite.pm
    $DestinationDirectory = 'usr/web/nets/internal/portlists';

    $DestinationDirectoryRoot = '/nets/internal/portlists';

    $StateFileDirectory = '/var/local/switchmap';

    FindOffice.pl
    use lib '/usr/web/nets/internal/portlists';

    SearchPortLists.html
    <title>Search Port Lists webpages </title>
    <link href="/usr/web/nets/internal/portlists/SwitchMap.css" rel="stylesheet">

    lower down in the SearchPortLists.html

    <form method="Get" action="/usr/web/nets/internal/portlists/FindOffice.pl"> One thing I've found interesting is that in the SwitchUtils.pm file under the "Sub Navigation Bar" section, If I change the following line: my $RootPath = $ThisSite::DestinationDirectoryRoot . '/' . 'index.html'; to the following my $RootPath = 'index.html'; Then I can get the navigation link to work, however once I click the "home" it breaks again. Another thing I found was in this same file under "my $CssFilePath" If give it the absolute path instead of $ThisSite::DestinationDirectoryRoot it seems to work for the first couple of links, however anything with a sub folder does not get the css formatting. So this leads me back to the "ThisSite.pm" file under $DestinationDirectoryRoot with there being some issue. After all of that, any ideas? </form>
     

    Last edit: Jared 2017-04-11
  • Jared

    Jared - 2017-04-11

    we can close this, it was an issue with Apache2. I ended pointing the index file to /var/www/html and that worked just fine... Not sure why editing the /etc/apache2/sites-available/switchmap.conf file didnt work...

    but either way it's working now.

     

Log in to post a comment.

MongoDB Logo MongoDB