Page 1 of 1

adding a drive to the server? [resolved]

PostPosted: 29. December 2008 18:05
by berryboy
hello, im still very new to this so bear with me!
i have xampp 1.7/ PHP 5.2.8, and my site is running out of space fast!, i have asked my host to add a usb drive to the server giving me more space to put my files for users to download,
how do i add this to xampp's htdocs folder? so users can view/download the files on that drive(USB). i'll continue to search in the mean time

thank you in advance
BB

Re: adding a drive to the server?

PostPosted: 29. December 2008 20:51
by Nobbie
Use "Alias" Directive to insert foreign pathnames.

Example:

Alias /myusb/ u:/

Above statement has to be inserted in httpd.conf. The USB stick has to be mounted to u:/ (feel free to choose any other drive letter). After reboot of Apache the URL http://www.yourdomainname.com/myusb points to U:/ path of your server.

For more info read Apache docu about Alias statement.

Re: adding a drive to the server?

PostPosted: 29. December 2008 21:39
by berryboy
brilliant, is it that easy i just add "Alias /myusb/ u:/" i can add this anywhere in httpd.conf

Alias /downloads/ u:/ < is ok? U being the letter of the USBdrive

Re: adding a drive to the server?

PostPosted: 04. January 2009 11:11
by berryboy
well seems im still having some problems here!

Code: Select all
Alias /download2/ "E:/downloads/"
<directory "E:/downloads" >
        Options Indexes FollowSymlinks Includes MultiViews Includes
        AllowOverride All
        Order allow,deny
        Allow from all
</directory>


is this correct?

im getting error 500, server overloaded or CGI script error.
what am i doing wrong?

resolved. did'nt update my .htpasswd in .htaccess

Re: adding a drive to the server?

PostPosted: 04. January 2009 12:55
by Wiedmann
im getting error 500, server overloaded or CGI script error.
what am i doing wrong?

The "error.log" from Apache knows the answer.

Re: adding a drive to the server? [Resolved]

PostPosted: 06. January 2009 23:47
by dmphotography
Now forgive me for asking a dumb question, but doesn't the Alias need to be grouped with the domain it's for? For example I have the following two sites in my vhosts file:

Code: Select all
<VirtualHost *:80>
ServerName myfirstdomain.com
ServerAlias www.myfirstdomain.com
DocumentRoot "B:/xampp/htdocs"
<Directory "B:/xampp/htdocs">
Options +Indexes FollowSymLinks +ExecCGI
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName myseconddomain.com
ServerAlias www.myseconddomain.com
DocumentRoot "E:/newsite"
<Directory "E:/newsite">
Options +Indexes FollowSymLinks +ExecCGI
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


Let's say I'm wanting to add www.mysecondsite.com/forum/ to go to my forums directory. I would need to insert it like this wouldn't I?
Code: Select all
<VirtualHost *:80>
ServerName myfirstdomain.com
ServerAlias www.myfirstdomain.com
DocumentRoot "B:/xampp/htdocs"
<Directory "B:/xampp/htdocs">
Options +Indexes FollowSymLinks +ExecCGI
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName myseconddomain.com
ServerAlias www.myseconddomain.com
DocumentRoot "E:/newsite"
<Directory "E:/newsite">
Options +Indexes FollowSymLinks +ExecCGI
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all
</Directory>
Alias /forum/ "E:/site2forums/"
<directory "E:/site2forums" >
        Options Indexes FollowSymlinks Includes MultiViews Includes
        AllowOverride All
        Order allow,deny
        Allow from all
</directory>
</VirtualHost>


Because if I add a mythriddomain.com and put the code either before the VirtualHost for myseconddomain.com or after the one for mythirddomain.com, then it will try and direct those domains with that extension and not myseconddomain.com, correct?

And one last scenario for curiosity. Let's say I wanted one bulletin board or forum for all of the sites. (I don't really, but wondering if it works like this). Would I put the alias /forum/ at the beginning like so?

Code: Select all
 NameVirtualHost *:80

Alias /forum/ "E:/site2forums/"
<directory "E:/site2forums" >
        Options Indexes FollowSymlinks Includes MultiViews Includes
        AllowOverride All
        Order allow,deny
        Allow from all
</directory>

<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
</VirtualHost>

<VirtualHost *:80>
ServerName myfirstdomain.com
ServerAlias www.myfirstdomain.com
DocumentRoot "B:/xampp/htdocs2"
<Directory "B:/xampp/htdocs2">
Options +Indexes FollowSymLinks +ExecCGI
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


Cause if I understand it correctly, that would tell everything coming in with the extension /forum/ to go to the E:/site2forums/ directory, including localhost, correct?

Re: adding a drive to the server? [Resolved]

PostPosted: 07. January 2009 00:40
by Sharley
Wrap your alias in:
<IfModule alias_module>
</IfModule>

or simply add your alias to the httpd-xampp.conf file between the existing alias-module directive.

Re: adding a drive to the server?

PostPosted: 14. March 2009 15:10
by berryboy
hello again!

i have changed to ubuntu for my servers OS as its well.. free!

but again i have an issue :(

i would like to add my drive (USB hard drive) to apache and i assume i can do this with using the same method

Code: Select all
Alias /download2/ "E:/downloads/"
<directory "E:/downloads" >
        Options Indexes FollowSymlinks Includes MultiViews Includes
        AllowOverride All
        Order allow,deny
        Allow from all
</directory>


however in ubuntu i dont have the drive letters displayed i just have "filesystem" and "elements" < USB drive

Code: Select all
Alias /download2/ "elements:/downloads/"
<directory "elements:/downloads" >
        Options Indexes FollowSymlinks Includes MultiViews Includes
        AllowOverride All
        Order allow,deny
        Allow from all
</directory>


would the above work? i am a conplete noob when it comes to ubuntu/linux though im getting there!

as always, thank you for any help
BB

Re: adding a drive to the server? [Continued]

PostPosted: 15. March 2009 17:56
by berryboy
resolved again

usb drive is: /media/disk/downloads