I would like to turn off my server by pressing the power button. The problem is if I am in the login screen (I haven't logged in yet). Pressing the power button will not shutdown my server. How can I solve this problem ?
That should be all you need to do; after that, the server will catch the ACPI event caused by a short power button press and respond by shutting down cleanly.