We encountered an issue, and the final solution was to flush the JRE (Java Runtime Environment) cache. In order to flush the JRE cache.
1 – Go to Control Panel
2 – Open the Java widget from Control Panel
3 – Click on View button from Temporary Internet Files.
4 – And then select the needed items (all?) and click on the X button:
or you may want to disable the Temporary Internet files from Settings:
https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ResettingAdminPassword_EC2Config.html
Issue Description:
In Postfix Admin 3.1 , when clicking on a domain, it returns a page with the following error:
DEBUG INFORMATION:
Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘row FROM mailbox LEFT JOIN alias ON mailbox.username=alias.address LEFT JOIN’ at line 2
Check your error_log for the failed query.
Please check the documentation and website for more information.
Cause Description:
As per the error log, it seems to be cause by a database query code defect in Postfix Admin.
[Thu Jul 18 19:34:12.509373 2019] [:error] [pid 1501] [client ] Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘row FROM mailbox n LEFT JOIN alias ON mailbox.username=alias.address LEFT JOIN’ at line 2,
[Thu Jul 18 19:34:12.509413 2019] [:error] [pid 1501] [client ] caused by query: n SELECT * FROM (n SELECT mailbox.username AS label, @row := @row + 1 AS row FROM mailbox n LEFT JOIN alias ON mailbox.username=alias.address LEFT JOIN vacation ON mailbox.username=vacation.email n WHERE mailbox.domain=’example.com’ n ORDER BY mailbox.username n ) idx WHERE MOD(idx.row, 10) IN (0,9) OR idx.row = 11n
Resolution:
We want to have a small server which will allow us to install multiple Operating Systems easily. We took a VM with 1GB of RAM.
The steps that we performed are:
Install the base server
1 – Start with the installation of a minimal Oracle Linux 7.6, but we think that the process for RedHat, or CentOS will be the same.
2 – We choose default settings, except that we setup the network interface with a static IP, from the same subnet like the rest of the network. Lets say 192.168.110.2. We are not sure if the hostname is needed, but we setup this as well.
Configure DNSMasq, Syslinux and TFTP server
3 -Next step is to install DNSMasq:
# yum install dnsmasq
4 – Configure DNSMasq:
interface=eno16777736,lo #bind-interfaces domain=yellowgnu.net # DHCP range-leases dhcp-range= eno16777736,192.168.110.20,192.168.110.253,255.255.255.0,1h # PXE dhcp-boot=pxelinux.0,pxeserver,192.168.110.2 # Gateway dhcp-option=3,192.168.110.1 # DNS dhcp-option=6,192.168.110.1, 8.8.8.8 server=8.8.4.4 # Broadcast Address dhcp-option=28,192.168.110.255 # NTP Server dhcp-option=42,0.0.0.0 pxe-prompt="Press F8 for menu.", 60 pxe-service=x86PC, "Install Oracle Linux 7 from network server", pxelinux enable-tftp tftp-root=/var/lib/tftpboot
5 – Install the syslinux:
# yum install syslinux
6 – Install the TFTP Server:
# yum install tftp-server
7 – And copy the syslinux files to TFTP Server boot folder:
# cp -r /usr/share/syslinux/* /var/lib/tftpboot
8 – Create the default PXE config file:
# mkdir /var/lib/tftpboot/pxelinux.cfg # touch /var/lib/tftpboot/pxelinux.cfg/default
9 – Edit the default config file
# vi /var/lib/tftpboot/pxelinux.cfg/default
and insert the following content:
default menu.c32 prompt 0 timeout 300 ONTIMEOUT local menu title ########## PXE Boot Menu ########## label 1 menu label ^1) Install Oracle Linux 7 x64 with Local Repo kernel olinux7/vmlinuz append initrd=olinux7/initrd.img method=ftp://192.168.110.2/pub devfs=nomount label 2 menu label ^2) Install Oracle Linux 7 x64 with http://mirror.centos.org Repo kernel olinux7/vmlinuz append initrd=olinux7/initrd.img method=http://mirror.centos.org/centos/7/os/x86_64/ devfs=nomount ip=dhcp label 3 menu label ^3) Install Oracle Linux 7 x64 with Local Repo using VNC kernel olinux7/vmlinuz append initrd=olinux7/initrd.img method=ftp://192.168.110.2/pub devfs=nomount inst.vnc inst.vncpassword=password label 4 menu label ^4) Boot from local drive
Add a Linux distro “somewhere”
actually on a FTP server
10 – Add Oracle Linux 7 Boot Images to PXE Server:
- Download the ISO images of the Linux distro that you want and mount the image.
# mount -o loop /root/OracleLinuxImage.iso /mnt # ls /mnt
11 – Create a folder in TFTP Boot folder for this distro and copy the PXE boot files to the right folder:
# mkdir /var/lib/tftpboot/olinux7
# cp /mnt/images/pxeboot/vmlinuz /var/lib/tftpboot/olinux7
# cp /mnt/images/pxeboot/initrd.img /var/lib/tftpboot/olinux7
12 – Install the VSFTP server and tried to mount the ISO Oracle Linux image into the public folder of VSFTPD
# yum -y install vsftpd
# umount /mnt
# mount /root/V980739-01.iso /var/ftp/pub/
Services and Firewall Setup
13 – Now, lets try to start some services:
# systemctl start dnsmasq # systemctl status dnsmasq # systemctl start vsftpd # systemctl status vsftpd # systemctl enable dnsmasq # systemctl enable vsftpd
14 – A bit of firewall setup:
# firewall-cmd --add-service=ftp --permanent ## Port 21 # firewall-cmd --add-service=dns --permanent ## Port 53 # firewall-cmd --add-service=dhcp --permanent ## Port 67 # firewall-cmd --add-port=69/udp --permanent ## Port for TFTP # firewall-cmd --add-port=4011/udp --permanent ## Port for ProxyDHCP # firewall-cmd --reload ## Apply rules
15 – Test the FTP: ftp://192.168.110.2/pub
For me this did not worked, so I had to go to fix the folder: /var/ftp/pub/ which must be with the permissions 755.
Solving some unexpected issues
16 – I had to go to enlarge the disk size of my VM, and then to enlarge the partitions on the Linux system.
17 – We are going back to step 12, and copy the content of the ISO image to public folder:
# mount /root/V980739-01.iso /mnt/
# cp -r /mnt/* /var/ftp/pub/
# chmod -R 755 /var/ftp/pub
and now, back again to our track, checking the FTP: ftp://192.168.110.2/pub
18 – Create a VM, to boot from network.
19 – In order for a machine to boot from this PXE server setup, we must configure the DHCP Server to inform clients from where to boot. I am using a Linksys DD-WRT router. I have added the following line under Services > Additional DNSMasq Options:
dhcp-boot=pxelinux.0,pxe.yellowgnu.net,192.168.110.2
20 – Boot the VM.
and it failed with a TFTP timeout.
I changed the line from DNSMasq to pxe.yellowgnu.net and added the same pxe.yellowgnu.net to DNS.
21 – This time the boot of VM failed with
TFTP prefix:
Unable to locate configuration file
and indeed, the file /var/lib/tftpboot/pxelinux.cfg/default was empty.
This time the boot process went well, and I got the Oracle Linux installation screen
Windows to the PXE Server
Install the Samba Server
22 – Install the Samba Server:
# yum install samba samba-common samba-winbind
23 – And configure it:
# vi /etc/samba/smb.conf
[global] workgroup = PXESERVER server string = Samba Server Version %v log file = /var/log/samba/log.%m max log size = 50 idmap config * : backend = tdb cups options = raw netbios name = pxe map to guest = bad user dns proxy = no public = yes ## For multiple installations the same time - not lock kernel kernel oplocks = no nt acl support = no security = user guest account = nobody [installWin10] comment = Windows 10 Image path = /windows10 read only = no browseable = yes public = yes printable = no guest ok = yes oplocks = no level2 oplocks = no locking = no
24 – Create the folder and set SELinux rules:
# mkdir /windows10 # semanage fcontext -a -t samba_share_t ‘/windows10(/.*)?’ # restorecon -R -v /windows10
Add Windows folders
# mkdir -p /windows10/x64
# mkdir -p /windows10/x32
# chmod -R 0755 /windows10
# chown -R nobody:nobody /windows10
# cp /mnt/* /windows10/x64/
Add some firewall rules
# firewall-cmd --add-service=samba --permanent
# firewall-cmd --reload136 ll /windows10/x64/
Setup the services
# systemctl restart smb
# systemctl enable smb
# systemctl restart winbind
# systemctl enable winbind
# systemctl restart nmb
# systemctl enable nmb
# systemctl status smb
Prepare the PXE boot config
# mkdir /var/lib/tftpboot/windows
# vi /var/lib/tftpboot/pxelinux.cfg/default
and add an entry for Windows:
label 9 menu label ^9) Install Windows 7 x32/x64 KERNEL memdisk INITRD windows/winpe_x86.iso APPEND iso raw
Next we will prepare a Windows Pre-installation Environment (Windows PE)
Installing Windows 7 over PXE Network Boot Server on RHEL/CentOS 7 using WinPE ISO Image – Part 2
The IP of the machine is 192.168.110.2 and the password of the root user on this image is Ygnu2017. Good luck !
We based our attempt on some articles from Tecmint.com
1 – Install ADK: https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install (I choose all the features)
https://go.microsoft.com/fwlink/?linkid=2086042
2 – Install also the Windows PE add-on for the ADK: https://go.microsoft.com/fwlink/?linkid=2087112
3 – Run
copype amd64 C:WinPE_amd64
4 – Create a ISO file:
MakeWinPEMedia /ISO C:WinPE_amd64 C:WinPE_amd64WinPE_amd64.iso
5 – Copy the .iso file created to TFTPBoot folder:/var/lib/tftpboot/windows10/winpe_x86.iso
6 – Boot the machine from LAN and choose the Windows installation.
The problem with this is that the Windows installation process is not automated.
Automating Windows Install
TBC