LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-20-2011, 08:37 AM   #1
Black187
LQ Newbie
 
Registered: Nov 2005
Posts: 26

Rep: Reputation: 0
[Centos] Apache web server - SSL for specific folder


Hi,

I have a problem with my WEB server. I can access it via port 80 (normal http), but I want to restrict access to special folder with SSL (https).

So, part of my httpd.conf looks like this:

Listen 80
DocumentRoot "/var/www/html"


Just the default values...

So everybody who comes to the web like this http://192.168.1.1/, can see everything.

But if somebody wants to enter my subfolder (http://192.168.1.1/admin/), it must be only with https (SSL). How can I specify this in /etc/conf.d/ssl.conf?

So far, this is my ssl.conf

# HTTPS with SSL
LoadModule ssl_module modules/mod_ssl.so
Listen 443



<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /sslcert/server.cer
SSLCertificateKeyFile /sslcert/server.key
SSLVerifyClient require
SSLVerifyDepth 1
SSLCACertificateFile /sslcert/ca.cer
DocumentRoot "/var/www/html/admin"
ServerName 127.0.0.1
</VirtualHost>



Edit: Nevermind, got the solution:

<Directory /some/where/important>
SSLRequireSSL
</Directory>

Last edited by Black187; 04-20-2011 at 08:42 AM. Reason: Solution...
 
Old 04-20-2011, 07:08 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Well done posting back your configuration correction, off the 0-reply list now.
 
Old 04-20-2011, 10:38 PM   #3
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
And allow me to put it in code tags for you, so the next guy doesn't have to slog through an unformatted post.

Quote:
Originally Posted by Black187
Code:
<Directory /some/where/important>
  SSLRequireSSL
</Directory>
Bingo.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Centos 5.4 Apache 2.2.3 web server problem with virtualhost dalvis Linux - Server 1 07-30-2010 02:28 AM
Just added ssl to my apache web server... trist007 Linux - Newbie 1 01-07-2010 03:11 PM
LXer: APACHE web server and SSL authentication LXer Syndicated Linux News 0 09-05-2009 12:30 PM
Sharing specific folder or file in apache server farid_lmu Linux - Server 1 02-10-2009 08:00 AM
Unable to Import SSL to Apache Web Server carlosinfl Linux - Server 5 09-15-2008 10:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration