DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
Old 28th May 2008
erehwon erehwon is offline
Port Guard
 
Join Date: May 2008
Location: Cascadia
Posts: 34
Default

Quote:
Originally Posted by xCipherx View Post
I've got an obsd 4.3 webserver and it handles .css just fine.

I'm using the following code:
Code:
<link rel="stylesheet" type="text/css" href="style.css" />
and I've got my .css file in the rootdirectory.
Firefox displays the page as intended?

Can you discuss what DefaultType you are using in your httpd.conf, whether you have added any AddType directives, and so on?
Reply With Quote
Old 29th May 2008
erehwon erehwon is offline
Port Guard
 
Join Date: May 2008
Location: Cascadia
Posts: 34
Default content-style-type

It may also help to add the following to the <head> section of your HTML

Code:
<meta http-equiv="Content-Style-Type" content="text/css">
as this is recommended. I'll try it soon.
Reply With Quote
Old 31st May 2008
erehwon erehwon is offline
Port Guard
 
Join Date: May 2008
Location: Cascadia
Posts: 34
Default

Quote:
Originally Posted by erehwon View Post
It may also help to add the following to the <head> section of your HTML

Code:
<meta http-equiv="Content-Style-Type" content="text/css">
as this is recommended. I'll try it soon.
Doesn't work either; I've tested the same setup on a FreeBSD machine and it styles the pages as intended, from a link. For whatever reason, OpenBSD serves up the "text/css" as "text/plain" (at least Mozilla thinks so), no matter what I do, so I'll leave it at that, keep it plain, and move on!
Reply With Quote
Old 21st September 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

I've figured it out!

In setting up Apache on OpenBSD, I had two problems. A.) Scripts would not get run (e.g. .php, .pl) and B.) Mozilla browsers would not display the stylesheets. I had more important business to tend to; so I never sorted it. Now I need a local server, so....

I found the cause of problem A. I had conf/httpd.conf loading mime_magic_module, either I hadn't had it configured properly or it was just a bad idea.


In the case of problem B, drhowarddrfine was right -- it must be served as text/css. The only thing he left out was how to enforce it.



According to a little webbing, in standards mode Mozilla tells external stylesheets to piss off, unless the mime type is text/css. I checked the error console in Flock, and guess what it said:

Quote:
The stylesheet http://myserver/spidey01.css was not loaded because its MIME type, "text/plain", is not "text/css"



Out of box OpenBSDs Apache 1.3 was serving CSS as text/plain.

Code:
# httpd.conf
AddType text/css .css



YKYMF !
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP read file contents - Maximum file size cksraj Programming 1 21st September 2009 11:38 AM
Upgrading application not installed in default port directory APACHE ijk FreeBSD Ports and Packages 5 13th July 2008 04:34 PM
apache 2.2.8 , is it on chroot by default? superslot OpenBSD Security 9 30th June 2008 11:56 AM
DVD file read error louie FreeBSD General 7 30th May 2008 03:50 PM
Swfdec read-only file access vulnerability corey_james FreeBSD Ports and Packages 0 14th May 2008 11:31 PM


All times are GMT. The time now is 04:43 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick