473,394 Members | 1,935 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

want to start tomcat from php

hi everyone..sorry everyone if ive posted on the wrong group but i
really needed help....

i wan tto start jakarta-tomcat-5.5.3 from the webbrowser using the
sheel scripts...i normally use the shell scripts from the command line
to start and stop the tomcat server.....

i found out that php gives this incredible facility where i can execute
normal bash commands...i tried doing so ..but a simple command like {
system('whoami') } from
browser......eg.....http://localhost/startup.php..

prints apache as the user....so technically it executes the tomcat
startup script as apache user..but ive got
jakarta-tomcat-5.5.3 under the tomcat user....can someone please tell
me is there a way in php coding wherein i can execute the command as
another....i know this seems a bit out of place...but i really didnt
know anywhere else to go

danish

Mar 1 '06 #1
3 2821
danish wrote:
hi everyone..sorry everyone if ive posted on the wrong group but i
really needed help....

i wan tto start jakarta-tomcat-5.5.3 from the webbrowser using the
sheel scripts...i normally use the shell scripts from the command line
to start and stop the tomcat server.....

i found out that php gives this incredible facility where i can execute
normal bash commands...i tried doing so ..but a simple command like {
system('whoami') } from
browser......eg.....http://localhost/startup.php..

prints apache as the user....so technically it executes the tomcat
startup script as apache user..but ive got
jakarta-tomcat-5.5.3 under the tomcat user....can someone please tell
me is there a way in php coding wherein i can execute the command as
another....i know this seems a bit out of place...but i really didnt
know anywhere else to go

danish


Not if the OS won't let you.

You potentially could do a posix_setuid to change the uid, but that has
to be allowed by the OS and most won't because of the potential (huge)
security risk.

You may be able to su to the tomcat user - but again the OS must be set
up to allow it.

You can't do anything the OS won't allow. What you really need is a
Unix Admin to set up the permissions you need.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Mar 1 '06 #2
Jerry Stuckle wrote:
danish wrote:
hi everyone..sorry everyone if ive posted on the wrong group but i
really needed help....

i wan tto start jakarta-tomcat-5.5.3 from the webbrowser using the
sheel scripts...i normally use the shell scripts from the command line
to start and stop the tomcat server.....

i found out that php gives this incredible facility where i can execute
normal bash commands...i tried doing so ..but a simple command like {
system('whoami') } from
browser......eg.....http://localhost/startup.php..

prints apache as the user....so technically it executes the tomcat
startup script as apache user..but ive got
jakarta-tomcat-5.5.3 under the tomcat user....can someone please tell
me is there a way in php coding wherein i can execute the command as
another....i know this seems a bit out of place...but i really didnt
know anywhere else to go

danish


Not if the OS won't let you.

You potentially could do a posix_setuid to change the uid, but that has
to be allowed by the OS and most won't because of the potential (huge)
security risk.

You may be able to su to the tomcat user - but again the OS must be set
up to allow it.

You can't do anything the OS won't allow. What you really need is a
Unix Admin to set up the permissions you need.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


well..im not very familiar with setuid n stuff...but from what ive
tried....i can sudo to the tomcat user or if i want use a normal user
to start tomcat using sudo.....but basically i dont want that....i
heard that tomcat can be integrated with php..if that is possible maybe
i can execute normal commands as the tomcat user..and as the tomcat
user is allowd to start tomcat..maybe i can start tomcat from the
webpage....what du u think

danish

Mar 5 '06 #3
danish wrote:
Jerry Stuckle wrote:
danish wrote:
hi everyone..sorry everyone if ive posted on the wrong group but i
really needed help....

i wan tto start jakarta-tomcat-5.5.3 from the webbrowser using the
sheel scripts...i normally use the shell scripts from the command line
to start and stop the tomcat server.....

i found out that php gives this incredible facility where i can execute
normal bash commands...i tried doing so ..but a simple command like {
system('whoami') } from
browser......eg.....http://localhost/startup.php..

prints apache as the user....so technically it executes the tomcat
startup script as apache user..but ive got
jakarta-tomcat-5.5.3 under the tomcat user....can someone please tell
me is there a way in php coding wherein i can execute the command as
another....i know this seems a bit out of place...but i really didnt
know anywhere else to go

danish


Not if the OS won't let you.

You potentially could do a posix_setuid to change the uid, but that has
to be allowed by the OS and most won't because of the potential (huge)
security risk.

You may be able to su to the tomcat user - but again the OS must be set
up to allow it.

You can't do anything the OS won't allow. What you really need is a
Unix Admin to set up the permissions you need.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

well..im not very familiar with setuid n stuff...but from what ive
tried....i can sudo to the tomcat user or if i want use a normal user
to start tomcat using sudo.....but basically i dont want that....i
heard that tomcat can be integrated with php..if that is possible maybe
i can execute normal commands as the tomcat user..and as the tomcat
user is allowd to start tomcat..maybe i can start tomcat from the
webpage....what du u think

danish


Yes, Tomcat can be integrated with PHP.

But PHP itself is not a daemon like Tomcat or Apache. Rather it runs
under the current user.

So, to execute a PHP script as Tomcat, you need to either run the script
under Tomcat (or another process using the same ID) or su to the Tomcat id.

If you're going to start fooling with uid's, I highly suggest you get a
book on Linux administration and get familiar with them. You can very
easily leave huge security holes in your system if you do the wrong thing.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Mar 5 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Liza | last post by:
Hi, I have upgraded from Tomcat4.0.4 to Tomcat4.1.29 by installing a binary, not an RPM. It looks OK but it won't start at boot time. There are no scripts in /etc/rc.d/init.d/ or /etc/init.d/ All...
5
by: D E | last post by:
When using my web application manager (http://localhost:8080/admin) I forgot my password. Is there an XML file i can look at to remember/obtain (possibly even set). Thanks
2
by: Mario | last post by:
Hi, I'm experiencing a nasty problem with Visual Studio .Net 2003. Most Online Resources in the Start Page doesnt work, showing the following message: "This feature requires that you have...
9
by: Larry Woods | last post by:
I have a site that works fine for days, then suddenly, I start getting ASP 0115 errors with an indication that session variables IN SEPARATE SESSIONS have disappeared! First, for background...
16
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the...
1
by: Neelimapraveen | last post by:
after installing Tomcat1.4 ,I set the environment variables %CATALINA_HOME% to the path of my tomcat installation that is c:\Tomcat1.4\apache-tomcat-1.4\bin; and my JAVA_HOME is pointing to...
1
by: tinkugitu | last post by:
Hi When I deployed my web application( named: myApp) in Tomcat 5.5.23, I am getting the following issue and I am not able to access my application. SEVERE: Error listenerStart Dec 5, 2007...
0
by: Arun21084 | last post by:
Hi, Recently I installed an application HP SIP(Service Information Portal) on a Windows 2000 server.The application comes along with an installation of Tomcat 5.0.19. Already there was an Apache...
0
by: JimDaley | last post by:
I am running Windows server 2003 and Apache tomcat 5.0.25. If I reboot the system and once it is back up type in "net start "apache tomcat" it returns in 10 seconds saying it didn't start the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.