Starting-stopping AEM from the Command Line


The start script is available under the /bin directory. Both Unix and Windows versions are provided. The script starts the instance installed in  directory.
Those two versions support a list of environement variables that could be used to start and tune the AEM instance.
Environment variableDescription
CQ_PORTTCP port used for stop and status scripts
CQ_HOSTHost name
CQ_INTERFACEInterface that this server should listen to
CQ_RUNMODERunmode(s) separated by comma
CQ_JARFILEName of the jarfile
CQ_USE_JAASUse of JAAS (if true)
CQ_JAAS_CONFIGPath of the JAAS configuration
CQ_JVM_OPTSDefault JVM options


Caution:

Note that some run modes, among them author and publish, need to be set before first starting AEM and can not be changed afterwards. Before setting up an AEM instance that is supposed to be used in production,



Windows platform start.bat script example
SET CQ_PORT=1234 & ./start.bat

Unix platform start script example
CQ_PORT=1234 ./start


Note:

The start script launches the AEM Quickstart installed under the /app folder


Stopping Adobe Experience Manager

To stop AEM, do one of the following:
  • Depending on the platform you are using:
    • If you started AEM from either a script or the command line, press Ctrl+C to shut down the server.
    • If you have used the start script on UNIX, you must use the stop script to stop AEM.
  • If you started AEM by double-clicking the jar file, click the On button on the startup window (the button then changes to Off) to shut down the server.
    chlimage_1
  • Stopping Adobe Experience Manager from the Command Line
The stop script is available under the /bin directory. Both Unix and Windows versions are provided. The script stops the running instance installed in  directory.

Unix platform stop script example

1
./stop

Windows platform stop.bat script example

1
./stop.bat
If you just want to preconfigure the repository (without relocating it) you only have to:
  • extract repository.xml to the required location 
  • update repository.xml as required
  • create bootstrap.properties and define repository.config
Again, before starting the actual installation.

Installing and Starting AEM6 as a Windows Service




  1. 1. Open the crx-quickstart\opt\helpers\instsrv.bat file in a text editor.


  2. 2. If you are configuring a 64-bit Windows server, replace all instances of prunsrv with one of the following commands, according to your operating system:
    • prunsrv_amd64
    • prunsrv_ia64
    3. This command invokes the appropriate script that starts the Windows service daemon in 64-bit Java instead of 32-bit Java.


  3. 4. To prevent the process from forking into more than one process, increase the maximum heap size and the PermGen JVM parameters. Locate the set jvm_options command and set the value as follows:
    set jvm_options=-XX:MaxPermSize=256M;-Xmx1792m


  4. 5. Open Command Prompt, change the current directory to the crx-quickstart/opt/helpers folder of the AEM installation, and enter the following command to create the service:
    instsrv.bat cq5
    6. To verify that the service is created, open Services in the Administrative Tools control panel or type start services.msc in Command Prompt. The cq5 service appears in the list.


  5. Start the service by doing one of the following:
  6. 1. In the Services control panel, click cq5 and click Start.

  7. chlimage_1
   2. In the command line, type net start cq5.

    chlimage_1


  • 3. Windows indicates that the service is running. AEM starts and the prunsrv executable appears in Task Manager. In your web browser, navigate to AEM, for example, http://localhost:4502 to start using AEM.

    chlimage_1
  • Note:
    The property values in the instsrv.bat file are used when creating the Windows service. If you edit the property values in instsrv.bat, you must uninstall and then reinstall the service.
    Note:
    When installing AEM as service, you must provide the absolute path for the logs directory in com.adobe.xmp.worker.files.ncomm.XMPFilesNComm from Configuration Manager.

    How to Uninstall CQ5 service from window system

    To uninstall the service, either click Stop in the Services control panel or in the command line, navigate to the folder and type instsrv.bat -uninstall cq5. The service gets removed from the list in the Services control panel or from the list in the command line when you type net start.

    Reference URL:




    ALternate way to install bundles, content packages or configurations to the repository in AEM 6.x

    Solution : 

    1. By default the folder crx-quickstart/install is watched for files.
        This folder does not exist, but simply can be created at runtime.
    2. If a bundle, configuration or content package is put into this directory, it is automatically picked           up and installed. If it's removed, it gets uninstalled. 
         It is another way to put bundles, content packages or configurations to the repository.
    This is especially interesting for several use cases:
    • During development, it might be easier to put something into the file system.
    • If something goes wrong, the web console and the repository are not reachable. With this you can put additional bundles into this directory and they should get installed.
    • The crx-quickstart/install folder can be created before quickstart is started, and additional packages can be put there.