Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Apache Includes not working

Apache Includes not working
Thread Tools
SirCastor
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status: Offline
Reply With Quote
Jul 4, 2001, 05:56 PM
 
I'm having trouble getting includes to work on pages I'm trying to serve. I've got the config file working properly I think.

Can anyone suggest some tests I can try, or something I can do to check if it works at all?
thanks
-Aaron
2008 iMac 3.06 Ghz, 2GB Memory, GeForce 8800, 500GB HD, SuperDrive
8gb iPhone on Tmobile
     
Eugene
Senior User
Join Date: Nov 2000
Location: Berkeley, CA
Status: Offline
Reply With Quote
Jul 4, 2001, 11:28 PM
 
What kind of includes are you trying to enable? And what changes have you made to httpd.conf?[/LIST]
     
gfxgeek
Forum Regular
Join Date: Feb 2001
Location: Silver Spring, MD, USA
Status: Offline
Reply With Quote
Jul 5, 2001, 12:02 AM
 
I'm having the same problems.

I've made sure the include module is loaded and that I have added the handler. And using the standard <BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier> &lt;!--include virtual=<font color = red>"/path/to/include"</font>--&gt; </font>[/code] does nothing for me
PowerMac G4 450mhz 256mb RAM 2/26gb HD RagePro128 Internal Zip OS X.1
iMacDVSE Graphite 500mhz 256mb RAM 30gb HD OS X.1
Macintosh SE 1mb RAM 2/800k FD OS 6.0.3
Macintosh Quadra 610 25mhz 4mb RAM 230mb HD OS 7.1
Macintosh Quadra 605 25mhz 4mb RAM 80mb HD OS 7.1
     
SirCastor  (op)
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status: Offline
Reply With Quote
Jul 5, 2001, 12:09 AM
 
Originally posted by Eugene:
<STRONG>What kind of includes are you trying to enable? And what changes have you made to httpd.conf?[/LIST]</STRONG>
I added the following line to make all html files parse

AddType text/x-server-parsed-html .html

I also uncommented the following:

#
# To use server-parsed HTML files
#
AddType text/html .shtml
AddHandler server-parsed .shtml

I get nothing with either .html or .shtml The code appears to be sound when I look at it in the browser. It just doesn't parse. It's rather upsetting. I'd really like this to work.

I'm trying to do the same thing as gfxgeek has up there, just getting blank space. though. The rest of the page renders fine.

-Aaron

[ 07-05-2001: Message edited by: SirCastor ]
2008 iMac 3.06 Ghz, 2GB Memory, GeForce 8800, 500GB HD, SuperDrive
8gb iPhone on Tmobile
     
timster
Dedicated MacNNer
Join Date: Oct 2000
Location: Washington, DC
Status: Offline
Reply With Quote
Jul 5, 2001, 12:26 PM
 
First you should find out if the SSI parser is working at all. You can probably do that by loading the page, then viewing the source. Find the line where the code should have been included. See if the

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>&lt;!--include virtual=<font color = red>"/foo/bar"</font>--&gt; </font>[/code]

appears. If it does, then the SSI parser isnt even being called because if it was working, then it would be removing that and replacing it with the code.

If the include line is missing, then that means it was parsed, but nothing is being put in.

That'll help narrow down the possibilities.

Also... You did restart apache after making the configuration changes?

-tim
     
SirCastor  (op)
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status: Offline
Reply With Quote
Jul 5, 2001, 01:26 PM
 
Originally posted by timster:
<STRONG>First you should find out if the SSI parser is working at all. You can probably do that by loading the page, then viewing the source. Find the line where the code should have been included. See if the

&lt;BLOCKQUOTE&gt;&lt;font size="1"face="Geneva, Verdana, Arial"&gt;code:&lt;/font&gt;&lt;HR&gt;&lt;pre&gt;&lt;font size=1 face=courier&gt;&lt;!--include virtual=&lt;font color = red&gt;"/foo/bar"&lt;/font&gt;--&gt; &lt;/font&gt;&lt;/pre&gt;&lt;HR&gt;&lt;/BLOCKQUOTE&gt;

appears. If it does, then the SSI parser isnt even being called because if it was working, then it would be removing that and replacing it with the code.

