Build 4728 on Debian 8.2



  • All of this makes changing the default behaviour or Apache interesting:

    There is no folder /fog at /var/www/html
    /var/www/fog is a folder not a symlink
    /var/www/html/index.php is incomplete
    missing /var/www/html/index.php at /var/www/index.php

    Doing my usual " mv -u /var/www/html/index.html /var/www/html/index.html.old " so I don’t need to enter /fog/management or even /fog, just the http://name/ to send me to the login page, doesn’t work because of what I’ve noted above.

    To fix I did:

    • mv /var/www/fog /var/www/html
    • ln -s /var/www/html/fog /var/www/fog
    • repaired /var/www/html/index.php
    • cp /var/www/html/index.php /var/www/index.php

  • Senior Developer

    @Wayne-Workman, @sudburr you both realize you can use relative paths in the location parameter? This removes the hardcoding and is safer than trying get a good Apache configuration using a series of sed statements.


  • Moderator

    @sudburr

    … should work yes, but it hard-codes the ip address. I hate hard-coded paths. My job in rc.local could certainly take care of that, but I hate hard-coded paths.

    Well clearly you could replace the IP with the server name as long as you have a DNS A record for it.

    I haven’t learned sed yet, I haven’t had a need yet. I jumped into the Linux world in February. :-) I’m studying for the RHCSA and RHCE right now because I’ve dove in so deep with fog lol.



  • I have been looking into neater ways to accomplish the redirect. CentOS 7.1 has a neat one that doesn’t exist on Debian or Ubuntu.

    sed -i -e "s|DirectoryIndex index.html|DirectoryIndex /fog/index.php index.html|g" /etc/httpd/conf/httpd.conf
    

    For previous builds on both Debian and Ubuntu, I would do:

    mv -u /var/www/html/index.html /var/www/html/index.html.old
    

    Which is just a failover option really … but there is definitely something wrong with what I spotted up there. I’ve recreated the above problems twice on two fresh Debian 8.2 installs and build 4728. I’m re-organizing and re-writing my scripts/steps for server installation then FOG installation; I’ll post them sometime soon.

    Your option to:

     vi /var/www/html/index.php
    <?php header('Location: http://x.x.x.x/fog/management/index.php'); ?>
    die();
    

    … should work yes, but it hard-codes the ip address. I hate hard-coded paths. My job in rc.local could certainly take care of that, but I hate hard-coded paths.


  • Moderator

    You could put a redirect in… all I type is my fog server’s IP and nothing more into a web browser’s address bar and I get slapped onto the login page. https://wiki.fogproject.org/wiki/index.php/Simple_Redirect


Log in to reply
 

392
Online

38920
Users

10688
Topics

101407
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.