• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Bear Bibeault
  • paul wheaton
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Mikalai Zaikin
  • Piet Souris
Bartenders:

Apache SSL Module on Ubuntu

 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Seems that it is already installed along with when I installed apache server.
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Saloon Keeper
Posts: 27276
193
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 4803
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Poop goes in a willow feeder. Wipe with this tiny ad:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
reply
    Bookmark Topic Watch Topic
  • New Topic