You must start the server before you can issue the CLI commands.

1. Start the JBoss Enterprise Application Platform 6 or JBoss AS 7 Server by typing the following: 

		For Linux:  JBOSS_HOME_SERVER_1/bin/standalone.sh
		For Windows:  JBOSS_HOME_SERVER_1\bin\standalone.bat
2. To start the JBoss CLI tool, open a new command line, navigate to the JBOSS_HOME directory, and type the following:
    
		For Linux: bin/jboss-cli.sh --connect
		For Windows: bin\jboss-cli.bat --connect
3. At the prompt, enter the following commands to create and then configure the security domain.

    /subsystem=security/security-domain=GenericHeaderAuth:add

    /subsystem=security/security-domain=GenericHeaderAuth/authentication=classic:add(login-modules= \
    [                                                                                                                      \
        {                                                                                                                  \
            "code" => "org.jboss.security.auth.spi.RemoteHostTrustLoginModule",                     \
            "flag" => "required",                                                                   \
            "module-options" => [                                                                   \
                ("trustedHosts" => "127.0.0.1"),                                                    \
                ("roles" => "guest"),                                                               \
            ]                                                                                       \
        }                                                                                           \
    ])

You might want to consider creating a CLI script to save the user typing this.