FOGProject / fogproject

An open source computer cloning & management system
https://fogproject.org
GNU General Public License v3.0
1.14k stars 222 forks source link

Two occurences of weird/wrong hardcoded http-subfolders which kill iPXE booting #388

Closed kakohari closed 3 years ago

kakohari commented 4 years ago

Hi there,

as a pre-comment: Don't get me wrong - FOG is fantastic!

I had a sh***load of trouble with iPXE booting and tried to debug the issues. First thing was apaches' 000-default.conf which grabbed the POST-Request from iPXE as it is done via the IP-adress, not the hostname (don't know the reason for that), but the 000-default.conf is the first matching config for the IP - but has another webroot. a2dissite 000-default.conf did the first trick. Second problem is: when chainloading is performed (the second time?) to something, the path to the service/ipxe/boot.php is wrong (while it is correct at the first boot). An additional /fog/ is put in after the IP-Adress, but if you've configured fog and apache to do everything under / you won't be able to boot. In some older version there has been a symlink under / which was named fog and pointed to / (in my case). This symlink seems to be abandonable now.

The wrong lines are 193 and 343 in lib/fog/bootmenu.class.php but I haven't found out how to correct them - sorry. After six hours of debugging I need a bit of standby-mode. Maybe those /fog/ should be replaced with $_booturl ?

Sebastian-Roth commented 4 years ago

@kakohari Thanks for reporting this. You might want to add some more details about your setup, as some things are specific to certain setups. What Linux OS and version do you run? Which version of FOG version did you install?

First thing was apaches' 000-default.conf which grabbed the POST-Request from iPXE as it is done via the IP-adress, not the hostname (don't know the reason for that), but the 000-default.conf is the first matching config for the IP - but has another webroot.

Do I get this right? You have another service installed on your FOG server running on this same Apache webserver using a different webroot? Well it's up to you to do this but make sure you read and understand the warning printed by the FOG installer:

   ######################################################################
   # It is not recommended that you install this on a production system #
   #        as this script modifies many of your system settings.       #
   ######################################################################

Long time ago it was decided to use IP address instead of hostname name because for the later one you need a properly working DNS setup which not everyone might have in a small environment.

An additional /fog/ is put in after the IP-Adress, but if you've configured fog and apache to do everything under / you won't be able to boot.

I am wondering why you are trying to do this? Why not run FOG the way it was intended to? Understand, I am not saying we cannot change things. I am just trying to find out if it makes sense in out context to put work into this.

Sebastian-Roth commented 4 years ago

@kakohari Please help us understand why you modify FOG the way you seem to do and we might be able to help you.