JSP with Apache/2.2.17 (Ubuntu) - apache

I'm running a Ubuntu Sever with Apache/2.2.17. I can't seem to run JSP I just get the source code in the browser. What am I doing wrong?
Thanks

What am I doing wrong?
Expecting that Apache HTTPD magically supports JSP. It doesn't. You need Apache Tomcat instead.
See also:
Our JSP wiki page - at the bottom you can find several tutorial links to get started properly.

Try this
1)get the mod_jk.so
2)include this in httpd.conf file
LoadModule jk_module modules/mod_jk.so
3)Then in virtual host section of httpd.conf
JkMount /test/*.jsp loadbalancer

put your jsp file in webapp dir in the tomcat directory. Run as localhost:8080/your.jsp from your browser. Also make sure tomcat is set properly by running localhsot:8080 form your browser.

Related

Apache HTTP Server stopped working when using "https://" in xampp localhost

Google chrome update their security. how to enable HTTPS:// in xampp?
1) There is the config file xampp/apache/conf/extra/httpd-ssl.conf which contains all the ssl specific configuration. The files starts with <IfModule ssl_module>, so it only has an effect if the apache has been started with its mod_ssl module. Open the file xampp/apache/conf/httpd.conf in an editor and search for the line
#LoadModule ssl_module modules/mod_ssl.so
remove the hashmark, save the file and re-start the apache.
2) Also if you your document root is not properly configured than it might give you permission denied error. check for DOC ROOT
Check the highlighted text
I found this here. Refer to this for any help.

How do I find out where my root URL is being served from in Apache?

I've recently got a VPS server and it came installed with CentOS, WHM and cPanel. I'm trying to find where the physical folder location the root URL of the server IP is being served. When I go to the root IP in a browser, I get a redirect to "/cgi-sys/defaultwebpage.cgi" with "SORRY!" and some error resolve details.
The server has a web-site running under "/cPanel" and also WHM runs on ":2083".
I'm trying take control of the content served directly at the /, and replace that defaultwebpage.cgi with an index.html.
I've tried httpd -V to check where the httpd.conf, is and then spotted a <VirtualHost *> in that config file, which points to a DocumentRoot of /use/local/apache/htdocs . But if I place index.html in this folder and try to hit it via /index.html, I still get routed to that defaultwebpage.cgi. Can anyone help me understand why its rerouting and not picking up that index.html?
Thanks.
You may want to try /var/www/html, at least that's in Ubuntu
If it's not it, then try going to /etc/apache2/apache2.conf and find the DocumentRoot option.
Hope this helps!

Configuring Apache on top of GF3 - Not working

I'm trying to configure Apache on top of Glassfish v3 using apj13.
But when I'm trying to access http://<server_name>/myApp but this is not working. It is keep on loading the page.
From Glassfish side I've not made any changes.
From Apache side I've edited the httpd.conf file to include virtual server using
JkMount /myApp/* worker1
There was no helpful logs in either from Glassfish or Apache.
Update:
Worker.properties file
worker.worker1.port=28081
worker.worker1.host=myservername
worker.worker1.type=ajp13
The application is using Primefaces if that helps.
Any help is much appreciated.!
Thanks.
I found the solution for this.
I was having wrong configuration (incorrect port) in my worker.properties file. Below is the correct one (for me)
worker.worker1.port=8009 //the port was wrong. Instead of having APJ port I had HTTP port
worker.worker1.host=myservername
worker.worker1.type=ajp13
Also I had included socket_connect_timeout to the properties file to check for any errors while communicating with JK and remote host.
Please note that I also had cluster enabled in my GF and I had to manually configured different APJ_LISTENER_PORT value in custer configuration page in Admin Console of GF.
Hope this might help someone.!

Where put workers.properties for mod_jk.so Tomcat connector to Apache httpd (OS X)?

I'm trying to set up the Tomcat 7 connector mod_jk.so on OS X (10.8.3) so that calls to Tomcat will go through httpd from apache 2.2. The file mod_jk.so is in place. But where does workers.properties go? The instructions at http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html just don't seem to say.
I know you're now using mod_proxy but I'm answering this for the record, at least to include the info when your *nix packaging framework is involved.
In Debian, the package apache2 installs apache with the configuration directory /etc/apache2/mods-available and the seperate package libapache2-mod-jk places an apache config file in this directory called jk.conf, which gets pulled in by apache at start-up.
jk.conf has the JkWorkersFile directive.
The libapache2-mod-jk package also installs a workers.properties file under /etc/libapache2-mod-jk.
So for OS X, you put your workers.properties file anywhere, e.g. rationally in the same dir as the httpd.conf, and then you have to put the directive either in your httpd.conf file, or that might contain an Include to pull in everything in a directory, e.g. conf.d where you can put custom stuff in your own files that won't get interfered with at package upgrades.
Please put your workers.properties file according to your JkWorkersFile configuration:
JkWorkersFile /etc/httpd/conf/workers.properties
I had the same problem. But later I found that I should first look whether I am using mod_jk.so or mod_proxy_ajp in httpd.conf. I turned out to be tha later one. So instead of editing the worker.properties, which I don't have, I should edit the httpd.conf: Add a ProxyIOBufferSize directive to Apache httpd's configuration.
ProxyIOBufferSize 65536
Hope it helps.
Ref: Here at the bottom of the page.

setting up mod_jk on the Apache HTTP web server2.2.13

So I'm trying out JSP for the first time. I found a tutorial that details the installation of the tomcat server and the mod_jk Apache module, but it's a bit outdated. Right now, I've got everything installed and the mod_jk.so file in the modules folder, along with the corresponding loadModule line in the httpd.conf file. The tutorial tells me to copy a file called 'workers.propperties' to the apache conf directory and do some changes inside it, but there's no such file in the win32 binary installation. However, there is a file in the zipped source code, but I'm not sure if I should use it.
I have installed JDK1.6.0U17/JRE6.0/Apache HTTPServer2.2.13/Tomcat6.0.20/Mod_JK1.2.28/Vista
First this question: do you actually need Apache HTTP Server for other purposes? If not, just leave it aside and run Tomcat standlone. I've namely seen too often that starters are somehow under the impression that they need both Apache HTTP Server and Apache Tomcat to be able to run JSP's. This is untrue. Just Tomcat is enough. It's a webserver and servlet container in one.