The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
FreeBSD Support
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 SSI vs Virtual Hosting - Apache
Author: el_kab0ng 
Date:   02-08-00 04:15

Ok...I've been putting off this dreaded question for some time now...but judging by the immense help you guys/gals have given me over the past few days, I wanted to throw this one at ya....

As some might know, I have decided to virtually host websites off my BSD 4.0 RELEASE machine using Apache 1.3 with the PHP plugin.

My main intention was not to virtual host, which is why I configured my server to the default standards, but as of late I have decided to start hosting, which forced a reconfiguration.

So let me start by stating what has been done:

By default, the server has DocRoot set to ../share/apache/htdocs...and because I want to host, I am forced to "turn off" that part of the server and set up my domain as a "virtual host", meaning placing the information within the <VirtualHost></VirtualHost> container. Not that this is an issue, because I have in the past done this as a default when I knew there was going to be hosting done.

I am doing the hosting by named based hosting, not IP hosting...meaning all domains will have the same IP, and it's up to Apache to determine which directory goes where. I have quite alot of information stuck in /htdocs...and instead of creating a new dir and moving all the information over, I have just set the <VirtualHost> container's Document Root to point to the same thing the DocumentRoot is set as in the default installation.

All this is fine and dandy, but here's my problem. Upon restart of Apache when setting my domain in a <VirtualHost> container, all my server side includes break.

In an effort to rectify the situation, I even went so far as to include a <Directory></Directory> container AFTER the <VirtualHost> container which lists all the Options allowed for the same directory as DocumentRoot (which is assigned in the <VirtualHost> container.

Here is a partial list of the <VirtualHost> and <Directory> containers...pertinant info has been omitted for posterity reasons.

<VirtualHost www.somedomain.com>
ServerAdmin some_email@domain.com
DocumentRoot /usr/local/share/apache/htdocs/
ServerName www.somedomain.com
ScriptAlias /cgi-bin/ "/usr/local/share/apache/cgi-bin"
ErrorLog /var/log/apache_error_log
CustomLog /var/log/apache_access_log combined
</VirtualHost>
<Directory "/usr/local/share/apache/htdocs">
Options Indexes FollowSymLinks MultiViews Includes ExecCGI
</Directory>

Any of this making sense?

Is there something I am missing that is causing all my SSI to break?



Reply To This Message
 
 RE: SSI vs Virtual Hosting - Apache
Author: el_kab0ng 
Date:   02-08-00 04:19

heh...apparently this forum either removes what it thinks as HTML tags, or ignores them altogether.

This is what I meant to show on the VirtualHost container:

[VirtualHost www.thirdnipple.org]
ServerAdmin nipple@thirdnipple.org
DocumentRoot /usr/local/share/apache/htdocs/
ServerName www.thirdnipple.org
ScriptAlias /cgi-bin/ "/usr/local/share/apache/cgi-bin"
ErrorLog /var/log/apache_error_log
CustomLog /var/log/apache_access_log combined
[/VirtualHost]
[Directory "/usr/local/share/apache/htdocs"]
Options Indexes FollowSymLinks MultiViews Includes ExecCGI
[/Directory]

replacing the []'s with the proper tags of course...

Reply To This Message
 
 RE: SSI vs Virtual Hosting - Apache
Author: Philip 
Date:   03-08-00 21:12

Does anything show up in your error logs? If so, that could be a big help. You might need to increase the warning level (probably don't need to, but you might).

The other thing to check is to ensure that you still have the necessary lines to tell Apache to look for SSI's in your files...

Reply To This Message
 
 RE: SSI vs Virtual Hosting - Apache
Author: el_kab0ng 
Date:   03-08-00 22:29

In this day in age where the lack of details can cause buildings to crumble in an earthquake...I have committed a grave error where syntax is concerned.

I fixed my SSI problem....but it wasn't anything other than user dumbness that caused it in the first place.

If you review the prior post (quoted below for reference) you will notice the lack of a trailing / after the cgi-bin. Once this was placed in the VirtualHost container, everything worked like a charm.

Strike one up for the Syntax g0ds....I apologize for anyone who waisted their brain power on such a pilot error.

[VirtualHost www.domain.com]
ServerAdmin email@domain.com
DocumentRoot /usr/local/share/apache/htdocs/
ServerName www.domain.com
ScriptAlias /cgi-bin/ "/usr/local/share/apache/cgi-bin" <------ Major pilot error.
ErrorLog /var/log/apache_error_log
CustomLog /var/log/apache_access_log combined
[/VirtualHost]
[Directory "/usr/local/share/apache/htdocs"]
Options Indexes FollowSymLinks MultiViews Includes ExecCGI
[/Directory]

Reply To This Message
 Forum List  |  Threaded View   Newer Topic  |  Older Topic 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org