If the include line is missing, then that means it was parsed, but nothing is being put in.

That'll help narrow down the possibilities.

Also... You did restart apache after making the configuration changes?

-tim</STRONG>

My Code is showing up. So I guess that the parser is not working (Or at least not parsing this page) I did restart Apache. Really all I did was go into the Sharing System Preferences, and "stop" and "start" it again. That should do it, right?
I have to admit, this is all really pretty new to me.

-Aaron
2008 iMac 3.06 Ghz, 2GB Memory, GeForce 8800, 500GB HD, SuperDrive
8gb iPhone on Tmobile
     
gfxgeek
Forum Regular
Join Date: Feb 2001
Location: Silver Spring, MD, USA
Status: Offline
Reply With Quote
Jul 5, 2001, 02:56 PM
 
I'm just getting the include back in the source. Which I've already figured it wasn't parsing. But why? I even ps -ax'd httpd to make sure it was truly dead But everytime I start apache back up wether from cli or gui it seems to start 2 httpd. Not sure if this is the problem.
PowerMac G4 450mhz 256mb RAM 2/26gb HD RagePro128 Internal Zip OS X.1
iMacDVSE Graphite 500mhz 256mb RAM 30gb HD OS X.1
Macintosh SE 1mb RAM 2/800k FD OS 6.0.3
Macintosh Quadra 610 25mhz 4mb RAM 230mb HD OS 7.1
Macintosh Quadra 605 25mhz 4mb RAM 80mb HD OS 7.1
     
Eugene
Senior User
Join Date: Nov 2000
Location: Berkeley, CA
Status: Offline
Reply With Quote
Jul 6, 2001, 07:16 AM
 
Try adding a suffix to your html parts...like .sht:

AddType text/html .shtml .sht
AddHandler server-parsed .shtml .html
     
gfxgeek
Forum Regular
Join Date: Feb 2001
Location: Silver Spring, MD, USA
Status: Offline
Reply With Quote
Jul 6, 2001, 12:29 PM
 
Yeah I've already done that. For instance my includes are located in htdocs/includes/file.inc
PowerMac G4 450mhz 256mb RAM 2/26gb HD RagePro128 Internal Zip OS X.1
iMacDVSE Graphite 500mhz 256mb RAM 30gb HD OS X.1
Macintosh SE 1mb RAM 2/800k FD OS 6.0.3
Macintosh Quadra 610 25mhz 4mb RAM 230mb HD OS 7.1
Macintosh Quadra 605 25mhz 4mb RAM 80mb HD OS 7.1
     
SirCastor  (op)
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status: Offline
Reply With Quote
Jul 6, 2001, 02:09 PM
 
Originally posted by Eugene:
<STRONG>Try adding a suffix to your html parts...like .sht:

AddType text/html .shtml .sht
AddHandler server-parsed .shtml .html</STRONG>
No luck on my side. A good suggestion, but that shouldn't be necessary... the include should parse if it's .shtml or .html in my case. That's what the Config file says.
2008 iMac 3.06 Ghz, 2GB Memory, GeForce 8800, 500GB HD, SuperDrive
8gb iPhone on Tmobile
     
Eugene
Senior User
Join Date: Nov 2000
Location: Berkeley, CA
Status: Offline
Reply With Quote
Jul 6, 2001, 09:49 PM
 
Where are these includes located? Are they in ~yourname? If so, try looking at the yourname.conf file. I remember I had to edit that to enable FollowSymLinks in my userdir.
     
foamy
Senior User
Join Date: Sep 2000
Location: Shallow Alto, CA
Status: Offline
Reply With Quote
Jul 6, 2001, 10:42 PM
 
Around line 370 in my httpd.conf I have the following

&lt;Directory /&gt;
Options FollowSymLinks +Includes
AllowOverride All
&lt;/Directory&gt;

The default is

&lt;Directory /&gt;
Options FollowSymLinks
AllowOverride None
&lt;/Directory&gt;

The +Includes lets you use includes
The AllowOverride All, lets you use .htaccess files in individual directories IIRC.

Make a backup and edit those two lines and you should be in business.
     
SirCastor  (op)
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status: Offline
Reply With Quote
Jul 6, 2001, 11:07 PM
 
