Using other folders with Personal Web Sharing

MtnBiker

Registered
I've got Personal Web Sharing going on my computer, but my main hard drive is too full and I'd like to put the site on another Hard Drive.

Is this possible? I'm sure it is; I can't be the only one with this problem.

How do I do it? I could have the whole site on the other drive or just some folders, either works for me.

I am using the Library/WebServer/Documents for the site, not the ~user location.

I have trouble viewing the site since I'm working through a router that doesn't allow me to view the site using

http://KeepTheRubberSideDown.com

You may have to look at index.php if I haven't solved that problem yet.
 
I don't know what I'm talking about at all. Backup before you try this...

I would try "sudo pico /etc/httpd/httpd.conf", then search (Control-W) for "/Library/WebServer/Documents" and replace the first two matches with "/Volumes/Web\ HD/Folders/", which would be the path to wherever your site is kept.

To make index.php show up automatically, search for "index.html" and add "index.php" before or after it. Separate them with a space.

Save the changes with Control-O, and quit pico with Control-X.

To restart Apache, try "sudo apachectl graceful".

Again, I really don't know what I'm doing, so maybe you should wait until someone can correct me or back me up.

- Brian
 
Thanks for the response. I got the index.php part. Funny, I thought I had done that already, but it wasn't there. I must have wiped it out trying Apache2 which I removed after realizing I was getting ahead of things. I don't even know if I need it yet.
The changing location didn't work, but maybe I didn't get it right. Here's what I put:
DocumentRoot "/Volumes/Web\Hard Drive Name/WebSite"
wher the Hard Drive Name iis a partition on the same drive as the main Mac OS X boot drive.
 
You need to change the DocumentRoot and also the <Directory> block that refers to the DocumentRoot folder.

Then you need to stop and restart Web Sharing.
 
I've got it going, but I couldn't do it with spaces in the disk name. I eliminated the spaces and got it going. But this goes against my almost 20 years of Mac'ing.
What's the proper way of escaping the spaces?
/Volumes\Hard Drive Name/WebSite didn't work
/Volumes/Hard\ Drive\ Name/WebSite didn't work. I dragged the disc image to Terminal and copied that in and it didn't work (Terminal drag gave me the latter.).
Thanks for the help in getting me going though. It can be difficult to know for sure what's happeining behind the router. And at the moment I'm having connection problems. This is rare, so think it's storm related. Obviously I'm seeing this MACOSX site, but I can't see another one and my mail was down for a while. First rain in months here in So Cal.
I just retried again to be sure. I only put in one space to make it simple. I typed in the space and back slash to make sure copying it from Terminal wasn't introducing some spurious characters.
I'm sure the escaping is simple, but what is it?
 
Assuming the only thing your doing is changing the DocumentRoot and Directory directives of /etc/httpd/httpd.conf, all you need to do is enter the full path name, UNESCAPED, within quotation marks.

Here's my test:
DocumentRoot "/Library/WebServer/docu ments"

In fact, I even forgot to change the <Directory "..."> directive and it still worked...but you probably should change that to reflect the new docroot :p

It works just fine for me.

Don't forget to sudo apachectl graceful for the new docroot to have effect...
 
Doesn't work for me. Maybe it's different if it's a different volume (hard drive). I have it quoted in both places. It is the drive name that is broken up.
<Directory "/Volumes/HardDriveName/WebSite">
is what I have now, but if I put spaces in Hard Drive Name (and stop and restart Web Sharing), the web site doesn't work
KeepTheRubberSideDown.com
Thanks for checking though. Maybe I should try breaking up WebSite and see what happens.
 
PS I forgot to mention this, which is most important: The new folder that your web server points to has to be `executable and readable by all`, otherwise Apache can't display it (or any files in it) to a web browser.

So if the path to your new web server docroot is /Volumes/Hermes/webserver you'd have to do this in the terminal

sudo chmod a+r a+x /Volumes/Hermes/webserver

for Apache to serve it. Then when you go into the folder above it and type ll (that's LL) it should look something like this

drwxrwxr-x 15 root admin 466 Feb 11 22:06 webserver

(It doesn't have to be owned by root though...)

PPS This is all in refernce to the standard make of Apache 1.3.26 that comes with OS 10.1; if you've upgraded to Apache 2 again, I don't know anything about Apache 2. It might be exactly the same, and it might be different, I have no idea since I've never used Apache 2...
 
When you say "it doesn't work", what's the specific error message? 404, 403...unable to connect at all?

(Forget it if my last post fixed that).
 
WOOPS! Sorry my typo it should have been chmod a+rx "path" not two a+r a+x... :p

I just did it on my FireWire drive, external volume, "/Volumes/Hermes/ser ver" and it works just fine...
 
The stars finally lined up right. Thanks for all your help. I just went and tried adding a space and it worked after starting and stopping Personal Web Server. Then I added spaces between the other two words (in both cases, both in the disk name and both places in httpd.conf), and it worked. I'll post this and reboot, just to be sure.
I've done this routine of changing disk name, httpd.conf, and restarting and never worked except without spaces, but now it's working. Not the first time this kind of thing has happened. Glad, now won't have space problems as I created too small a partition 15GB for OS X.
 
I figured out what the problem was.

I had a back slash in as some had recommended and when I finally got it working, I didn't have any back slashes as shown here:

DocumentRoot "/Volumes/Hard Drive Name/WebSite"

That is, the simplist way possible.

I found this out because the 10.2.4 update put in a new httpd.conf file. The old one seems to be the version named httpd.conf.applesaved in the same folder. I'm still trying to get php turned back on.
 
I have been using a great lil app called SharePoints to share any folder I want on our workstations at the Office. It is the easiest, most user friendly way to share directories outside the Users folder, or on other hard drives or partitions.

search for it on versiontracker.
 
The file /etc/httpd/httpd.conf contains a paragraph that looks like this:

# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
DirectoryIndex index.html
</IfModule>



If you then modify this to be like the following, it should work:

# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
DirectoryIndex index.html index.php
</IfModule>




I hope I could help you...
 
Back
Top