WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Running wsadmin with php script - Little Help?

    Posted 03/22/13 06:39 PM
    I have a simple php script that I want to have users run to execute deploys.  I am getting a permission denied on the wsadmin.sh script.   The script runs fine run as other users but when it's executed from the php script in the browser it fails.

    echo exec('whoami');
    exec ('sudo -i ./deploy-applications.sh localhost 8879 wasadmin Austin2012 /home/wasadmin/deployments'); ?>

    I've tried removing the sudo -i and it fails the same.

    Here's a snippet from the error_log:

    ./deploy-applications.sh: line 7: /opt/IBM/WebSphere/AppServer/bin/wsadmin.sh: Permission denied
    sudo: unable to open audit system: Permission denied

    Permissions on the file seem to be ok:

    -rwxr-xr-x. 1 wasadmin wasadmin 3741 Dec  5 13:04 /opt/IBM/WebSphere/AppServer/bin/wsadmin.sh

    The user that php executes as is apache

    Does anyone have any ideas?





  • 2.  Running wsadmin with php script - Little Help?

    Posted 03/25/13 05:52 PM
    Hi Brad,

      Seems like an operating system error (security).
     
      Have you try to execute another script (not websphere)?
     
      Create dummy script, put the same permisions like wsadmin.sh (755) and another owner:group and try executing from PhP.  Have you the same problem?
       
     
    regards


  • 3.  Running wsadmin with php script - Little Help?

    Posted 04/02/13 11:01 AM
    Thank you for the reply!   I got the script working in a different manner in my test env.   Now that I've moved it to the clients machine I am getting errors regarding encoding with the jython script in wsadmin.   Trying to figure that out now.


  • 4.  Running wsadmin with php script - Little Help?

    Posted 04/02/13 01:20 PM
    This issue is not from websphere or Php.
    It is from SELinux , it blocks the below page from loading
    exec ('sudo -i ./deploy-applications.sh localhost 8879 wasadmin Austin2012 /home/wasadmin/deployments'); ?>


    Is your system has SELinux enabled ? And what about clients machines ?

    you can set SELinux is permissive mode or add an entry to allow what you are doing from php script.