![]() | ![]() | ![]() |
| |||||||
| Forums | Register | Groups | Awards | Arcade | Pets | T-Bucks / T-Store | Invite Your Friends | Blogs | Mark Forums Read |
| Web Design Forums and discussions on webdesign |
Web Design | |||||||||
|
|
|
|
| |||||
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| Civilians | Moved to a new host. Apache there; Apache locally, here, where I wish to have a duplicate of my little hobby site. I've been doing that, with the local dupe, for a few years. With the new site, here's my problem. I'm using php includes for headers and footers for each page. Here's a sample of a header include. Structure isn't important so I've snipped all but three lines that involve paths, and for the sake of page width here, I've wrapped as needed. Paths are my only problem -- that's why I include only these lines. Here's a CSS link, a second-level subdir link and an image link: <link rel="stylesheet" type="text/css" href="/bn4style1.css" title="bn4style1" /> <a href="/comp/index.html">Computing</a> <img src="/images/bnetlogo1.png" width="259" height="69" alt="Logo" /> At my host, those three paths from the header work fine **from any directory level**, so that I only need one set of headers and footers for pages anywhere at the site. That's by design -- I used to have a set of headers and footers for each nested subdir level. I've simplified that for obvious reasons. PROBLEM: this doesn't work *here*. To make these file references all work locally, I have to change them to, respectively: bn4style1.css comp/index.heml images/bnetlogo1.png **for the top directory level**. And for pages **beneath** that level I have to use the relative paths: ../bn4style1.css ../comp/index.html ../images/bnlogo1.png Which throws me back to needing a separate set of headers and footers for every level of subdirectories. These references aren't a mystery to me -- I've been using relative paths for years. But I can't figure out how to set up Apache (to which I'm new) **locally** so that the same path references that work at my actual site work here. My user document setting for the this server is "public_html" (which is /home/blinky/public_html), which matches the public_html dir at host. What the heck do I have to do to Apache, here, so that I can use the same type of path refs here as the ones that work at the actual site and have a real, working mirror of it here, so I don't have to do all my testing online? -- Blinky Linux Registered User 297263 Upgrading From IE http://blinkynet.net/comp/upgrade.html Mozilla Firefox http://www.mozilla.org/products/firefox/ |
|
| | #2 (permalink) |
| Civilians | Blinky the Shark wrote: > But I can't figure out how to set up Apache (to which I'm new) **locally** > so that the same path references that work at my actual site work > here. On this page: http://localhost/~blinky/mypage.php this reference: <link rel="stylesheet" type="text/css" href="/bn4style1.css" /> refers to this URL: http://localhost/bnstyle1.css but I'm guessing you have the CSS file here: http://localhost/~blinky/bnstyle1.css in which case, find your apache config file (usually in "/etc/httpd/" somewhere), find where it sets the document root and point the document root at "/home/blinky/public_html" then restart Apache. -- Toby A Inkster BSc (Hons) ARCS Contact Me ~ http://tobyinkster.co.uk/contact |
|
| | #3 (permalink) |
| Civilians | Toby Inkster wrote: > Blinky the Shark wrote: >> But I can't figure out how to set up Apache (to which I'm new) **locally** >> so that the same path references that work at my actual site work >> here. > On this page: > http://localhost/~blinky/mypage.php > this reference: > <link rel="stylesheet" type="text/css" href="/bn4style1.css" /> > refers to this URL: > http://localhost/bnstyle1.css > but I'm guessing you have the CSS file here: > http://localhost/~blinky/bnstyle1.css At my host, css is in public_html, along with the index.html for my "home" page, and the link /bnstyle1.css is found and used from any level directory. Here (where my prob lies) the same is true: css is in public_html[1], along with the index.html for my "home" page. But it's not found from *any* directory. [1]/home/blinky/public_html > in which case, find your apache config file (usually in "/etc/httpd/" > somewhere), find where it sets the document root and point the document > root at "/home/blinky/public_html" then restart Apache. That's one of the paths I've tried as Apache's document roo, with no success. Meanwhile, Apache stopped working, and I haven't got it to run even with an uninstall/reinstall. So Priority 1 is getting the bugger up at all. I'll get back to this thread once I get it working in any fashion. Thanks for the response. <pouring a rum and coke to clear my thinking> -- Blinky Linux Registered User 297263 Upgrading From IE http://blinkynet.net/comp/upgrade.html Mozilla Firefox http://www.mozilla.org/products/firefox/ |
|
| | #4 (permalink) |
| Civilians | Blinky the Shark wrote: > Meanwhile, Apache stopped working, and I haven't got it to run even with > an uninstall/reinstall. So Priority 1 is getting the bugger up at all. Probably a config file error. If Apache notices an error in the config file, it will terminate. Check /var/log/httpd/error_log for more info. -- Toby A Inkster BSc (Hons) ARCS Contact Me ~ http://tobyinkster.co.uk/contact |
|
| | #5 (permalink) |
| Civilians | Toby Inkster wrote: > Blinky the Shark wrote: >> Meanwhile, Apache stopped working, and I haven't got it to run even >> with an uninstall/reinstall. So Priority 1 is getting the bugger up >> at all. > Probably a config file error. If Apache notices an error in the config > file, it will terminate. I've been tweaking it with webmin, not manually editing the config files, for the record, but yeah, that's all I can think of. Haven't got around to looking at them. Also that the reinstall didn't get it up points to a problem in a config file, which would've been retained (as versus the binary and lib files and such). > Check /var/log/httpd/error_log for more info. Will do. The odd behavior, though is that it *appears* to start normally -- I get the "[OK]" when I start it in a console. But when I try to *stop* it from that console, I get "[FAILED]". Uhhhh. ![]() When I get it fixed, <span style="voice: schwartzenegger;">I'll be back</span> -- I'm really stumped about this paths thing working at host but my not being able to make it work locally with the same path format. -- Blinky Linux Registered User 297263 Upgrading From IE http://blinkynet.net/comp/upgrade.html Mozilla Firefox http://www.mozilla.org/products/firefox/ |
|
| | #6 (permalink) |
| Civilians | Toby Inkster wrote: > Blinky the Shark wrote: >> Meanwhile, Apache stopped working, and I haven't got it to run even >> with an uninstall/reinstall. So Priority 1 is getting the bugger up >> at all. > Probably a config file error. If Apache notices an error in the config > file, it will terminate. > Check /var/log/httpd/error_log for more info. Second response, but I wanted to say "extra thanks" for reminding me of the log; I tend to not resort to them often in general (i.e., not specifically Apache) because much of the time they're over my head. This one wasn't, and pointed me exactly to the problem, nearly with big bright flsahing neon arrows; and I was able to fix it in a jiffy. But I'm still going to bug you about this darned path thing. ![]() -- Blinky Linux Registered User 297263 Upgrading From IE http://blinkynet.net/comp/upgrade.html Mozilla Firefox http://www.mozilla.org/products/firefox/ |
|
| | #7 (permalink) |
| Civilians | Blinky the Shark wrote: > The odd behavior, though is that it *appears* to start normally -- I get > the "[OK]" when I start it in a console. But when I try to *stop* it > from that console, I get "[FAILED]". Uhhhh. ![]() Yeah -- the Apache startup script prints "[OK]" as soon as Apache starts -- but it doesn't notice that Apache has terminated immediately. service httpd start; sleep 3; service httpd status should tell you if Apache's still running. > I'm really stumped about this paths thing working at host but my not > being able to make it work locally with the same path format. If you e-mail me a link to the pages, along with a tarball of your Apache config files, I can take a look, but I can't promise anything. > Second response, but I wanted to say "extra thanks" for reminding me of > the log; I tend to not resort to them often in general (i.e., not > specifically Apache) because much of the time they're over my head. The Apache error log is one of those rare miracles in log files. It is actually incredibly useful. It will tell you about which files are missing when you get a 404, why certain URLs are "Forbidden" and why Apache keeps terminating and it will show you STDERR for any CGI scripts that aren't working. -- Toby A Inkster BSc (Hons) ARCS Contact Me ~ http://tobyinkster.co.uk/contact |
|
![]() |
| Bookmarks |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 9/11 Flight Paths | Snowden | Chit-Chat | 3 | 09-13-2006 19:39 |
| cgi paths | Andy T | Web Design | 0 | 01-23-2005 00:00 |
| Looking for files with UNC paths | CQMMAN | Microsoft Applications | 1 | 01-13-2005 20:00 |
| Multiple Critical Paths | James Keenan | Microsoft Applications | 16 | 06-16-2004 18:06 |
| Motion Paths | kkingster | Microsoft Applications | 3 | 06-16-2004 09:35 |
![]() | ![]() | ![]() |