adding a drive to the server? [resolved]

Problems with the Windows version of XAMPP, questions, comments, and anything related.

adding a drive to the server? [resolved]

Postby berryboy » 29. December 2008 18:05

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
Last edited by berryboy on 15. March 2009 17:57, edited 3 times in total.
berryboy
 
Posts: 10
Joined: 29. December 2008 18:00

Re: adding a drive to the server?

Postby Nobbie » 29. December 2008 20:51

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.
Nobbie
 
Posts: 8779
Joined: 09. March 2008 13:04

Re: adding a drive to the server?

Postby berryboy » 29. December 2008 21:39

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
berryboy
 
Posts: 10
Joined: 29. December 2008 18:00

Re: adding a drive to the server?

Postby berryboy » 04. January 2009 11:11

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
berryboy
 
Posts: 10
Joined: 29. December 2008 18:00

Re: adding a drive to the server?

Postby Wiedmann » 04. January 2009 12:55

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

The "error.log" from Apache knows the answer.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

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

Postby dmphotography » 06. January 2009 23:47

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?
For great video and written tutorials and guides on creating your own web server and installing things such as forums, blogs, etc., visit http://myownhomeserver.com
dmphotography
 
Posts: 191
Joined: 15. December 2008 14:25
Location: Columbus, MS
Operating System: Windows 7

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

Postby Sharley » 07. January 2009 00:40

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.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: adding a drive to the server?

Postby berryboy » 14. March 2009 15:10

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
berryboy
 
Posts: 10
Joined: 29. December 2008 18:00

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

Postby berryboy » 15. March 2009 17:56

resolved again

usb drive is: /media/disk/downloads
berryboy
 
Posts: 10
Joined: 29. December 2008 18:00


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 69 guests