Forum Moderators: phranque

Message Too Old, No Replies

Using The External Harddrive

Apache

         

amanda099

4:35 pm on Dec 22, 2008 (gmt 0)

10+ Year Member



Hi Apache Room

I installed Apache server sometime ago.
I can host 2 of my own small websites now.
But I have the content of my sites in the internal hard drive.
Because I have a small 50GB internal hard drive, I would like to keep the content of my sites in my external hard drive.
Please any one let me know how I do that !

Kindly Amanda Nguyen

g1smd

7:24 pm on Dec 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



In HTTPD.CONF, edit the base location of the web site, move the files there, and restart the server.

Check the speed of access. An external drive could be very much slower.

amanda099

4:07 pm on Dec 23, 2008 (gmt 0)

10+ Year Member



Hi g1smd, Thank You for the reply!
In HTTPD.CONF, I specify the following:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com *.example.com
DocumentRoot F:/sites/example
</VirtualHost>

Where F:/sites/example is the folder in my external hard drive containing the content of my "example.com" website.

But the browser couldn't open the site
( it worked when I specified:
NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com *.example.com
DocumentRoot htdocs/example
</VirtualHost>

)

So what did I go wrong ?

Thank You Beforehand
Amanda Nguyen

[edited by: jdMorgan at 4:31 pm (utc) on Dec. 23, 2008]
[edit reason] No URLs, please. See Terms of Service and Forum Charter. [/edit]

jdMorgan

4:33 pm on Dec 23, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try using the Windows-syntax filepath
DocumentRoot F:\sites\example

Jim

amanda099

5:04 pm on Dec 23, 2008 (gmt 0)

10+ Year Member



Thanks for the post, Jim !
I just tried using the Windows-syntax filepath
NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com *.example.com
DocumentRoot F:\sites\example
</VirtualHost>

It doesn't work .... The IE browser says "The website declined to show this webpage..........HTTP 403"
Amanda Nguyen

jdMorgan

5:15 pm on Dec 23, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Make sure the permissions on that path allow Apache to access it for read, write, and execute.

Also, either turn off "Friendly HTTP error messages" in IE options, or use a different browser -- IE "hides" your server's actual error response unless it is longer than a certain number of bytes (256 or 512 bytes, it varies), and this makes it harder to debug problems.

Jim

amanda099

5:44 pm on Dec 23, 2008 (gmt 0)

10+ Year Member



Where would I go in and adjust the permissions you mentioned, Jim ?
Amanda Nguyen

g1smd

8:23 pm on Dec 23, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




Use [mozilla.org...] to download an alternative browser. :-)

amanda099

9:12 pm on Dec 23, 2008 (gmt 0)

10+ Year Member



Hi G1smd

But then people with IE couldn't see my website ?

I tried to turn off "Friendly HTTP error messages" in IE options, I
got this message:
Forbidden
You don't have permission to access / on this server.

My friend who has Firefox browser has just tried opening the site on his Firefox browser. He got the same message:
Forbidden
You don't have permission to access / on this server.

Amanda Nguyen

jdMorgan

9:44 pm on Dec 23, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



g1smd's point was that there are better browsers for Webmaster use than IE. Plus, they tend to be more secure because they do not support ActiveX scripting. And then you can add the "Webmaster tools" and "Live HTTP Headers" browser add-ons, as well as many other webmaster-support add-ons -- None of these are available in IE.

Right-click on the site-storage folder on your "D" drive," select "properties" and investigate the "permissions" options. Then do this for all of the folders and files below that level as well.

Jim

amanda099

6:18 pm on Dec 25, 2008 (gmt 0)

10+ Year Member



Hi Jim

I have just installed FireFox 3.0.5, actually I am using it right now.

I was trying to invest the "permissions" options:
In My Computer, right-click on the F drive (the content of my site is in F:\sites\)
Click on Sharing
Click on "If you understand the risk but still want to share the root of the drive, click here"
Put a mark in "Share this folder on the network"
Put a mark in "Allow network users to change my files"
Click on Apply
Click on OK.

Actually, there are not much to do in my Microsoft Windows XP Professional Version 2002 Service Pack 3.

I dont have luck, I received the same old error, strangely !

Amanda Nguyen

amanda099

11:45 pm on Dec 25, 2008 (gmt 0)

10+ Year Member



investigate* , NOT invest

amanda099

3:25 pm on Dec 26, 2008 (gmt 0)

10+ Year Member



Hi Jim

I have tried something else:

