11.2 Starting The Application

This topic describes the systematic instructions to start the application process.

Make sure that the wheel package and the dependencies are installed, and configuration setup is complete.
  1. Run the genai_doc_analyzer server using the below-mentioned command.
    python -m genai_doc_analyzer
  2. By default, the application runs on port 7777. You can change the port by passing –p argument.
    For example: python -m genai_doc_analyzer -p 5000
  3. To run the service in the background, use the command below.

    nohup python -m genai_doc_analyzer > nohup.txt

    Note:

    After the execution of the above command, all the execution logs will be added to nohup.txt text file. You can close the terminal and the application will keep running on port, unless stopped explicitly.
  4. By default, the application starts on http. You can change the protocol by passing the -s argument.

    python -m genai_doc_analyzer –p 5000 -s https

    python –m genai_doc_analyzer –p 5000 -s both

    Note:

    This starts the application on both http and https protocols on ports 5000 and 5001 respectively.

    Note:

    To run the service on https port, set the SSL_CERTIFICATE and SSL_KEY paths as mentioned in the Configuration Update section.
  5. To terminate or kill the application, use the netstat command to find the process_id using the port on which the application is running. Then use the kill command with the process_id as shown below to terminate the application.

    netstat -nlp | grep 7777

    kill -9 <process_id>

  6. To start the application using gunicorn on production mode, use the command below.
    gunicorn -b 0.0.0.0:<{port}> 'genai_doc_analyzer.genai_wsgi:genai_wsgi_service('<{port}>')