LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-07-2009, 09:52 AM   #1
Sysop1911
Member
 
Registered: Dec 2007
Posts: 30

Rep: Reputation: 15
Basic questions about Apache web server and virtual hosts


I run a web server with Apache 2.2. Right now I have two virtual hosts- one for port 80 and the other for port 443. Both are using the same documentroot. First question: is this a problem that they have the same documentroot path?

I have a <Location> </Location> tags setup for the part of the URL that will require SSL and PKI login in the VH for the site on 443.

I'm trying to setup PKI for login purposes to the admin side of our CMS, but am having conflicts.

Second question, all the setting right now for SSL (SSLCertificateFile, SSLCertificateChainFile location files, etc) are in a file called vhosts.conf within the Virtual Hosts tags. Second question: should all of these settings be in the ssl.conf or does it not matter as long as the main httpd.conf includes the vhosts.conf file?

Sorry if this is hard to make out. Bottom line, I need to setup PKI (CAC login) for the admin side of our web server's Content-Mangement system and I'm having trouble. I have the require cert and key file and all that.

Thanks.
 
Old 05-07-2009, 01:31 PM   #2
wolfperkins
Member
 
Registered: Oct 2007
Location: Val-des-Monts, Québec, Canada
Distribution: CentOS, RHEL, Fedora
Posts: 110

Rep: Reputation: 16
Quote:
First question: is this a problem that they have the same documentroot path?
You can have apache bind to multiple ip addresses and ports and still share the same content where all vhosts entries point to the same file system location.

Quote:
Second question: should all of these settings be in the ssl.conf or does it not matter as long as the main httpd.conf includes the vhosts.conf file?
It does not matter as long as files are included. From a clarity point of view thought it would be less confusing to have the SSL global stuff defined in the ssl.conf.

What are your specific conflicts? Which CMS are you trying to deploy?
 
Old 05-08-2009, 08:07 AM   #3
Sysop1911
Member
 
Registered: Dec 2007
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by wolfperkins View Post
You can have apache bind to multiple ip addresses and ports and still share the same content where all vhosts entries point to the same file system location.
I only partially understand what you're saying here. It is only 1 server with 1 IP address we're using. The conf files were setup before I got here. For some reason there are two virtual hosts setup (both setup in vhosts.conf), one for port 80 and another for port 443, but both are pointing to the same documentroot folder. I guess you're saying that's it's okay to have both Vhosts pointing to the same directory. Is that correct?

Quote:
Originally Posted by wolfperkins View Post
It does not matter as long as files are included. From a clarity point of view thought it would be less confusing to have the SSL global stuff defined in the ssl.conf.
That's what I thought. Some guy told me that the problem might be that I had everything setup in the vhosts.conf file and not the ssl.conf file, but that didn't make sense to me.


Quote:
Originally Posted by wolfperkins View Post
What are your specific conflicts? Which CMS are you trying to deploy?
When a content manager tries to log into the admin site of the CMS with the CAC card, it asks for their PIN, and the load page bar at the bottom loads up to 100%, but then nothing happens, the page doesn't come up, it just stays where it is.

The CMS is eZ Publish. A company in Norway (www.ez.no).

Here is what I need to setup: I want the normal site, which is accessible to the public without login or anything. That's the vhosts for port 80, obviously. So, let's say that the URL is "www.blah.com". Then I need the admin site to be CAC accessible only. The admin site's URL is "www.blah.com/admin". So whenever someone goes to www.blah.com/admin, it will ask for their CAC PIN and check their certs. I've got the <Location> </Location> tags in there for this. Right now we're using username and password log in for the admin side. This would be the vhost for port 443. I have the certificate I need and all that.

Another thing is that the main httpd.conf file had documentroot set to a different location than the one setup in the vitual hosts. Is this a problem? Thanks for your help.
 
Old 05-12-2009, 10:40 AM   #4
wolfperkins
Member
 
Registered: Oct 2007
Location: Val-des-Monts, Québec, Canada
Distribution: CentOS, RHEL, Fedora
Posts: 110

Rep: Reputation: 16
Quote:
Originally Posted by Sysop1911 View Post
I guess you're saying that's it's okay to have both Vhosts pointing to the same directory. Is that correct?
Yes.

Quote:
Originally Posted by Sysop1911 View Post
Then I need the admin site to be CAC accessible only. The admin site's URL is "www.blah.com/admin".
You need to define a rewrite rule such that any traffic coming to port 80 targeting /admin be rerouted to https://www.blah.com/admin. That would be defined in the port 80 vhost section.
 
  


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
vsftpd, web uploads, vsftpd virtual users, apache virtual hosts, home directories jerryasher Linux - Software 7 02-18-2007 06:29 AM
Basic questions about mail / web server mazzo Ubuntu 2 12-27-2006 10:16 PM
AuthType Basic using Virtual Hosts rioguia Linux - Security 3 06-08-2005 11:52 PM
Virtual Hosts in Apache Server irclord Linux - Networking 5 09-02-2003 01:29 PM
Apache Virtual Hosts questions b_usa Linux - General 8 03-02-2003 10:41 PM

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

All times are GMT -5. The time now is 10:07 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