View previous topic :: View next topic |
Author |
Message |
lcoulon Tux's lil' helper
Joined: 25 Feb 2005 Posts: 129
|
Posted: Thu Mar 10, 2005 9:18 pm Post subject: How hosting files with Apache [ Solved ] |
|
|
Hello,
I need to host a list of files and let them avalaible from Internet when browsing from htpp://myaddress
For some of them i need to let people anonymous access and some others placed in a restrited area as a login & password will be resquested to access to the files ?
Can anyone explain me how to do, i'm very novice with Apache 2.
The only thing i know is that "htpasswd" needs to be generated ...
Help will be much appreciated.
Last edited by lcoulon on Sat Mar 12, 2005 2:52 pm; edited 1 time in total |
|
Back to top |
|
|
omnicloud Guru
Joined: 10 Mar 2005 Posts: 550 Location: California
|
Posted: Thu Mar 10, 2005 9:25 pm Post subject: |
|
|
For the anonymous, just put them into a directory. For the passworded, I recommend you get some type of PHP portal and use MySQL or even a flat database file unless you just want to add a single user and give out the password to everyone. The PHP can create new users on the database , send out the email with a confirmation link if you want, you can add users easily, and it's more secure. |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9523 Location: beyond the rim
|
|
Back to top |
|
|
lcoulon Tux's lil' helper
Joined: 25 Feb 2005 Posts: 129
|
Posted: Fri Mar 11, 2005 7:53 am Post subject: |
|
|
Thanks Genone.
I have now the var/www/localhost/htdocs secured by logon / password.
( i have created .HTACCESS & .HTPASSWD files )
Then i have put all the files i want to share into var/www/localhost/htdocs folder.
However when browsing the page, i get identification window working fine but next i get this message :
403 Forbidden
You don't have permission to access / on this server.
Apache/2.0.52 (Gentoo/Linux) Server at 127.0.0.1 Port 80
I need to get files list on the screen instead of 403 Error ...
I have of course no html files into the folder as i only want to host files for download.
Thanks for help. |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9523 Location: beyond the rim
|
Posted: Fri Mar 11, 2005 8:25 am Post subject: |
|
|
Well, you've done something wrong with the config or the file permissions then, hard to say without more information. |
|
Back to top |
|
|
lcoulon Tux's lil' helper
Joined: 25 Feb 2005 Posts: 129
|
Posted: Fri Mar 11, 2005 8:31 am Post subject: |
|
|
Here is attached contents of my .HTACCESS located in /var/www/locahost/htdocs:
Code: | SetEnvIfNoCase Request_URI \.ht(access|passwd)$ ban
<Files ~ "^.*$">
order allow,deny
allow from all
deny from env=ban
</Files>
Authname "Zone est restreinte:"
AuthUserFile /var/www/localhost/.htpasswd
AuthGroupFile /dev/null
AuthType Basic
<limit GET POST>
require valid-user
</limit> |
And this is .HTPASSWD that is located in /var/www/localhost/ :
Code: |
lcoulon:xxxxxxxxxxx |
Thanks for your help. |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9523 Location: beyond the rim
|
Posted: Fri Mar 11, 2005 9:24 am Post subject: |
|
|
looks good at a first glance. One other thing to check: are directory listings actually enabled? |
|
Back to top |
|
|
lcoulon Tux's lil' helper
Joined: 25 Feb 2005 Posts: 129
|
Posted: Fri Mar 11, 2005 9:27 am Post subject: |
|
|
i don't know really as i'm very newbie with Apache, would you please tell me where i should enable this option ? |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9523 Location: beyond the rim
|
|
Back to top |
|
|
lcoulon Tux's lil' helper
Joined: 25 Feb 2005 Posts: 129
|
Posted: Fri Mar 11, 2005 10:41 am Post subject: |
|
|
I have found that i should have to add something like that :
Code: | <Directory /usr/local/httpd/htdocs>
Options Indexes FollowSymLinks
</Directory> |
I added these lines in my /etc/apache2/conf/apache2.conf
Then when i try again to browse my address (no index.html) Internet Explorer still not able to list files available inside the folder.
I still getting 403 Error ...
These screens showing how i tried to enable file list from Webmin , please have a check if what i done is correct :
http://membres.lycos.fr/lcoulon1/Gentoo/screen.jpg
http://membres.lycos.fr/lcoulon1/Gentoo/screen1.jpg
Thanks for you help. |
|
Back to top |
|
|
lcoulon Tux's lil' helper
Joined: 25 Feb 2005 Posts: 129
|
Posted: Sat Mar 12, 2005 1:08 pm Post subject: |
|
|
Can anybody help me regarding that problem ? |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9523 Location: beyond the rim
|
Posted: Sat Mar 12, 2005 2:26 pm Post subject: |
|
|
Quote: | Then i have put all the files i want to share into /var/www/localhost/htdocs folder. |
Quote: | I have found that i should have to add something like that :
Code: | <Directory /usr/local/httpd/htdocs>
Options Indexes FollowSymLinks
</Directory> |
I added these lines in my /etc/apache2/conf/apache2.conf |
You see the problem? |
|
Back to top |
|
|
R0Bzombie n00b
Joined: 28 Nov 2004 Posts: 10
|
Posted: Sat Mar 12, 2005 2:39 pm Post subject: |
|
|
put this in your /etc/apache2/conf/commonapache2.conf
Code: | <Directory "put the path of the folder you want to list">
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory> |
|
|
Back to top |
|
|
lcoulon Tux's lil' helper
Joined: 25 Feb 2005 Posts: 129
|
Posted: Sat Mar 12, 2005 2:51 pm Post subject: |
|
|
Thank you very much R0Bzombie , it works fine !
Would you please tell me what are options needed to be changed in Webmin to get those lines in /etc/apache2/conf/commonapache2.conf
Just to know where finding these settings in Webmin ...
Thanks again for your help! |
|
Back to top |
|
|
R0Bzombie n00b
Joined: 28 Nov 2004 Posts: 10
|
Posted: Sat Mar 12, 2005 2:59 pm Post subject: |
|
|
lol a friend told me to do this and it worked and now I tell you and it's working don't ask me how I found this, I didn't found it
I don't even know what is webmin |
|
Back to top |
|
|
lcoulon Tux's lil' helper
Joined: 25 Feb 2005 Posts: 129
|
Posted: Sat Mar 12, 2005 3:06 pm Post subject: |
|
|
No problem, anyway thanks for friend for me ! |
|
Back to top |
|
|
|