403 Forbidden - so whats the problem :-(

derilzemer

Joined: 2013-01-27
Posts: 4
Posted: Sun, 2013-01-27 11:05

Hi @ all,

i'm new andI have to recommend that my english is very bad. So sorry for this Guys.
Years ago i've istalled Gallery 2. Now I would to install Galler3 on my Server. There was no installtion of gallery oin this server before. I use the Insatllationguide and after Step

xxxxxx@Tuxnas:/var/www/gallery3# php installer/index.php -h localhost -u xxxxxxx -p xxxxxxx -d gallery3
PHP Notice: Undefined offset: 1 in /var/www/gallery3/installer/cli.php on line 102
Your Gallery has been successfully installed!
We've created an account for you to use:
username: admin
password: xxxxxxxx

If i would to access gallery3 via WebGui i got 403 Message (Firefox eg. IE )
Forbidden - You don't have permission to access /gallery3/ on this server.
Apache/2.2.16 (Debian) Server at 192.168.165.252 Port 80

Apache access.log
192.168.85.81 - - [27/Jan/2013:11:14:08 +0100] "GET /gallery3/ HTTP/1.1" 403 505 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0"
192.168.85.81 - - [27/Jan/2013:11:25:51 +0100] "GET /gallery3/ HTTP/1.1" 403 505 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"

Apache error.log
[Sun Jan 27 11:25:51 2013] [error] [client 192.168.85.81] client denied by server configuration: /var/www/gallery3/

There is granted access to other sides on my server using the .htacces file
themachine - Username [27/Jan/2013:12:04:07 +0100] "GET /quartis/ HTTP/1.1" 304 210 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0"

I use the .htaccess and adapted only my access credentials that i use by the other websites on my local Server.
Now there is my problem at the momment because i didn't know if the apacche is correctly configured :-(.

xxxxxxxxc@Tuxnas:/var/www/gallery3# cat /etc/apache2/sites-available/default
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>

I would be great if i got help from the forum.

with best regards from Germany
Andreas

 
derilzemer

Joined: 2013-01-27
Posts: 4
Posted: Sun, 2013-01-27 12:37

Hi,
okay the problem is the .htaccess file :-(. I chanched the .htaccess file with my own and acees to Gallery3 granted.
Is there still a problem if I use my own .htaccess file??
My accessfile is really simple but okay i think (see attached file). Thanks for any hints.

Regards
Andreas

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sun, 2013-01-27 16:17

If you were getting a 403 error, it's likely because the user wasn't seen as being logged in. Lots of reasons that could happen.

derilzemer wrote:
I use the .htaccess and adapted only my access credentials that i use by the other websites on my local Server.

Does this mean that you had added this to the top of the Gallery htaccess file?

AuthType Basic
AuthName "Passworteingabe fuer Gallery Photoalbum von Muellers"
AuthUserFile /var/htpasswd/.htpasswdgallery
AuthGroupFile /dev/null
require valid-user

Either way, if it's working now, it's probably okay to keep whatever ended up working.

 
derilzemer

Joined: 2013-01-27
Posts: 4
Posted: Sun, 2013-01-27 16:58

Hi,

problem depends on active apache configuration. If i disabled the .htaccessfile from Gallery3 and use the mine I got access.
So it is okay at the moment. It works :-).

Thanks for reply
Andreas

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sun, 2013-01-27 17:24

Glad it's working.

FYI: You could shrink the number of lines by moving your deny sections to setenv sections.

For example, you could delete this:

deny from 203.162.27.94
deny from 203.162.27.90
deny from 203.162.27.95

And instead add this to the section above it:
Setenvif Remote_Addr "^203\.162\.27\.9[0|4|5]" boeser

Likewise, you could delete this:

deny from 85.115.112. #Latvia Riga Mits Lv Sia
deny from 85.115.113. #Latvia Riga Mits Lv Sia
deny from 85.115.114. #Latvia Riga Mits Lv Sia
deny from 85.115.115. #Latvia Riga Mits Lv Sia
deny from 85.115.116. #Latvia Riga Mits Lv Sia
deny from 85.115.117. #Latvia Riga Mits Lv Sia
deny from 85.115.118. #Latvia Riga Mits Lv Sia
deny from 85.115.119. #Latvia Riga Mits Lv Sia

And add this:

#Latvia Riga Mits Lv Sia
Setenvif Remote_Addr "^85\.115\.11[2-9]\.(.*)" boeser

You could also do replacements in the setenv section that you have now.

setenvifnocase Referer "^http://www.asian-4you.net/" boeser
setenvifnocase Referer "^http://www.asian-trans.net/" boeser
setenvifnocase Referer "^http://www.asiantrans.net/" boeser

Would become:
setenvifnocase Referer "^http://www.asian(-)?(4you|trans).net/" boeser

And

setenvifnocase Referer "^http://www.aeyj.com/" boeser
setenvifnocase Referer "^http://www.aeyl.com/" boeser
setenvifnocase Referer "^http://www.aeyv.com/" boeser
setenvifnocase Referer "^http://www.aeqb.com/" boeser
setenvifnocase Referer "^http://www.aeqk.com/" boeser
setenvifnocase Referer "^http://www.aeqw.com/" boeser
setenvifnocase Referer "^http://www.aeqy.com/" boeser
setenvifnocase Referer "^http://www.aewj.com/" boeser
setenvifnocase Referer "^http://www.aexv.com/" boeser

Would become
setenvifnocase Referer "^http://www.ae(yj|yl|yv|qb|qk|qw|qy|wj|xv).com/" boeser

None of this is required (so if you can't figure it out, don't worry about it), but as the list of ips gets larger, this will help reduce your overall file size.

 
derilzemer

Joined: 2013-01-27
Posts: 4
Posted: Sun, 2013-01-27 17:54

Hi tempg,

thanks a lot for your clue. I will edit the lines asap

Is there any possibility to upload and play videos with gallery3? I cant find any solution. It works on Gallery2 but it didn't work on Gallery3?

regards
Andreas

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sun, 2013-01-27 18:50

http://codex.galleryproject.org/Category:Gallery_3:Modules

Quote:
I have installed ffmpeg, videos, videodimensions, and server_add

http://galleryproject.org/node/105473