Using Apache2 to Store Files for Accessing with wget?


 
Thread Tools Search this Thread
Special Forums IP Networking Using Apache2 to Store Files for Accessing with wget?
# 1  
Old 09-05-2012
Using Apache2 to Store Files for Accessing with wget?

Hello All,

I have a Virtual Machine that I basically use for just testing stuff on. It is running SLES 11.1 and Apache2.

I was able to get Apache2 set-up and working... I was able to insert a basic index.html page (i.e. a simple "Hello World" html page)
just to check and make sure I can access it from my local machine in Firefox. Which does work...

I wanted to see if there was a way I could say create a directory, i.e. "/srv/www/htdocs/docs" and insert files in there that I would
like to share with my local machine. Then from my localhost be able to issue a: (for example the server's IP is 192.168.2.2)
Code:
# wget http://192.168.2.2/docs/myFile_I_want.txt

Could anyone tell me if this is possible..?
Any suggestions would be much appreciated!


Thanks in Advance,
Matt
# 2  
Old 09-05-2012
That should work as long as the webserver has read access.
# 3  
Old 09-06-2012
Hey hergp, thanks for the reply!

Yea I got it working like minutes before I left work yesterday evening...
I had everything correct except I was missing somehting in the "/etc/apache2/httpd.conf" file.

Here's the Section I added to my httpd.conf Config File:
Code:
DocumentRoot /srv/www/htdocs

<Directory "/srv/www/htdocs/docs">
    Options Indexes
    Order allow,deny
    Allow from all
</Directory>

Seems to be working perfectly now...

Do you know if the section above in the "Allow from ..." line, can I insert a list of IP Addresses in
order to narrow down who can have access to the files...?



Thanks Again,
Matt

---------- Post updated at 10:19 AM ---------- Previous update was at 10:06 AM ----------

I had one other question besides the one about adding a list of IP Addresses to the "Allow from" line
of the httpd.conf file...

I created symbolic links to the files I wanted to be made available and it seems to be working just fine. I then
tried adding a symbolic link to a directory in the "/srv/www/htdocs/docs" but it doesn't seem to work (i.e. it's not
showing in the browser)?

Is this the expected behavior, or is there some kind of option I can add to one of the configs that would allow this..?


Thanks in Advance,
Matt
# 4  
Old 09-06-2012
First question -- access restrictions. Let's say, you want only to allow users in the 192.168.1.* and 192.168.3.* network:

Code:
Order deny,allow
Deny  from all
Allow from 192.168.1.0/24
Allow from 192.168.3.0/24

I'm not sure about the symlinks, but I think they must not point outside of the directory where they are created.
# 5  
Old 09-07-2012
Hey hergp, thanks again for the reply!

Cool, thanks I'll get those IP Address' subnets in there, thanks!

As for the symlinks, I found an Option for the "Directory" section in my httpd.conf file that will allow the use of "Symlinks".
The Option is called "FollowSymLinks" and it works perfect now...

Here's my modified "Directory" section in "httpd.conf":
Code:
 <Directory "/srv/www/htdocs/docs/">
    Options Indexes FollowSymLinks MultiViews
    # Will be adding an "Allow" section below to control who can access the files at in this directory...
    Order allow,deny
    Allow from all
 </Directory>

Well, thanks again hergp for your help, much appreciated!!


Thanks Again,
Matt
This User Gave Thanks to mrm5102 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Store filenames for wget in bash

I have a bash that downloads a list of files as a text file using wget. What I now need to do is store those files names and pass them to a download call also using wget. List.txt in /home directory FilterDuplicates.html file1.bam file2.bam file3.bam file1.vcf.gz file2.vcf.gz... (3 Replies)
Discussion started by: cmccabe
3 Replies

2. Shell Programming and Scripting

Accessing files in batch

hai, I have a list of files having extension .sy in a folder. I want to find such files and print the first two columns of the files to new extension .tmp (1 Reply)
Discussion started by: sreejithalokkan
1 Replies

3. UNIX for Dummies Questions & Answers

accessing windows files from unix

Hello, I am new to Unix and I would like to know how can I see my files from Windows desktop. When I type ls, I can see a list of files-directories including Desktop, but when I cd Desktop, and then ls there is a message 'Link to old Desktop'. (The big picture is to build a sundials library but... (4 Replies)
Discussion started by: s097
4 Replies

4. Shell Programming and Scripting

Accessing files with perl

Hello i am new to Perl and i have a question. I am trying to read a file that has the following format: 14/4/2008 8:42:03 πμ|10800|306973223399|4917622951117|1||1259|1|126|492|433||19774859454$ 14/4/2008 9:13:08 πμ|10800|306973223399|306970097423|1||1264|1|126|492|878||19774859762$... (2 Replies)
Discussion started by: chriss_58
2 Replies

5. UNIX for Dummies Questions & Answers

Accessing files on unix share from xp?

Sorry if the is in the wrong section, but would like to know if anyone can help with the following I am on a network using Windows XP and am having problems viewing/manipulating files on one of the shared drives, which happens to be a snap server. I have no other problems with any of the other... (1 Reply)
Discussion started by: MrB
1 Replies

6. UNIX for Dummies Questions & Answers

Accessing files/folders with spaces

Hi there, our unix and windows are related. i.e. if i save a file while being on windows my unix profile would contain the same file, at the same location. so i can access all my files through unix prompt. but if i save a file/folder being on windows account and put spaces between the name of... (3 Replies)
Discussion started by: a25khan
3 Replies

7. UNIX for Dummies Questions & Answers

Accessing Files on another drive

Hey..alright heres the deal I'm going to do a triple boot if you would Win98SE, Win2K, and Redhat Linux 7.1 now I have two HDs each with 30 gigs i've allowed one HD to the OS's with 10 gigs each...the third I intend to be one for windows to pull things thats compliant with both 98 and 2k and store... (2 Replies)
Discussion started by: PravusMentis
2 Replies
Login or Register to Ask a Question