LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 12-17-2011, 10:04 AM   #1
petelogan
Member
 
Registered: Mar 2003
Location: Luxembourg
Distribution: SuSE 11.4
Posts: 74

Rep: Reputation: 15
SSI under 12.1


I am trying to get SSI working on my localhost to serve up a consistent site header. This works on my remote host www.lameschmillen.com - look at the Site Map to see what I am doing - but I would like to able to use localhost as a test site before inflicting new content on to an unsuspecting world -

I get the page rendered, but without the header.

Like this -

Quote:
This is lameschmillen.com which is a coverall address for a number of websites.

If you are looking for the previous site, which is our personal website, it is now reassigned to lameschmillen.net. You can use that address or go directly to it here

Any problems, please feel free to email me Here
No witch, no warrior, no buttons.

Firefox/Tools/Web Developer/Web Console shows no attempt to serve the header. I suppose from this that SSI is not being attempted at all, ie is not enabled.

I am using the XBitHack method. I need to do this for compatibility with DigiKam photo galleries.

Here is my httpd.conf and .htaccess files on localhost (initial comments left out)

httpd.conf under root/etc/apache2

Quote:
### Global Environment ######################################################
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests.

# run under this user/group id
Include /etc/apache2/uid.conf

# - how many server processes to start (server pool regulation)
# - usage of KeepAlive
Include /etc/apache2/server-tuning.conf

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
ErrorLog /var/log/apache2/error_log

# generated from APACHE_MODULES in /etc/sysconfig/apache2
Include /etc/apache2/sysconfig.d/loadmodule.conf

# IP addresses / ports to listen on
Include /etc/apache2/listen.conf

# predefined logging formats
Include /etc/apache2/mod_log_config.conf

# generated from global settings in /etc/sysconfig/apache2
Include /etc/apache2/sysconfig.d/global.conf

# optional mod_status, mod_info
Include /etc/apache2/mod_status.conf
Include /etc/apache2/mod_info.conf

# optional cookie-based user tracking
# read the documentation before using it!!
Include /etc/apache2/mod_usertrack.conf

# configuration of server-generated directory listings
Include /etc/apache2/mod_autoindex-defaults.conf

# associate MIME types with filename extensions
TypesConfig /etc/apache2/mime.types
DefaultType text/plain
Include /etc/apache2/mod_mime-defaults.conf

# set up (customizable) error responses
Include /etc/apache2/errors.conf

# global (server-wide) SSL configuration, that is not specific to
# any virtual host
Include /etc/apache2/ssl-global.conf

# allow access to the entire filesystem by default
<Directory />
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>

# use .htaccess files for overriding,
AccessFileName .htaccess
# and never show them
<Files ~ "^\.ht">
Order allow,deny
Allow from all
</Files>

# List of resources to look for when the client requests a directory
DirectoryIndex index.html index.html.var

### 'Main' server configuration #############################################
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition. These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#
Include /etc/apache2/default-server.conf


# Another way to include your own files
#
# The file below is generated from /etc/sysconfig/apache2,
# include arbitrary files as named in APACHE_CONF_INCLUDE_FILES and
# APACHE_CONF_INCLUDE_DIRS
Include /etc/apache2/sysconfig.d/include.conf


