MacNN Forums (https://forums.macnn.com/index.php)
-   Developer Center (https://forums.macnn.com/forumdisplay.php?f=79)
-   -   Apache2 Web Server Help, Please (https://forums.macnn.com/showthread.php?t=529221)

 
ghporter Aug 15, 2023 03:33 PM
Apache2 Web Server Help, Please
I'm trying to get my Linux (Debian) machine to serve files via Apache on my LAN. However trying to use the documentation to figure out one specific issue has me running in circles.

By default, web content for Apache to serve is in Linux's /var/web/html folder. However, since I have /var in a separate partition that isn't huge, I want to have links in the index.html file point to files outside of the /var folder.

I can create those links and open index.html from the desktop (NOT through Apache) and the links actually work. But when I try those links through Apache's web server, the links fail with a 400 error.

I'd appreciate any pointers, explanations, examples, etc. on this. It's frustrating the heck out of me.
 
reader50 Aug 15, 2023 03:45 PM
Probably the simplest solution is to move your DocRoot to a different location. Then serve it all from a partition you have lots of space in.

/etc/apache2/httpd.conf (Apache2 config file)
Search for "DocumentRoot", the location is also given in "<Directory ..." which is right below DocRoot in my (Mac) Apache2 config file. Point them both to your new site location. Also check for the CGI-Executables pointers. May not apply to your site, but better to re-point everything.

Copy across your site files from the usual location. They might need a little permissions fiddling, or might work out of the box. Depends on if your copy program copied the permissions across too.
 
ghporter Aug 15, 2023 05:17 PM
DocumentRoot is in a different place in Linux, under the Sites Enabled folder in a "default.conf" file. Once I finally found that, I changed my root to a folder in a different (larger) partition, and stuff started working.

Thanks!
 
ghporter Aug 15, 2023 08:12 PM
One thing: the Apache documentation is really strong, well written, and extensive. But if you just search for “DocumentRoot”, it’ll give you everything but where the heck is this directive!?!?!##$%%”.

As a tech writer (among other things), I can’t understand how such well written documentation could be so lacking in subject-specific context. I somehow doubt it would have injured the writers if they’d have just put a “back path” of some sort at the top of each directive page. Ya know?
 
ghporter Aug 18, 2023 10:10 AM
Just a follow up: now that I can put my files where I want them, I’ve been learning CSS (I only had an intro the last time I did any web work), and I’m making nice progress. It really is a time and work saver, even though it feels like I’m mixing HTML and Java/C syntax. ;)

The reason for an internal web server is to avoid new hardware and software while still sharing (mostly) photos across the LAN. Yeah, I could set up a Plex server, yeah, I could buy a big old NAS and have Plex serve everything up, yeah, I could spend the next couple of weeks learning how to configure the server and the clients for MacOS, iOS/iPadOS, Linux and Windows so they can see and interact with the server….

But why, when I’m not talking about streaming the latest Phineas and Furb to my iPhone, etc.? Every device has a capable web browser, every device can open JPEGs and MP4s (home-grown kitten videos are a lot of fun), and so on. HTML/CSS is useful everywhere, while Plex and its kin are pretty specialized. I have always worked at being a generalist first, and adding to my HTML skills is quite a bit simpler than learning something completely new.
 
reader50 Aug 18, 2023 12:02 PM
Quote, Originally Posted by ghporter (Post 4431209)
... yeah, I could buy a big old NAS and have Plex serve everything up ...
If you got the NAS, you could also set it up as a Time Machine destination. So your backups, and drive noise, and fan noise are in another room. That combination is what got me to go the NAS route.
 
ghporter Aug 18, 2023 02:24 PM
I’d thought about a NAS setup, even without a media server, but I decided to just go with the least expensive option available. Right now, all I need to do is create the pages and put the media where Apache can see it. Plus, it’s kind of what having a Linux machine to play with is all about.

And since I got this machine specifically to set up an AirPrint server, any other use I can put it to is a bonus.
 
All times are GMT -4. The time now is 04:33 AM.

Copyright © 2005-2007 MacNN. All rights reserved.
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2024, vBulletin Solutions, Inc.