SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have apache-tomcat-7.0.11 installed on Slackware 13.37 on my own pc ;its working fine for testing out html and jsp’s from the root directory which is:
/var/lib/tomcat/webapps/ROOT
I was wondering if I can enable php ,for example by putting a simple file such as info.php with code
<?php
phpinfo();
?>
I know some people use apache for php,and then get apache-tomcat to handle jsp requests(probably too complicated for me). Or they use xampp for html and php.
I'm not running any live system,only for testing and it would make sense to have files php,jsp,html all in one place i.e
/var/lib/tomcat/webapps/ROOT
Of course Apache (the web server) can handle php files, provided you set up properly its configuration files: see httpd.conf, php.ini and mod-php.conf in /etc/httpd.
By default in Slackware the document root is /srv/httpd/htdocs, which is a symlink to /var/www/htdocs (configured /etc/httpd/httpd.conf)
Other than that I really don't not know what Tomcat has to do with php ???
i'm using apache-tomcat as a web server ,which serves up html and java server pages at url http://localhost:8080 this is the one that I also want to serve up php.
This is in contrast to the apache web server which serves up html, and php at url
but it makes much more sense to me to use apache as a frontend to serve html and redirect from it php requests to mod_php and java stuff to apache-tomcat (with mod_proxy).
Or if you only want to use the port #8080 instead of 80, just replace "Listen 80" with "Listen 8080" in /etc/httpd/httpd.conf - and use another port for Tomcat, if you still need it
thanks for the replies. ponce thanks will read up from the links, it may be too complicated for someone at my level.
another option is xammp,played with it and found that after manually starting both xampp and tomcat ,a jsp using
con =DriverManager.getConnection("jdbc:mysql://localhost/andrew_accra","andrew","oburoni");
somehow does connect with the MySQL element in xammp ,and returns data showing tomcat7 from a slackbuild can connect with xammp. I wonder if I could get it to work the other way around?
i.e get the apache part of xammp to request tomcat to handle a jsp. Obviously apache in xammp isn't actually installed though as in an normal tomcat7 apache integration setup
Recently I have had some extra time and had another look at php and tomcat. Basically All I was trying to do was get php files to run on tomcat for a school web server set up allowing use of jsp,html,and php . This combination should just about cover everything for web development for schools; this article expresses my thinking :
into the webapps directory of tomcat ,stopedc and re-started tomcat, which unpacked the war.I found test.php and index.jsp in the unpacked JavaBrideTemplate621 directory. Then I found http://localhost:8080/JavaBridgeTemplate621/index.php then displayed perfectly also test.php worked fine displaying loads of info. test.php was found to contain the code phpinfo()
In summary I can now get php files to run from within tomcat
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.