Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Start ant as a different user / User rights

Status
Not open for further replies.

AntDrivesMeCrazy

Programmer
Dec 7, 2005
1
DE
Hello,

I've spent a lot of days in writing an ant-script as root on a linux webserver. This script undeploys a project in tomcat, deletes all the files, checks out new resources from a svn-server, compiles thoses and installs it as a new application under tomcat. When I execute the script logged in as root it works fine.

But the idea is that you can start the script via internet browser. So I wrote a php-Script which should do it. At first it didn't do a lot, because it could not delete old files, as the permission for checked out files is read-only (root is owner, he can do everything of course). I played around with sudoers, changed the user "apache" so that he has a shell, and added him to the sudoer (without password, because I did't figure out how to pass a password from php to sudo, as the command sudo does not have a -p or something like that). Deleting of files works now, but now I get the following error:

/usr/local/apache-tomcat-5.5.12/webapps/BuergerPortal.war

stop-tomcat:

BUILD FAILED /usr/local/voiceXML/build.xml:121: The following error occurred while executing this line:
/usr/local/voiceXML/build.xml:96:
java.lang.NoClassDefFoundError: while resolving class: org.apache.catalina.util.Base64 Total time: 12 seconds

The catalina-ant.jar is in the ant/lib directory (and as I said, it works fine under root), and it has reading rights. Do you know what could be the error?

Thanks a lot!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top