wood burning stoves 2.0*
The moose likes Linux / UNIX and the fly likes Apache SSL Module on Ubuntu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Apache SSL Module on Ubuntu" Watch "Apache SSL Module on Ubuntu" New topic
Author

Apache SSL Module on Ubuntu

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9467
    
    2

Guys,

I just installed apache2 using synaptic on my Ubuntu. I wanted to enable SSL for my apache2 installation and for the very same purpose, I tried the following:


just to find out that I get the following response:


Any ideas?

SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9467
    
    2

Seems that it is already installed along with when I installed apache server.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9467
    
    2

But when I did a apache2ctl -M, it is not listing the mod_ssl module. How to know if this is installed or not and if not how to do it?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16158
    
  21

I think SSL is pretty well integrated these days. However, configure SSL in your apache setup and if you get errors on the SSL config statements, you'll know that it's not installed. Or that it's not switched on. In which case, look at your /etc/apache2 config files. You should have an SSL config file in there somewhere, I think.


Customer surveys are for companies who didn't pay proper attention to begin with.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9467
    
    2

But before the SSL, I need to set up the mod_jk so that my Apache server communicates with Tomcat sitting behind. As i browsed through the websites, it all pointed to me that I should configure this in the httpd.conf by uncommenting just two lines, but to my surprise my httpd.conf located under /etc/apache2 is empty. Bemused.
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

Its normal for httpd.conf to be empty. modern debian based distros (and Ubuntu is Debian based) leave it empty, or under the control of the distribution.

most of what you want to control is done by making logical links in the appropriate subdirectory. Look at your /etc/apache2/sites-available directory, put your local server config there. Then go to ../sites-enabled and make a softlink to the sites-available.

Same approach for mods

All this stuff is standard these days.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9467
    
    2

I have the following configuration:

workers.properties located in /etc/apahe2:


Tomcat configuration in server.xml:



The apache httpd.conf looks like this:


After all this, trying to access my webapp through Apache gave me a 404. Please correct me where it went wrong?
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9467
    
    2

I just found out from the error log that the Apache looks for the files to be located under /var/www and it does not seem to respect the httpd.conf configurations.



From the above log entry it is evident that when I accessed http://localhost/examples it straightaway looked for it under /var/www as I have configured my DocumentRoot as /var/www. Should this be a reason for the mod_jk not to work?
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9467
    
    2

Also noticed this peculiar thing. Everytime when I start my apache server, I get a warning saying that jk_module is already loaded. Why is this? Could this be the source of my original problem above?

~$
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9467
    
    2

Just found out that the jk_mod is enabled elsewhere other than from my httpd.conf (in mods-enabled and mods-available). So uncommented them and got rid of the warning above. But still not able to find my way out to solve the mystery of making apache communicate with Tomcat using the configuration that I made in my above post.

I'm sure this is just a simple configuration missing somewhere but where is the question for me now. I guess this must have been done a zillion of times by others. Google search did not pull any satisfying results. Any one from here could help me?
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9467
    
    2

OK. So finally I made it to wok. There was the VirtualHosts entry missing in my httpd.conf. As soon as I added it to my httpd.conf, it started working:

My httpd.conf looks like:

1

But I'm now not able to view any apache manuals which happens to be showing up on access of the following url:

http://localhost/manual/en/index.html - Gives now a 404 ??? This happened after I added the VirtualHost in my httpd.conf.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9467
    
    2

I commented out direct access to Tomcat by commenting out the following line:



in Tomcat server.xml file of my Tomcat installation thereby preventing direct access to Tomcat.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Apache SSL Module on Ubuntu