1. Right-click on the site-storage folder on my "F" drive (the "F:\sites" folder)
2. On the general tab, I uncheck the "read-only" attribute.
3. Click Apply,
4. Check the "Apply changes to this folder, subfolders and files" button.
5. Click OK

I still receive the message: "The website declined to show this webpage"
I try to right-click "F:\sites" folder again, the "read-only" attribute appears checked.
I have unchecked the "read-only" attribute over and over again, but everytime I right-click "F:\sites" folder, it still appears checked !
So strange !

Amanda Nguyen

coopster

6:28 pm on Dec 26, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Using a network-mounted document_root can be a royal pain with Windows. I'm not certain if you have tried setting the EnableSendfile [httpd.apache.org] directive yet but it may be worth a try (Apache >= 2.0.44).
<Directory "F:\sites"> 
EnableSendfile Off
</Directory>

Don't forget to restart the server.

tangor

5:41 am on Dec 27, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Also turn OFF "simple file sharing" when making permissions.

Key_Master

6:50 am on Dec 27, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try this bit of code that includes a Directory directive. It should work. Replace DirectoryIndex, if needed, with the correct file.

<VirtualHost *:80>
ServerName www.example.com:80
ServerAlias example.com www.example.com
ServerAdmin webmaster@example.com
DocumentRoot "F:/sites/example"
DirectoryIndex index.html
<Directory "F:/sites/example">
Options -Indexes FollowSymLinks Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog F:/sites/example/error_logs/error.log
CustomLog F:/sites/example/access_logs/access.log combined
LogLevel info
</VirtualHost>

If by some chance this doesn't work, you can point the error logs to a directory on your computer's hard drive to help you track down the source of the problem.

Caterham

2:23 pm on Dec 27, 2008 (gmt 0)

10+ Year Member



BTW:
Options -Indexes FollowSymLinks Includes

Mixing +/- and non +/- options is not a good idea [issues.apache.org].

[edited by: Caterham at 2:23 pm (utc) on Dec. 27, 2008]

jdMorgan

3:50 pm on Dec 27, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In other words, use
 Options -Indexes +FollowSymLinks +Includes 

so that each new option is added to the options currently in effect, rather than replacing them.

Jim

amanda099

8:12 pm on Dec 28, 2008 (gmt 0)

10+ Year Member



IT WORKS

Coopster, setting the EnableSendfile directive doesn't work for me.

Tangor, do you mean the "Network sharing and security" option on the "properties" dialog box when saying "simple file sharing" ? I have tried with that option both on and off.

Key_Master,Your bit of code works for me, I use this:

 <VirtualHost *:80> 
ServerName www.example.com:80
ServerAlias example.com www.example.com
ServerAdmin example@example.com
DocumentRoot "F:/sites/example"
DirectoryIndex index.php
<Directory "F:/sites/example">
Options -Indexes +FollowSymLinks +Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog F:/sites/example/error_logs/error.log
CustomLog F:/sites/example/access_logs/access.log combined
LogLevel info
</VirtualHost>

May I ask: do I need an existing email in the above code ?

Caterham and Jim
Both "Options -Indexes +FollowSymLinks +Includes" and "Options -Indexes FollowSymLinks Includes" work for me
Does it mean that I have no options currently in effect in In HTTPD.CONF ?

Well, thank you very much all who helped me. Without you this would not have been possible. I hope you all had a very Merry Christmas and best wishes for the year ahead. My computer HD was small indeed and to have it on my external drive is of great benefit.
Again , thank you so very much !

Your friend , Amanda Nguyen.

jdMorgan

8:30 pm on Dec 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Amanda,

Glad you got it working!

As for Options, read the documentation of the Options directive in the Apache 'core' documentation, paying attention to the effect of prepending "+" or "-" to the various options; I doubt that I can explain it better than the people who wrote the code, so the Apache docs are your best source for information.

Jim

Key_Master

8:38 pm on Dec 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Glad it worked out for you Amanda.

As for the bug mentioned above, I tried to force it to happen with Apache 2.2.8 and 2.2.11 (latest release) but I couldn't. Nonetheless, it is would be good practice to include the + sign to any enabled options (no matter how stupid that may seem). It would also help a lot if Apache didn't release updates with a default httpd.conf file that also doesn't include the + to enabled options.

And one more thing I thought I'd mention, from httpd.conf:

# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
# If a drive letter is omitted, the drive on which httpd.exe is located
# will be used by default. It is recommended that you always supply
# an explicit drive letter in absolute paths to avoid confusion.

coopster

10:17 pm on Dec 29, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Good catch, Key_Master.

May I ask: do I need an existing email in the above code ?

That's up to you: ServerAdmin [httpd.apache.org]