LAMP: apache only displays text of HTML pages, no css presentation

Greetings,

I’ve set up LAMP under openSUSE 12.1 on both my laptop and my desktop using the Yast LAMP server-pattern package group. Apache2.2.1 works, PHP 5.3.8 works. What does NOT work is the display of the css presentation in any of the browsers on the desktop. In the browsers on the desktop, only the HTML text is displayed. On the laptop, everything is displayed perfectly in both firefox and konqueror. I’m convinced that somewhere, a setting needs to be changed, but I can’t find it. On both computers the browser versions are identical. The php5.conf, httpd.conf, mod_userdir.conf, and apache2 (etc/sysconfig) files are identical on both systems. The Settings in the Yast2 HTTP Server - including which modules are enabled or disabled - are also identical.

The path in the browsers looks like this: http://127.0.0.1/~user/Folder/Impressum.php

I even tried uninstalling and rebooting and reinstalling the package pattern group twice. It didn’t make a difference.

I only found one other mention of a similar problem – it was in the german language forums, and no one answered. Does anyone have any ideas at all?

I am a bit baffled about what is where and who displays what.

Your title says that Apache only “displays text of HTML pages, no css presentation”. But Apache does not display anything. It serves files to the HTTP clients. And the clients (in the case of HTTP often called “browser”, in the standard called “User Agent”) display (the rendered page).

When this is only a bit of casual expressing yourself and you mean that on one system (you call it a desktop) the pages are rendered without the CSS being followed, while on another system (laptop) this works as intended, then can you please confirm that in both cases you use exact the same browser and exact the same URL?

(BTW I can not believe that this has anything to do with fact that the one system is a so called laptop and the other a desktop).

Call the browsers user agents and HTTP clients, then, but apache is serving the files differently although the files and software installed are the same. I can’t identify what is different. I spent all day yesterday looking through documentation, checking the forum, and comparing the configuration. I must have missed something in the configuration but I’ve run out of ideas for where to look. Since my first post ever - although much more precise than this one - didn’t go over too well and was dubbed a “headache” for being too long and not in the correct quotes, I thought I’d better cut it short this time for ease of reading, and stick to what I’d checked and done so far.

“the same url”: The operations are local on both machines, and the user names are different. But the paths are the same. Each machine has the public_html directory, in which I have created a directory for the website I’m working on. Inside this directory are the files apache serves the clients. On both machines in both clients (the browsers konqueror and firefox) this is the URL: http://127.0.0.1/~user/Folder/Impressum.php , only with different user names. Even the names of the directories are the same.

The browser versions are also the same: firefox is version 14.0.1 for openSUSE on both machines. I mainly use firefox; I only used konqueror to further test the files and installation. When I access the files – there is also an Impressum.html file – using the browsers without apache, they are displayed with no problems whatsoever on both machines. So it must be the way apache is serving them. On one machine apache serves the files so that the client does not follow the css. Which leads me to believe there is a setting on one machine which is different. Normally I’d think that there was no difference in the software installation and configuration on the machines if I didn’t do anything different to them, but the desktop computer is – unpredictable, at least under openSUSE 12.1. I don’t know what else to call it. When I install packages on it, it sometimes happens that they aren’t configured correctly. I often have to check, and in this case I don’t know where to look.

Hippasus wrote:
> Call the browsers user agents and HTTP clients, then, but apache is
> serving the files differently although the files and software installed
> are the same.

I think was trying to say that your original message was pretty vague
and ambiguous. You need to try harder to say exactly what is happening
and also to provide evidence with actual computer output.

> “the same url”: The operations are local on both machines, and the user
> names are different. But the paths are the same. Each machine has the
> public_html directory, in which I have created a directory for the
> website I’m working on. Inside this directory are the files apache
> serves the clients. On both machines in both clients (the browsers
> konqueror and firefox) this is the URL:
> http://127.0.0.1/~user/Folder/Impressum.php , only with different user
> names. Even the names of the directories are the same.

OK. Thanks for providing this information; it helps a little. So you’re
not looking at the same files from both machines. Have you tried doing
that? Look at the pages served by the laptop using the desktop’s browser
and vive-versa.

You think the files are identical but you haven’t provided us with
directory listings from both machines, and the result of running the
diff command or some other way to show us that is indeed the case.

The first step I would take with this problem, as with most other
problems, is to examine the logs. What do the apache logs show on the
two machines? (both error and access logs).

Another step I would take is to enable FireBug for these pages and see
what it tells me. (FireBug is a debugging plugin for FireFox that I
happen to have installed.

As an alternative, I might try using the lynx text browser to see what
it reports, or perhaps the wget command.

I am fully behind dhj-novell. You realy must try to switch your way of descripting computer problems. For example, you say “Each machine has the public_html directory, in which I have created a directory for the website I’m working on. Inside this directory are the files apache serves the clients.” Instead of showing from a terminal:

ls -l public_html

including the prompt, the command, the output and the next prompt. And of ourse between CODE tags. You can (and often should) of course add explanations top this, but the computer output is the fact. The rest is your interpretation. And that interpratation may be fully wrong because you have a problem where you do not see what is wrong after long searching and trying. Thus we are not that much interested in your interpretation because that will let us make the same mistake as you did.

On the other hand, either you did not explain it clear enough in your first post above, or I am a bit slow, but it is only now (after your second post) that I understand that both systems are Apache servers and the browsers go to localhost in both cases. That was not obvious to me, the more because most people are eager to have one web-server in their environment (else serving is not very usefull).

That said, I want to see an* ls -l *listing of the directory where you have those CSS files in.

Problem found.

I tried to make it clear that I’m working with two separate machines because they aren’t networked and I don’t believe I have the possibility of setting up a network between them - one machine is so old, that it’s difficult to get compatible parts anymore when something gets broken; it is running at the lowest possible hardware requirements for openSUSE, and it was made before most people imagined such a thing as WLAN or even USB 2.0 might be possible, so even if I could find a suitable network card, I think it would just be one more opportunity for it to crash. There was never a need to set up a network, as there is no one here but me and the cat, and it wouldn’t have occurred to me that people assume I’ve set up a network, so I didn’t quite understand what you guys wanted to see at first, and then when I did, it was more laborious than expected(log in to forum from both computers and numerous posts). Up to now, I’ve transferred files using a portable storage carrier.

And therein lay the problem. I thought I adjusted all the permissions accordingly, but I forgot the CSS file. It was in the error log, but having been traumatized by nonsensical Windows error messages before switching to openSUSE, I don’t always think about what I’m reading if it says “error” anywhere.

tail -F /var/log/apache2/*

[Mon Sep 03 16:20:34 2012] [error] [client 127.0.0.1] (13)Permission denied: file permissions deny server access: /home/user/public_html/Website/Website.css


Sorry about the delay. It looked like it was going to get involved, and since I wasn’t sure how long it would take me to figure out the problem with the forum’s help, I thought I’d better finish the stuff with deadlines first.

Hippasus wrote:
> Problem found.
>
> I tried to make it clear that I’m working with two separate machines
> because they_aren’t_networked

Glad to hear that you got the problem sorted out, and thanks for
explaining the situation for us; it helps the mood on a Monday!

That means that I was straight on it 10 days ago.