Originally posted by foamy:
<STRONG>Around line 370 in my httpd.conf I have the following

&lt;Directory /&gt;
Options FollowSymLinks +Includes
AllowOverride All
&lt;/Directory&gt;

The default is

&lt;Directory /&gt;
Options FollowSymLinks
AllowOverride None
&lt;/Directory&gt;

The +Includes lets you use includes
The AllowOverride All, lets you use .htaccess files in individual directories IIRC.

Make a backup and edit those two lines and you should be in business.</STRONG>
yeah, I have something similar to this in my .conf file. I changed it to match yours, but I'm still getting nothing. I've tried playing around with the individual directories as well. Still no luck. I've been reading over the manual, that's where I picked up this one..
2008 iMac 3.06 Ghz, 2GB Memory, GeForce 8800, 500GB HD, SuperDrive
8gb iPhone on Tmobile
     
gfxgeek
Forum Regular
Join Date: Feb 2001
Location: Silver Spring, MD, USA
Status: Offline
Reply With Quote
Jul 6, 2001, 11:09 PM
 
Sweet! That works. Thanks a million floamy.

Btw I now have 3 httpd's start when doing apachectl start.

Anyone have any idea?
PowerMac G4 450mhz 256mb RAM 2/26gb HD RagePro128 Internal Zip OS X.1
iMacDVSE Graphite 500mhz 256mb RAM 30gb HD OS X.1
Macintosh SE 1mb RAM 2/800k FD OS 6.0.3
Macintosh Quadra 610 25mhz 4mb RAM 230mb HD OS 7.1
Macintosh Quadra 605 25mhz 4mb RAM 80mb HD OS 7.1
     
foamy
Senior User
Join Date: Sep 2000
Location: Shallow Alto, CA
Status: Offline
Reply With Quote
Jul 7, 2001, 01:17 AM
 
Do you mean you see 3 httpd processes when running top or process viewer? If so, I think that's normal.... I've got 4 or 5 httpd processing going all the time.
     
Eugene
Senior User
Join Date: Nov 2000
Location: Berkeley, CA
Status: Offline
Reply With Quote
Jul 7, 2001, 05:14 AM
 
D'oh

I'm so sorry I missed such a critical piece of advice.

You have to add "Includes" to your httpd.conf, but generally not in the location foamy suggested.

Look about 20 lines down from the point he suggested. There's another set of rules. That's where you should add "Includes"

And you probably still have to edit youraccount.conf files to have includes work in userdirs.
     
dogzilla
Grizzled Veteran
Join Date: Sep 1999
Location: Boston, MA USA
Status: Offline
Reply With Quote
Jul 7, 2001, 07:40 AM
 
Does anyone know if there's any Apache config tools on the way? Having one would make things like this much easier.
     
gfxgeek
Forum Regular
Join Date: Feb 2001
Location: Silver Spring, MD, USA
Status: Offline
Reply With Quote
Jul 7, 2001, 08:37 AM
 
yeah I get 3 httpd when doing top.
PowerMac G4 450mhz 256mb RAM 2/26gb HD RagePro128 Internal Zip OS X.1
iMacDVSE Graphite 500mhz 256mb RAM 30gb HD OS X.1
Macintosh SE 1mb RAM 2/800k FD OS 6.0.3
Macintosh Quadra 610 25mhz 4mb RAM 230mb HD OS 7.1
Macintosh Quadra 605 25mhz 4mb RAM 80mb HD OS 7.1
     
kernel_panic
Junior Member
Join Date: Feb 2001
Status: Offline
Reply With Quote
Jul 7, 2001, 05:05 PM
 
Originally posted by dogzilla:
<STRONG>Does anyone know if there's any Apache config tools on the way? Having one would make things like this much easier.</STRONG>
Yeah! There's a really nice set of config tools that was just released a few weeks ago. The only downside is that it costs $1000!

It's called MacOS X Server 10.0
     
Eugene
Senior User
Join Date: Nov 2000
Location: Berkeley, CA
Status: Offline
Reply With Quote
Jul 7, 2001, 11:51 PM
 
Apache httpd spawns new processes when it receives more requests. Right now I have 6 httpd processes still showing up in top.
     
   
 
Forum Links
Forum 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 On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 05:08 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,