logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache and SSI - 100% CPU load on some URLs
Author
EIKA



Joined: 22 Jan 2019
Posts: 43
Location: US

PostPosted: Sat 13 Jun '20 20:41    Post subject: Apache and SSI - 100% CPU load on some URLs Reply with quote

Hi all!

I run the latest Apache httpd-2.4.43-win64-VS16.zip under windows. Everything works fine except the one thing. I am (for some reason) forced to use SSI - Server Side Includes - for templates (header, footer) and some other variables like page title.

As stated, all works in general. But not when I use mod_autoindex and click table headers, like Name, Last modified, Size.

For e.g. Name sort automatically generates this URL: http://localhost/?C=N;O=D If I click it, httpd.exe goes to 50-100% load immediately. And there are no any entries in error_log or access_log. Server-status and server-info becomes available. Server doesn't respond to requests at all. As result, I cannot diagnose the root of problem.

If I avoid links like these:

/?C=N;O=D
/?C=M;O=A
/?C=S;O=A

all works just fine. So, all looks like conflict between SSI and parameters like "?", ";" or "=". Or maybe missed real paths that SSI don't like. Something like this.

I want to solve this issue, because I need both - SSI and Sort in mod_autoindex.

Here is example of my SSI call for HTML page <title>:
Code:
<!--#include virtual="/!!!_SSI${REQUEST_URI}TITLE.shtml" -->

"!!!_SSI" is folder that contains TITLE.shtml file with some text. For e.g. MY HOME PAGE.

The same files when moved to Linux works fine and I can use sort with no issues.

Any ideas please?
Back to top
EIKA



Joined: 22 Jan 2019
Posts: 43
Location: US

PostPosted: Sat 13 Jun '20 21:44    Post subject: Reply with quote

Problem is here.

When URL like this http://localhost/directory/!!!_SSI/TITLE.shtml

All works fine.

But when sort applies, location path becomes http://localhost/directory/?C=M;O=A/!!!_SSI/TITLE.shtml

And it causes httpd fail / CPU high load.

Any ideas?
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Sun 14 Jun '20 7:16    Post subject: Reply with quote

Looks to me like you are wanting a pretty looking custom indexes.

mod_autoindex is about all you need. Study the documentation:
https://httpd.apache.org/docs/2.4/mod/mod_autoindex.html

Some examples from dirt simple to complex to study:
https://github.com/martinlb/PrettyIndex
https://github.com/thirtyjin/Apache-Indexes
https://github.com/Darnel-K/NSSTFAI
Back to top
EIKA



Joined: 22 Jan 2019
Posts: 43
Location: US

PostPosted: Sun 14 Jun '20 10:36    Post subject: Reply with quote

Thanks for your reply, but any mod_autoindex stylers will not help me to solve 100% CPU load issue caused by SSI. I cannot use any of stylers because even one click to Sort will cause httpd fail.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Mon 15 Jun '20 3:20    Post subject: Reply with quote

I might have the advantage of using autoindex long before it had all the fancy style options in it.

I'm thinking your doing something like below in a html file, are you?
Note: The Include to /autoindexed_directory is the autoindexed directory by Apache.

Code:
  <!--#include file="header.html" -->
  <!--#include virtual="/autoindexed_directory" -->
  <!--#include file="foot.html" -->


Sorry to say that can not be done. A memory bubbled up to the surface that I tried the same thing long ago and ran into the same problem. I don't think I hit 100% CPU though. Also, 100% CPU can often mean a loop some how that just goes on forever.

For mod_autoindex directories the file configured for HeaderName is everything above the Apache generate index, ReadmeName is everything below. I'm sure your know this but this is the way I got it to work how I wanted.

I'm using css, php, perl and an Apache Handler (inserts the fish) with quite a lot of SSI. The ajority of it is in header.html.

The _theme directory has all files for the theme in it. I have not hidden or denied indexing of it like I normally would so it can be looked through. There are also text versions of the html files, most scripts and the .htaccess in used, it is in the top directory. There are 3 colors to choose from in the index.

http://blue.spottt.com/

Check the table links to test.
Back to top
Flanker27SK



Joined: 28 Jun 2020
Posts: 1
Location: Namur, Belgium

PostPosted: Mon 29 Jun '20 21:12    Post subject: Reply with quote

Thanks, I ran into a similar issue, as you guessed with the original poster's description, that stemmed from the use of excessively "fancy" options. I started using Apache so that I can create a site that will look better than a random Wordpress blog (and because I need to put music, movies, products, images and stories on that site, all from different universes and styles), so I must have overdone it with the functions...
Back to top
EIKA



Joined: 22 Jan 2019
Posts: 43
Location: US

PostPosted: Mon 06 Jul '20 23:10    Post subject: Reply with quote

I ended up SSI story because I was unable to solve this problem completely. I decided to refuse SSI all and wiped it out.
Back to top


Reply to topic   Topic: Apache and SSI - 100% CPU load on some URLs View previous topic :: View next topic
Post new topic   Forum Index -> Apache