Hey folks,
Actually I was expecting some “alias” modification on my .profile; therefore, instead of “cd /usr/local/another_folder/tomcat/bin/” I write just e.g. “cd tomfolder”, and for .sh file another alias for “/usr/local/another_folder/tomcat/bin/startup.sh”. But I don’t know how to do it. I looked some tip&tricks websites and applied the things that they said, but didn’t work. So can you help me with aliases? (I think I should modify system-wide file e.g .profile to allow every user to use same aliases)
The tomcat is bundled with a suite that I used, so every modification that I do on it needs restarting Tomcat.
cya,
First of all you don’t have to change to the dir where the command is. You can also type:
/usr/local/another_folder/tomcat/bin/startup.sh
wherever you are to start the script. You know how to use TAB on the console?
Why don’t you run tomcat as a daemon? Copy the built in start script to /etc/init.d and go to Yast System runlevel editor to let your computer start it at boot time.
Running tomcat with root rights is really risky. Tomcat should run under a restricted system user.
I still suggest using the internal tomcat scripts included with the SuSE as they also support user switching to non-privileged u:tomcat,g:tomcat thus giving additional system security in case there’s a security flaw in Tomcat.
I chmod’ed tomcat/logs/catalina.out to a+w , because when I try to run startup.sh with my user privileges it gives error like cannot write to catallina.out. So now I can run tomcat without root privileges (I hope I reduced that vulnerability a little bit
I didn’t work! so I write whole path even I was in the same path.
3)When I click the soft links on my desktop it ask me to “run” or “run in a terminal”. What I want to do is I run it on a terminal but not to be closed by itself; therefore there will be a change to trace the log output. Is it possible?
(After Chrysantine’s Entry)To let Tomcat run more secure i.e. creating another user named e.g tomcat with min privileges, then let soft links run on my desktop, is going further to a scripting level, huh?
As Henders said, it was aimed at the original poster as well - he does su - everytime he wants to launch tomcat because the directories are owned by root (or tomcat if you’re using the Tomcat package) - if you were to simply launch Tomcat with your command line it wouldn’t work (due to permission issues)
The right way to do it is to use the Tomcat package, then modify the scripts - the Tomcat RPM from SuSE creates a non-privileged tomcat user and group, which you can then use on your own Tomcat installation - also it creates a symlink and init script so you can either have it start/stop on shutdown or manually start / restart.