473,796 Members | 2,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2849
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*******@attgl obal.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*******@attgl obal.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('whoa mi') } 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*******@att global.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*******@attgl obal.net
=============== ===
Mar 5 '06 #4

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

Similar topics

1
5259
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 I have is catalina.sh and startup.sh in $TOMCAT_HOME/bin. There is no tomcat.conf file for this version either. Should I create my own shell script? What should be in it? Should it just call catalina.sh or startup.sh? Where should I put this...
5
38006
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
2300
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 connected to the internet previously or are currently online"
9
3336
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 information, I have a customized 500-100 page that sends the value of various session variables via email to my support site. The situation: On the home page of the site, the FIRST THING that is done is a Session
16
4227
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 project in debug mode (by hitting F5) it gives an error message "Error while trying to run project: Unable to start debugging on the web server.
1
1503
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 c:\java\jdk1.5\lib\tools.jar; when i start tomcat startup.bat its blinking and if i start from command prompt its showing this message---your JAVA_HOME should point to jdk not jre as well this program need a jdk not jre. Please help me out of this...
1
12236
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 10:24:10 AM org.apache.catalina.core.StandardContext start SEVERE: Context startup failed due to previous errors How should I resolve it.
0
4216
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 2 running on the server used by other application. Once after installation of the product(HP SIP), I tried to restart the Tomcat 5.0.19 process using below methods(errors reported below respectively) 1) services.msc console Could not start...
0
2172
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 service. If I look at the task manager it's running. If I kill tomcat5 and do the net start again it starts it fine. It looks like the first time after a reboot it takes 20 seconds to start. Everytime after that it starts in about 5 seconds. So my guess...
0
9531
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10237
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7553
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5446
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.