Menu

Question about link addresses in html pages

Help
Fred
2014-06-16
2014-06-16
  • Fred

    Fred - 2014-06-16

    Ok, so I have switchmap working on two of my switches to test the system and make any necessary adjustments.

    When I run the three .pl scripts, it appears the SwitchMap.pl is the one that reads the ThisSite.pm file and creates the webpages from the data collected. It also appears that part of the process reads the $DestinationDirectory and $DestinationDirectoryRoot sections of the ThisSite.pm file and uses the information in those two statements to create the url links in the resulting web pages.

    When I bring up the web page in my PC, the top set of links do not work but the bottom links do work.

    Here is the set up.

    Apache Web Server
    Per Directory Options
    Directory /var/www/portlists

    Virtual Server Details
    Document Root /var/www/portlists

    SwitchMap ThisSite.pm
    $DestinationDirectory = '/var/www/portlists';
    $DestinationDirectoryRoot = '/portlists';

    One the web page located at /var/www/portlists/index.html

    The top navigation link for switches has the format - 172.21.30.25/var/www/portlists/switches/index.html

    The bottom navigation link for switches has the format - 172.21.30.25/switches/index.html

    Should I change the destination directory to the same as the destinationdirectoryroot?

    Lastly, If I open the file on the webserver, I get all of the table formatting. However, when I access the page with a host PC, I don't get the formating.

     
  • Dan

    Dan - 2014-06-16

    Fred,
    If you want switchmap to be in the "root" of your www server [which is what your Apache config shows], then the ThisSite.pm config line

    $DestinationDirectoryRoot = '/portlists';

    should be

    $DestinationDirectoryRoot = '/';

    From the doc:
    "The $DestinationDirectoryRoot is the path to the same directory as DestinationDirectory, but from the perspective of the web server."

     

    Last edit: Dan 2014-06-16
  • Fred

    Fred - 2014-06-16

    Thanks. I am setting this up on a VM dedicated soley to SwitchMap and for me to view. As such, the webserver is only being used for SwitchMap. Love the program and being able to view this information without having to log into each device.

     
  • Dan

    Dan - 2014-06-16

    OK, so setting

    $DestinationDirectoryRoot = '/';

    should be what you need. Please let me/us know if that doesn't do the trick.

     
  • Fred

    Fred - 2014-06-16

    I made that change only and there is still a descrepancy between the url's generated for the top navigation links and the bottom navigation links and I am not sure why those links would be generated differently.

    The bottom url's work fine but the top ones always point to a location that is not valid (or at least a location that the web server would know to look for them).

    After several "change one thing only" configuration changes I have ended up with the following:

    Apache Web Server Config
    Document Root - /var/www/

    ThisSite.pm
    $DestinationDirectory = '/var/www/';

    [I decided since this is the only thing this webserver is hosting, I would just have it put all the files and folders in the web server root]

    $DestinationDirectoryRoot = '/';

    Using the Switches navigation link to reference the differences

    The top navigation link points to http://switches/index.html
    The bottom navigation link points to http://172.21.30.25/switches/index.html

    The program appears to create a more general (upward in the file structure) location reference. Would that be because you actually do not place it in the root of a web server? If so, I can easily correct that and create a directory structure to place it in other than /var/www/

     

Log in to post a comment.