![]() |
|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
![]() |
|
Thread Tools | Display Modes |
|
|||
![]()
Help! The default Apache install with my OpenBSD 4.3 box just won't display my webpages as styled -- displays them with no formatting at all.
Now, my "style.css" file is in the web directory, I checked the syntax, and the pages display as they should on my other machine, locally (a Mac laptop) Both the CSS and HTML validate fine. I have tried both Code:
<style type="text/css"> /*<![CDATA[*/ @import url(style.css) screen; /*]]>*/ </style> Code:
<link rel="stylesheet" type="text/css" href="./style.css" /> I have TypesConfig conf/mime.types in my httpd.conf and css is listed; and I just don't get it. |
|
|||
![]()
I should say, it won't read (or import) the linked file. If I paste the CSS into the <style> section, it displays as intended.
|
|
|||
![]()
The standard OpenBSD Apache, no modifications at all, displays the following test page and css file well.
Code:
$ pwd /var/www/htdocs $ ls -l my* -rw-r--r-- 1 www www 59 May 12 01:01 my.css -rw-r--r-- 1 www www 617 May 12 01:22 mylinks.html $ cat mylinks.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" /> <link rel="stylesheet" type="text/css" href="./my.css" /> <title>My test page</title> </head> <body> <div style="color: black; font-size: 80%; display: block ;"> <h1>Some links</h1> <a class="ref" href="xml.html">XML, XSLT etc</a> <a class="ref" href="openbsd.html">OpenBSD related stuff</a> <a class="ref" href="freebsd.html">FreeBSD utilities </a> </div> </body> </html> $ cat my.css .ref { display: block ; padding: 0.25em ; color: red ; }
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
![]()
I've edited my httpd.conf but a syntax check returns OK
Furthermore, every time I use apachectl to start the server, 'ddclient' echoes and spawns another process. Here's my rc.conf.local Code:
httpd_flags="" # ddclient if [ -x /usr/local/sbin/ddclient ]; then echo -n ' ddclient'; /usr/local/sbin/ddclient fi |
|
|||
![]()
You should remove these lines from /etc/rc.conf.local. This file should only contain variable assignments and not any executable shell commands.
Code:
# ddclient if [ -x /usr/local/sbin/ddclient ]; then echo -n ' ddclient'; /usr/local/sbin/ddclient fi The apachectl files reads/sources the /etc/rc.conf file. Because rc.conf reads in rc.conf.local, your commands to load ddclient are executed. So you have to take these commands out and put them in the proper file /etc/rc.local ![]() Does the Apache logs complain that it cannot find your css file?
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
![]() Quote:
![]() Quote:
|
|
|||
![]()
The browser (Firefox) opens the CSS file as if it is plain text. The file is a Unix UTF-8 file with no BOM, .css extension.
|
|
|||
![]() Quote:
I think that is what it is supposed to do.. i.e. display plain text.. At least that is what I get from my style.css file on a website that I maintain.. rk |
|
|||
![]() Quote:
Are you sure the css is being served as text/css and not text/plain or something else (common problem)? Last edited by drhowarddrfine; 12th May 2008 at 06:04 PM. |
|
|||
![]()
I can list the relevant source
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>My Site</title> <style type="text/css"> [long list of css entries] </style> Could it be the Content Type? Default type in my httpd.conf is text/plain.... |
|
||||
![]()
It doesn't seem to matter:
http://www.rwxrwxrwx.net/test.php <link type="text/css" rel="stylesheet" href="test.jpeg" /> Works fine... Can you provide a link? That way I can look at the file to see if there may be an error somewhere, and save it to see if I can reproduce the problem...
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
|||
![]()
Soon, I hope. Thanks.
|
|
|||
![]()
Yes, that's the problem. CSS must be served as text/css. Your html, otherwise, is fine.
|
|
||||
![]()
Having tried getting Apache going on my OpenBSD 4.3 box (I'm not used to 1.3.x), I noticed this peculiarity as well. Forgive posting in an old thread but I've found some thing interesting:
I wanted to test to ensure every thing works in my apache setup before configuring virtual hosts for several projects, so I copied a small template for a home page I made awhile back but noted that my CSS file was not being loaded when testing it. I found some thing rather odd though, the access log was showing a successful hit on the stylesheet but it would only work in Mozilla if I made it an internal style sheet (no @import or <link>) in my index.html. After racking my head a bit and exhaustingly reviewing every configuration option I know of without finding any problems in my setup. Then I had a brain fart, every test I had made was via Firefox or Flock over the LAN or Lynx on the server. So I've fired up another machine and ran through tests on the following browsers: Firefox 2 Flock 1.1 Internet Explorer 7 Safari 3 Beta Opera 9.x Netscape 9 Seamonkey 1.1 They all display the dang gum stylesheet except for the Mozilla based ones. Do you get similar results erehwon?
__________________
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''. Last edited by TerryP; 22nd May 2008 at 09:41 PM. Reason: an apology for posting in an old thread |
|
|||
![]() Quote:
|
|
|||
![]()
Yes, it works with IE6...what's also odd is that CSS validation returns "I/O error: unknown file type: text/plain" -- but the file is saved as .css -- I wonder if it's a byte-order mark issue or if the .css file has non-Unix line endings?
|
|
||||
![]()
Let me put it this way, Firefox (and apache) is (are) to fat to look threw the code to find out lol.
I think HTTP request messages are supposed to be termnated with a carriage return and line feed. But I've never bothered to read the standard, so I'm not sure what clients receive (\r\n or actual file content byte by byte). I've tested with my stylesheet using both \n and \r\n formats with the same results. BOM issue, I haven't really considered yet. Code:
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> ... <link rel="stylesheet" charset="utf-8" type="text/css" href="/spidey01.css" />
__________________
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''. |
|
|||
![]()
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" /> |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
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 |