• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    directory listings enabled in fog-installation

    Scheduled Pinned Locked Moved Solved
    FOG Problems
    5
    9
    807
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      Tywyn
      last edited by

      Hi there,

      not a real problem, just a question: Is it intended, that directory listings in apache are not disabled (at least for the / directory)? When I connect to / on the fog-ip via http I can see the directories html/ and fog/

      Cheers, Rainer

      1 Reply Last reply Reply Quote 0
      • S
        Sebastian Roth Moderator
        last edited by

        @Tywyn Well it’s just one of those many things that need fixing but aren’t too pressing…

        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

        A 1 Reply Last reply Reply Quote 0
        • A
          astrugatch @Sebastian Roth
          last edited by

          @Sebastian-Roth

          This is actually a suggestion I had meant to bring up earlier. I briefly tested it but removed the config because I was unsure of compatibility but a redirect in the apache config to /fog might be worth while so a directory doesn’t need to be specified at all. Via either RedirectMatch or RewriteRule. I just don’t know what this will do to systems that have the client with /fog already hardcoded.

          1 Reply Last reply Reply Quote 0
          • K
            Kiweegie
            last edited by Kiweegie

            I’ve addressed this on my FOG servers as follows:

            First edit the FOG apache file at /etc/apache2/sites-available/001-fog.conf to enable htaccess to work

            Add a new <Directory> stanza linked to the root of the site underneath the existing <Directory> stanza so it looks like this:

            <Directory /var/www/fog/>
                    DirectoryIndex index.php index.html index.htm
                </Directory>
                <Directory /var/www/>
                    Options Indexes FollowSymLinks
                    AllowOverride All
                    Require all granted
                </Directory>
            

            Restart apache then create an htaccess file

            sudo systemctl restart apache2
            sudo vi /var/www/.htaccess
            

            Add the following and save

            Options -Indexes
            

            Now navigating to the root of your FOG server will give you permission denied

            56585ad2-f0bf-4e08-a8dc-4a7e17b848c3-image.png

            1 Reply Last reply Reply Quote 0
            • S
              Sebastian Roth Moderator
              last edited by

              @Kiweegie Thanks for sharing your solution!

              Without having put in much though I’d probably just force a redirect from http://hostname/ to http://hostname/fog/

              Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

              Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

              1 Reply Last reply Reply Quote 1
              • S
                Sebastian Roth Moderator
                last edited by

                @astrugatch @Kiweegie Looking at this topic again after a while I am wondering if we’d just use a simple redirect as mentioned before. I just tested adding the following line in FOG’s apache config:

                RedirectMatch "^/$" "/fog/"
                

                Fairly straight forward and I would hope this doesn’t cause issues for existing installs. Though I am not exactly sure as many people use their FOG server for booting Live distros and we don’t know for sure how they setup it up. But the rule is very distinct and shouldn’t cause problems I would think. Except if you use the apache webserver to serve another website on that same server.

                Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                1 Reply Last reply Reply Quote 0
                • S
                  Sebastian Roth Moderator
                  last edited by

                  @developers @moderators Just stumbled upon this and was wondering if we consider adding this before the 1.5.9 release or not.

                  Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                  Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                  george1421G 1 Reply Last reply Reply Quote 0
                  • george1421G
                    george1421 Moderator @Sebastian Roth
                    last edited by

                    @Sebastian-Roth I guess I would have to spin up a new FOG server to see what problem we are trying to solve. I know there are people using their fog server for more than just imaging. If the problem is just to keep people from getting a directory listing of the web server root or landing on http://<fog_server_ip> and seeing things we could just put a index.php file in there to redirect to the fog management interface.

                    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                    1 Reply Last reply Reply Quote 1
                    • S
                      Sebastian Roth Moderator
                      last edited by Sebastian Roth

                      Finally added the simple route of HTTP redirect via index.php (99a407e and ad2813ab).

                      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      • First post
                        Last post

                      161

                      Online

                      12.1k

                      Users

                      17.3k

                      Topics

                      155.3k

                      Posts
                      Copyright © 2012-2024 FOG Project