Change webserver port?
-
Is it possible to change the default webserver port to something besides 80? Say, 8080?
-
@DiscoNaut While you surely can mess with the port in the Apache config I am fairly sure this will break some of FOG’s features like wake on LAN, snapins and maybe even PXE booting. Will definitely take some manual adjustments in files in the FOG server to get this somehow working.
What’s your intend in doing this?
-
@sebastian-roth
I ended up doing it. Since we have a monitoring system running on that port.
It did break a lot of stuff. When I reach out to the webserver I get this.
https://localhost:8080/fog/Management<?php
/**- The main index presenter
- PHP version 5
- @category Index_Page
- @package FOGProject
- @author Tom Elliott tommygunsster@gmail.com
- @license http://opensource.org/licenses/gpl-3.0 GPLv3
- @link https://fogproject.org
/
/* - The main index presenter
- @category Index_Page
- @package FOGProject
- @author Tom Elliott tommygunsster@gmail.com
- @license http://opensource.org/licenses/gpl-3.0 GPLv3
- @link https://fogproject.org
*/
require ‘…/commons/base.inc.php’;
$FOGPageManager = FOGCore::getClass(‘FOGPageManager’);
if (session_status() != PHP_SESSION_NONE) {
if (isset($_SESSION[‘delitems’])
&& !in_array($sub, array(‘deletemulti’, ‘deleteconf’))
) {
unset($_SESSION[‘delitems’]);
}
}
FOGCore::getClass(‘ProcessLogin’)->processMainLogin();
require ‘…/commons/text.php’;
$Page = FOGCore::getClass(‘Page’);
$nodes = array(
‘schema’,
‘client’,
‘ipxe’
-
@8dot Well in this case your webserver is not setup to even process the PHP scripts when you access the page on port 8080. I don’t think we can guide you through the whole process of moving FOG to another port.
-
while change the management is easily possible to set on different port, for example like this:
<VirtualHost *:8085> <FilesMatch "\.php$"> SetHandler "proxy:fcgi://127.0.0.1:9099/" </FilesMatch> KeepAlive Off ServerName 192.168.100.254 ServerAlias bastion.okd4.lab.blamaz.cz ServerAlias bastion-03-ext.blamaz.cz DocumentRoot /var/www/html/ RewriteEngine On RewriteCond %{REQUEST_URI} !^/(os|cblr)/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK) RewriteRule .* - [F] RewriteRule /management/other/ca.cert.der$ - [L] RewriteCond %{HTTPS} off RewriteRule !^/(os|cblr)($|/) https://%{HTTP_HOST}/$1 [R,L] <Directory /var/www/html/os> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> </VirtualHost> <VirtualHost *:7443> KeepAlive Off <FilesMatch "\.php$"> SetHandler "proxy:fcgi://127.0.0.1:9099/" </FilesMatch> ServerName 192.168.100.254 ServerAlias bastion.okd4.lab.blamaz.cz ServerAlias bastion-03-ext.blamaz.cz ServerAlias bastion-ext.blamaz.cz DocumentRoot /var/www/html/ SSLEngine On SSLProtocol all -SSLv3 -SSLv2 SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-A SSLHonorCipherOrder On SSLCertificateFile /var/www/html/fog//management/other/ssl/srvpublic.crt SSLCertificateKeyFile /opt/fog/snapins/ssl//.srvprivate.key SSLCACertificateFile /var/www/html/fog//management/other/ca.cert.pem <Directory /var/www/html/fog/> DirectoryIndex index.php index.html index.htm </Directory> RewriteEngine On RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK) RewriteRule .* - [F] RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-d RewriteRule ^/fog/(.*)$ /fog/api/index.php [QSA,L] <Directory /var/www/html/os> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> </VirtualHost>
cat /tftpboot/default.ipxe #!ipxe cpuid --ext 29 && set arch x86_64 || set arch ${buildarch} params param mac0 ${net0/mac} param arch ${arch} param platform ${platform} param product ${product} param manufacturer ${product} param ipxever ${version} param filename ${filename} param sysuuid ${uuid} isset ${net1/mac} && param mac1 ${net1/mac} || goto bootme isset ${net2/mac} && param mac2 ${net2/mac} || goto bootme :bootme chain https://192.168.100.254:7443/fog/service/ipxe/boot.php##params
there are probably several hardcoded fog url in code and i do not know where. ipxe menu and ipxe generally is working for me, but everything else selected for me failed. i do not think it’s possible without serious code modification, so i give it up.
ipxe defned for example like this works:
set conn_type http set fog-port 8085 set config-url http://${fog-ip}:${fog-port}/os/coreos/ignition/test.ign set base-url http://${fog-ip}:${fog-port}/os/coreos/stable kernel ${base-url}/kernel-x86_64 initrd=main coreos.live.rootfs_url=${base-url}/rootfs.x86_64.img ignition.firstboot ignition.platform.id=metal ignition.config.url=${config-url} initrd --name main ${base-url}/initramfs.x86_64.img boot || goto menu
-
@jjurak Is this something you are actively looking to do?
If yes, do you use the fog client program? If yes that will be the problem. The fog client is hard coded to use port 80. I’ve been asking for a few years to decouple the fog client communication port from the management ui. But there has been other issues that have taken priority.
If you are interested in doing this I can probably give you a few areas to look.