### Virtual server configuration ############################################
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs-2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
Include /etc/apache2/vhosts.d/*.conf


# Note: instead of adding your own configuration here, consider
# adding it in your own file (/etc/apache2/httpd.conf.local)
# putting its name into APACHE_CONF_INCLUDE_FILES in
# /etc/sysconfig/apache2 -- this will make system updates
# easier
And .htaccess under root/srv/www/htdocs

Quote:
# Activate mod_includes

Options Includes

# Allow the XBitHack method of implementing SSIncludes.

XBitHack On
Many thanks for any help you can give me.

Last edited by petelogan; 12-17-2011 at 10:15 AM.
 
Old 12-17-2011, 11:33 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
And .htaccess under root/srv/www/htdocs
What is your DocumentRoot? In Suse it should be /srv/www/htdocs, so make sure that you put the .htaccess in the correct directory
Then make also sure that your index page has the execute bit on, e.g. if it's index.html, what gives:
Code:
ls -l /srv/www/htdocs/index.html
 
Old 12-17-2011, 12:34 PM   #3
petelogan
Member
 
Registered: Mar 2003
Location: Luxembourg
Distribution: SuSE 11.4
Posts: 74

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
What is your DocumentRoot? In Suse it should be /srv/www/htdocs, so make sure that you put the .htaccess in the correct directory
It serves the page, just not the SSI.

.htaccess file is in root/srv/www/htdocs

Quote:
Originally Posted by bathory View Post
Then make also sure that your index page has the execute bit on, e.g. if it's index.html, what gives:
Code:
ls -l /srv/www/htdocs/index.html
Gives this

-rwxr-xr-x 1 lameschm users 44 Nov 20 2004 /srv/www/htdocs/index.html

I set the Execute bit via Dolphin/file etc / Properties/Permissions/Executable

Problem is it works on the hosting server, but not on localhost, so I am doing something wrong here in the config files.

It's not the code, because that is a direct copy between both sites.

Check http://www.lameschmillen.com

to see the hosted site which works fine.

Somewhere in my local config files I have got it wrong.

Thanks for your time and help. I will go back to banging my head against the wall -

Pete
 
Old 12-17-2011, 01:12 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
.htaccess file is in root/srv/www/htdocs
If your DocumentRoot is the default /srv/www/htdocs, then .htaccess should be placed in that directory.
I don't know what you mean by root/srv/www/htdocs. If that by any chance a subdir of your /root directory? If it is, the .htaccess is not read, so that's why SSI don't work.

Other than that everything else looks fine.
 
Old 12-17-2011, 01:42 PM   #5
petelogan
Member
 
Registered: Mar 2003
Location: Luxembourg
Distribution: SuSE 11.4
Posts: 74

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
If your DocumentRoot is the default /srv/www/htdocs, then .htaccess should be placed in that directory.
I don't know what you mean by root/srv/www/htdocs. If that by any chance a subdir of your /root directory? If it is, the .htaccess is not read, so that's why SSI don't work.

Other than that everything else looks fine.
.htaccess is in /srv/www/htdocs

/srv/www/htdocs is a subdirectory of root by definiton.

Dolphin/root shows srv as a subdirectory.

It looks OK to me too.

Thank you for your help. It is much appreciated.

Peter
 
Old 12-17-2011, 05:00 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
/srv/www/htdocs is a subdirectory of root by definiton.

Dolphin/root shows srv as a subdirectory.
I cannot understand your directory tree layout. When you say root you mean / or /root? Can you use a xterm and run:
Code:
ls -l /
ls -l /root
ls -l /srv/www/htdocs
just to clarify things.

Also check /etc/apache2/default-server.conf and make sure you have:
Code:
AllowOverride All
 
Old 12-18-2011, 04:35 AM   #7
petelogan
Member
 
Registered: Mar 2003
Location: Luxembourg
Distribution: SuSE 11.4
Posts: 74

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
Also check /etc/apache2/default-server.conf and make sure you have:
Code:
AllowOverride All
It wasn't. It is now, and I have restarted the server but it makes no difference.

I get the page contents served up correctly, but no SSI.

Quote:
Originally Posted by bathory View Post
I cannot understand your directory tree layout. When you say root you mean / or /root? Can you use a xterm and run:
Code:
ls -l /
ls -l /root
ls -l /srv/www/htdocs
just to clarify things.
Sorry. It's my bad description. The file system is absolutely standard as installed by default.

The three commands give:-

http://www.lameschmillen.com/images/b1.png

http://www.lameschmillen.com/images/b2.png

http://www.lameschmillen.com/images/b3.png
 
Old 12-18-2011, 07:08 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,
Quote:
It wasn't. It is now, and I have restarted the server but it makes no difference.
Are you sure it's not your browser cache?
To test you can do the following 2 things:
Create a html file containing:
Code:
<html>
<body>
<!--#echo var="DATE_LOCAL" -->
</body>
</html>
give it the execute bit and see if you get the date.

Or you can put some gibberish in .htaccess and see if you get a 500 error, meaning that apache reads .htaccess files

Regards
 
Old 12-18-2011, 08:43 AM   #9
petelogan
Member
 
Registered: Mar 2003
Location: Luxembourg
Distribution: SuSE 11.4
Posts: 74

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
Hi,

Are you sure it's not your browser cache?
To test you can do the following 2 things:
Create a html file containing:
Code:
<html>
<body>
<!--#echo var="DATE_LOCAL" -->
</body>
</html>
give it the execute bit and see if you get the date.

Or you can put some gibberish in .htaccess and see if you get a 500 error, meaning that apache reads .htaccess files

Regards
Well, I did those two things one after the other.

The Date function worked, so we know it's serving SSI code.

The gibberish in .htaccess generated a 500 error code, so it's reading that as well.

Then, just on general principle, I tried localhost again, and it correctly served the header and buttons via SSI !!

I can not think of what I may have done that it suddenly came good, but I am inclined to agree with you that it may have been a browser cache problem of some kind which has now cleared itself.

Both Firefox and Konqueror did the same thing, though, which is what had me looking for a code error.

Although totally baffled, the fact is, it is now working, so I propose to not look a gift horse in the mouth and stop right there.

Thanks for all your help.
 
Old 12-18-2011, 09:34 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Both Firefox and Konqueror did the same thing, though, which is what had me looking for a code error
I guess it was the "AllowOverride None" in /etc/apache2/default-server.conf that overrides the "AllowOverride All" for /. BTW this is not good to use
Quote:
<Directory />
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Anyway since it's worked, you may mark the thread "Solved" from the "Thread Tools" on top of the page.

Regards
 
Old 12-19-2011, 06:20 AM   #11
petelogan
Member
 
Registered: Mar 2003
Location: Luxembourg
Distribution: SuSE 11.4
Posts: 74

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
I guess it was the "AllowOverride None" in /etc/apache2/default-server.conf that overrides the "AllowOverride All" for /. BTW this is not good to use


Anyway since it's worked, you may mark the thread "Solved" from the "Thread Tools" on top of the page.

Regards
I think you must be right. The order in which .conf files are loaded is a bit of mystery to me, and I must look into it.

Would I be right in thinking that the use of .htaccess files is good practice as they are always the last configuration file to be loaded ?

Thread marked Solved anyway, and thanks for all your help.
 
Old 12-19-2011, 07:14 AM   #12
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Would I be right in thinking that the use of .htaccess files is good practice as they are always the last configuration file to be loaded ?
The use of .htaccess is necessary in a shared VPS environment. Other that that it's better to use the apache configuration file. Read this for more details

Regards
 
Old 12-19-2011, 07:16 AM   #13
petelogan
Member
 
Registered: Mar 2003
Location: Luxembourg
Distribution: SuSE 11.4
Posts: 74

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
The use of .htaccess is necessary in a shared VPS environment. Other that that it's better to use the apache configuration file. Read this for more details

Regards
OK thanks. Will do.

Edit:

The first thing that says is
Quote:
You should avoid using .htaccess files completely if you have access to httpd main server config file. Using .htaccess files slows down your Apache server. Any directive that you can include in a .htaccess file is better set in a Directory block, as it will have the same effect with better performance.
But I have read elsewhere that the last thing you should do is edit httpd.conf as the consequences of a mistake can be disasterous in a production environment.

This doesn't overly concern me as my localhost is a pure test environment so I can make all the mistakes I want, up to and including a full apache reinstall without any problem.

It's just the intellectual satisfaction of understanding good practice and how things work.

Last edited by petelogan; 12-19-2011 at 07:21 AM.
 
  


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
SSI install on 10.2 WRXSTi SUSE / openSUSE 1 07-26-2007 05:38 PM
how is ssi enabled abtimoteo Ubuntu 1 07-10-2005 10:15 AM
SSI in Perl? @ngelot Programming 1 02-01-2005 01:10 AM
Redhat 9 Ssi redhatlover Red Hat 2 04-16-2004 07:51 PM
cant get ssi to work dsgdevil Linux - General 1 02-16-2003 01:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 05:44 AM.

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