Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
appnotes:authmenus [2011/04/19 18:10] genec [vesamenu.c32 current] fix escape issue |
appnotes:authmenus [2011/05/06 19:48] genec [vesamenu.c32 current] Take care of a lot of non-standard variables |
||
---|---|---|---|
Line 13: | Line 13: | ||
SSLRequireSSL | SSLRequireSSL | ||
+ | You must choose between being able to load vesamenu.c32 directly and loading the current version of vesamenu.c32. | ||
==== vesamenu.c32 current ==== | ==== vesamenu.c32 current ==== | ||
The current version of vesamenu.c32 can not be loaded directly from gPXE and requires PXELINUX as an intermediate layer. You will need two PHP files, a boot.php containing | The current version of vesamenu.c32 can not be loaded directly from gPXE and requires PXELINUX as an intermediate layer. You will need two PHP files, a boot.php containing | ||
Line 20: | Line 20: | ||
| | ||
header ( "Content-type: text/plain" ); | header ( "Content-type: text/plain" ); | ||
+ | echo "#!gpxe\n"; | ||
+ | $proto = "https"; | ||
+ | // Comment out/remove the following if strictly using HTTPS | ||
+ | if (!isset($_SERVER["HTTPS"])) | ||
+ | $proto = "http"; | ||
+ | | ||
+ | // This assigns the host that gPXE should use using the most logical variables | ||
+ | if ( $_SERVER["HTTP_HOST"] != "" ) { | ||
+ | $host=$_SERVER["HTTP_HOST"]; | ||
+ | } else { | ||
+ | if ( $_SERVER["SERVER_NAME"] != 0) { | ||
+ | $host=$_SERVER["SERVER_NAME"]; | ||
+ | } else { | ||
+ | $host=$_SERVER["SERVER_ADDR"]; | ||
+ | } | ||
+ | } | ||
+ | | ||
+ | // Comment out/remove the following if you are running on a standard port | ||
+ | if (!((! isset($_SERVER["HTTPS"]) ) && ($_SERVER["SERVER_PORT"] == 80)) | ||
+ | && !(isset($_SERVER["HTTPS"]) && ($_SERVER["SERVER_PORT"] == 443)) ){ | ||
+ | if (strrpos($host, ":") == FALSE) | ||
+ | $host=$host.":".$_SERVER["SERVER_PORT"]; | ||
+ | } | ||
+ | | ||
+ | $uri=$_SERVER["REQUEST_URI"]; | ||
+ | $dir=substr ( $uri, 0, strrpos ($uri, "/") + 1); | ||
| | ||
echo "#!gpxe\n"; | echo "#!gpxe\n"; | ||
echo "imgfree\n"; | echo "imgfree\n"; | ||
echo "login\n"; | echo "login\n"; | ||
- | echo "set 209:string bootcfg.php"; | + | echo "set 209:string bootcfg.php\n"; |
echo "set 210:string ". | echo "set 210:string ". | ||
- | "https://\${username:uristring}:\${password:uristring}@". | + | $proto."://\${username:uristring}:\${password:uristring}@". |
- | $_SERVER["SERVER_NAME"]. | + | $host.$dir."\n"; |
- | dirname ( $_SERVER["REQUEST_URI"] ). | + | echo "chain \${210:string}pxelinux.0\n"; |
- | "/\n"; | + | |
- | echo "chain \${210:string}pxelinux.0"; | + | |
?> | ?> | ||
Line 45: | Line 69: | ||
?> | ?> | ||
+ | Selecting this method will require that you use gpxecmd.c32 to execute gPXE commands and scripts. | ||
==== vesamenu.c32 directly ==== | ==== vesamenu.c32 directly ==== | ||
You will need a file "boot.php" containing | You will need a file "boot.php" containing | ||
- | <?php | + | <?php |
- | + | ||
- | header ( "Content-type: text/plain" ); | + | header ( "Content-type: text/plain" ); |
- | + | ||
- | echo "#!gpxe\n"; | + | $uri=$_SERVER["REQUEST_URI"]; |
- | echo "imgfree\n"; | + | $dir=substr ( $uri, 0, strrpos ($uri, "/") + 1); |
- | echo "login\n"; | + | |
- | echo "chain ". | + | echo "#!gpxe\n"; |
- | "https://\${username:uristring}:\${password:uristring}@". | + | echo "imgfree\n"; |
- | $_SERVER["SERVER_NAME"]. | + | echo "login\n"; |
- | dirname ( $_SERVER["REQUEST_URI"] ). | + | echo "chain ". |
- | "/vesamenu.c32 menu.php\n"; | + | "https://\${username:uristring}:\${password:uristring}@". |
- | ?> | + | $_SERVER["HTTP_HOST"].$dir. |
+ | "vesamenu.c32 menu.php\n"; | ||
+ | ?> | ||
In order to use vesamenu.c32 directly from gPXE, you must use Syslinux-3.86 from [[http://www.kernel.org/pub/linux/utils/boot/syslinux/3.xx/]] and not the latest version. | In order to use vesamenu.c32 directly from gPXE, you must use Syslinux-3.86 from [[http://www.kernel.org/pub/linux/utils/boot/syslinux/3.xx/]] and not the latest version. |