Re: [opensuse] Apache server side includes openSUSE 10.3 x86_64
Ysgrifennodd Per Jessen:
Just use the Apache manual and ignore most others.
That makes sense. The only trouble is that I couldn't understand it. I still don't know if I should have mod_include installed, and if I do how to do it, or even whether I already have it installed.
You set it up in /etc/sysconfig/apache - there's a variable specifying which modules to load.
That's one of the most intimidating config files I've ever come across, so I don't really understand it. It does seem to say that the include module is installed by default and it does have an entry saying: APACHE_MODULES="actions alias auth_basic authn_file authz_host authz_groupfile authz_default authz_user authn_dbm autoindex cgi dir env expires include log_config mime negotiation setenvif ssl suexec userdir php5 rewrite dav dav_svn authz_svn" So, since include in in that list, I would expect to be able to do server side includes: but I can't.
I use 'AddOutputFilter INCLUDES shtml' instead of the addhandler.
I tried this both in addition to the addhandler and instead of it. When I had both, there was no change at all. The html was not parsed. When I replaced AddHandler with AddOutputFilter, the html was parsed, but the include was not included (i.e. it was just treated as a comment). Sorry if it's me that's being thick. Wouldn't be the first time. But I'd really like to get this going if I can. Thanks for the response. Cheers Peter -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Peter Bradley said the following on 11/21/2008 05:37 PM:
Ysgrifennodd Per Jessen:
Just use the Apache manual and ignore most others.
That makes sense. The only trouble is that I couldn't understand it. I still don't know if I should have mod_include installed, and if I do how to do it, or even whether I already have it installed.
You set it up in /etc/sysconfig/apache - there's a variable specifying which modules to load.
That's one of the most intimidating config files I've ever come across, so I don't really understand it. It does seem to say that the include module is installed by default and it does have an entry saying:
APACHE_MODULES="actions alias auth_basic authn_file authz_host authz_groupfile authz_default authz_user authn_dbm autoindex cgi dir env expires include log_config mime negotiation setenvif ssl suexec userdir php5 rewrite dav dav_svn authz_svn"
So, since include in in that list, I would expect to be able to do server side includes: but I can't.
I'd go further than that. I've added modules there and Apache complains. Obviously its not as simple as that. Where should the modules live? Only in /usr/lib/apache2 ? Apparently not. And this is all openSUSE specific, its not in the Apache manuals.
I use 'AddOutputFilter INCLUDES shtml' instead of the addhandler.
I tried this both in addition to the addhandler and instead of it. When I had both, there was no change at all. The html was not parsed. When I replaced AddHandler with AddOutputFilter, the html was parsed, but the include was not included (i.e. it was just treated as a comment).
I've tried this with fcgi putting it in /etc/sysconfig/apache and in /etc/apache2/config.d/ without success.
Sorry if it's me that's being thick. Wouldn't be the first time. But I'd really like to get this going if I can.
I wouldn't call myself an Apache expert, but I've set up it up on many other implementations of Linux. The way openSUSE has created the set-up seems to have many non-independent interactions that have to be aligned. Call this strong or un-necessary "coupling". Other systems have a simple, single config file. I suspect a lot of this is brought about by YAST. I do note that the YAST module for Apache seems to ignore any files you create in vhosts.d/ and doesn't seem to build its list by scanning what's in /usr/lib/apache2, /usr/lib/apache2-event, /usr/lib/apache2-prefork and /usr/lib/apache2-worker to see what modules are available. I've experimented with this and been disappointed. The killer is that /etc/apache2/sysconfig.d/loadmodule.conf gets rebuilt on startup. WHY ?? Personally I think that zapping a config file like that is a bad thing. I'm not saying that there shouldn't be dynamically built config files, but usually the ones called "*.conf" are for humans to edit or humans to run an explicit program to change, not to be altered 'behind the scenes', every time. Call is something else! Please! Hours wasted editing that because it looked like the closest thing to the sub-config file that openSUSE had "broken out" rather than have one single config file like other distributions. Heck, I put stuff in /etc/sysconfig/apache's LOADMODULES and they were never included automagically in /etc/apache2/sysconfig.d/loadmodule.conf. Confusing as all hell. -- IOException: Jovian moons misaligned. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Ysgrifennodd Anton Aylward:
The killer is that /etc/apache2/sysconfig.d/loadmodule.conf gets rebuilt on startup. WHY ?? Personally I think that zapping a config file like that is a bad thing. I'm not saying that there shouldn't be dynamically built config files, but usually the ones called "*.conf" are for humans to edit or humans to run an explicit program to change, not to be altered 'behind the scenes', every time. Call is something else! Please! Hours wasted editing that because it looked like the closest thing to the sub-config file that openSUSE had "broken out" rather than have one single config file like other distributions. Heck, I put stuff in /etc/sysconfig/apache's LOADMODULES and they were never included automagically in /etc/apache2/sysconfig.d/loadmodule.conf. Confusing as all hell.
Well it certainly has me confused! I'm glad I'm not the only one, because I was beginning to seriously doubt my own ability to read. However, does anyone have the solution? It can't be all that difficult, can it? Cheers Peter -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* Peter Bradley
Well it certainly has me confused! I'm glad I'm not the only one, because I was beginning to seriously doubt my own ability to read. However, does anyone have the solution? It can't be all that difficult, can it?
All I ever did was open YaST2 -> System -> /etc/sysconfig Editor -> WWW -> Apache2 APACHE_MODULES add module names here I used to do some by hand, but yast is easier. -- Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://counter.li.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Patrick Shanahan said the following on 11/21/2008 08:49 PM:
* Peter Bradley
[11-21-08 19:26]: Well it certainly has me confused! I'm glad I'm not the only one, because I was beginning to seriously doubt my own ability to read. However, does anyone have the solution? It can't be all that difficult, can it?
All I ever did was open YaST2 -> System -> /etc/sysconfig Editor -> WWW -> Apache2
APACHE_MODULES add module names here
I used to do some by hand, but yast is easier.
You mean NOT use Yast2 -> network Services -> HTTP Server as I have been doing? Its the only 'top level' mention of a http server I saw. -- Let us never forget that government is ourselves and not an alien power over us. The ultimate rulers of our democracy are not a President and senators and congressmen and government officials, but the voters of this country.” -- Franklin D. Roosevelt -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* Anton Aylward
You mean NOT use
Yast2 -> network Services -> HTTP Server
as I have been doing? Its the only 'top level' mention of a http server I saw.
I haven't that I remember, but you can. I just started the apache2 server in the run-level editor and drove on. It has been running for about five or six years that way. :^) -- Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://counter.li.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Patrick Shanahan said the following on 11/21/2008 09:43 PM:
* Anton Aylward
[11-21-08 21:07]: You mean NOT use
Yast2 -> network Services -> HTTP Server
as I have been doing? Its the only 'top level' mention of a http server I saw.
I haven't that I remember, but you can. I just started the apache2 server in the run-level editor and drove on. It has been running for about five or six years that way. :^)
Which means you didn't start 'virgin' with 11.0. As far as I can make out, some time in the past openSUSE had a more 'traditional' single configuration file and there were tools for an upgrade (to 2.x for some value of x) that did grep/sed/awk to convert that single file into the format I now see on my (virgin) 11.0. As I said, the YAST2 path I quoted is the one that mentions the HTTP server and the one you see at the 'high level' as you step though the main menu. The 'edit sysconfig' hides it much lower down and what you do with it assumes you already know how the SUSE implementation differs from the more 'traditional' config. In fact until you mentioned it I didn't even know it was there. I'd been editing stuff under /etc/sysconfig/apache/ manually. -- Why do cats get fur balls and dogs don't? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* Anton Aylward
Which means you didn't start 'virgin' with 11.0.
Guess not, been with SuSE/openSUSE since 5.x, and have had a lotta help from this forum. Is there something special to start apache2 'virgin' ?
As far as I can make out, some time in the past openSUSE had a more 'traditional' single configuration file and there were tools for an upgrade (to 2.x for some value of x) that did grep/sed/awk to convert that single file into the format I now see on my (virgin) 11.0.
I haven't seen *much* change....
As I said, the YAST2 path I quoted is the one that mentions the HTTP server and the one you see at the 'high level' as you step though the main menu. The 'edit sysconfig' hides it much lower down and what you do with it assumes you already know how the SUSE implementation differs from the more 'traditional' config.
I'm not here to argue with you. I just told you what I did!
In fact until you mentioned it I didn't even know it was there. I'd been editing stuff under /etc/sysconfig/apache/ manually.
And I'm sure that you will find much more that "you didn't know about", as I do every day, and I'm becoming ancient. I even remember Momma *making* me wear knee pants and I felt like the village clown. -- Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://counter.li.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Anton Aylward wrote:
Patrick Shanahan said the following on 11/21/2008 09:43 PM:
* Anton Aylward
[11-21-08 21:07]: You mean NOT use
Yast2 -> network Services -> HTTP Server
as I have been doing? Its the only 'top level' mention of a http server I saw.
I haven't that I remember, but you can. I just started the apache2 server in the run-level editor and drove on. It has been running for about five or six years that way. :^)
Which means you didn't start 'virgin' with 11.0. As far as I can make out, some time in the past openSUSE had a more 'traditional' single configuration file and there were tools for an upgrade (to 2.x for some value of x) that did grep/sed/awk to convert that single file into the format I now see on my (virgin) 11.0.
As I said, the YAST2 path I quoted is the one that mentions the HTTP server and the one you see at the 'high level' as you step though the main menu. The 'edit sysconfig' hides it much lower down and what you do with it assumes you already know how the SUSE implementation differs from the more 'traditional' config.
In fact until you mentioned it I didn't even know it was there. I'd been editing stuff under /etc/sysconfig/apache/ manually.
Anton,
I think it was 10.3 where apache changed from allowing server side includes
generally to only allowing server side includes that originate from the
directory from which the page is called or beneath it. I had to make changes as
well. However, you need to make changes that 'comply' with the new server side
include scheme, not changes that 'defeat' it. The reason they did it that way
was for security reasons.
If I am thinking straight (always suspect), the new way of doing things just
says "you can still use server side includes, but if you want to call from a
directory that isn't under where the page gets called from then you have to
define that directory explicitly in httpd.conf" (create and use a
httpd.conf.local instead of httpd.conf so your changes are not overwritten)
My pages (very un-elegantly) call parts from /srv/www/css /srv/www/images and
/srv/www/js. Most calling pages live below the normal document root of
/srv/www/htdocs so under the new SSI rule they can't call pieces from those
directories unless the directories are defined. So in httpd.conf.local, I just
define them:
################################ General Resource Directories
###########################
#
## include css Directory
#
Alias /css/ "/srv/www/css/"
Alias /css "/srv/www/css/"
Ysgrifennodd Anton Aylward:
You mean NOT use
Yast2 -> network Services -> HTTP Server
as I have been doing? Its the only 'top level' mention of a http server I saw.
OK, but what would I put in there, and on what page? Cheers Peter -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Anton Aylward wrote:
You set it up in /etc/sysconfig/apache - there's a variable specifying which modules to load.
That's one of the most intimidating config files I've ever come across, so I don't really understand it. It does seem to say that the include module is installed by default and it does have an entry saying:
APACHE_MODULES="actions alias auth_basic authn_file authz_host authz_groupfile authz_default authz_user authn_dbm autoindex cgi dir env expires include log_config mime negotiation setenvif ssl suexec userdir php5 rewrite dav dav_svn authz_svn" So, since include in in that list, I would expect to be able to do server side includes: but I can't.
I'd go further than that. I've added modules there and Apache complains. Obviously its not as simple as that.
Yes it is, honestly.
Where should the modules live? Only in /usr/lib/apache2 ? Apparently not.
Providing your own modules is a different story. If you stick to what openSUSE provides, you don't need to worry about where they are stored. /Per -- /Per Jessen, Zürich -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Peter Bradley wrote:
Ysgrifennodd Per Jessen:
Just use the Apache manual and ignore most others.
That makes sense. The only trouble is that I couldn't understand it. I still don't know if I should have mod_include installed, and if I do how to do it, or even whether I already have it installed.
Granted, the apache manual is perhaps not the most easily digested material in the world, but when you're going to be playing around with apache, you'll have to come to terms with it :-) 1. Yes, you need mod_include installed. 2. in openSUSE 11.0 this is done by amending the APACHE_MODULES line in /etc/sysconfig/apache2 (if/as necessary). I don't know if (2) is most easily done through YaST or not, I just use vi.
I use 'AddOutputFilter INCLUDES shtml' instead of the addhandler.
I tried this both in addition to the addhandler and instead of it. When I had both, there was no change at all. The html was not parsed. When I replaced AddHandler with AddOutputFilter, the html was parsed, but the include was not included (i.e. it was just treated as a comment).
Are you making these changes globally, or just for one virtual host? I would perhaps start out with doing it just for the one you're testing on, then make the change global later on. My setup has SSI enabled globally, and I've put it in mod_mime-defaults.conf : # # Filters allow you to process content before it is sent to the client. # # To parse .shtml files for server-side includes (SSI): # (You will also need to add "Includes" to the "Options" directive.) # AddType text/html .shtml AddOutputFilter INCLUDES shtml AddOutputFilter INCLUDES phtml XBitHack Off SSITimeFormat "%Y/%m/%d %T %Z" Also remember to enable SSI in the Options you're setting for the virtual host. SSI is off by default (see default-server.conf). cheers Per -- /Per Jessen, Zürich -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (5)
-
Anton Aylward
-
David C. Rankin
-
Patrick Shanahan
-
Per Jessen
-
Peter Bradley