# websvn and wsvn

## BlinkEye

in fact, i got it working. i'm able to access my repositories through

http://hostname/wsvn/repo.

my problem is that i can't access them anymore via http://hostname/websvn. if clicked

upon a repository displayed by http://hostname/websvn i get redirected

to http://hostname/websvn/index/repos/?sc=0 which doesn't display the

repos but the same page as http://hostname/websvn without the images.

i've tried a lot of things but run out of ideas.

another issue is that it's not possible to place a .htaccess file within a repos. i'd

like to force an authentication for some repos but don't want to put

this in apaches config (because i don't want to restart apache for

simply changes some authentication variables). authentication placed in

apaches config actually works: 

#<Location /wsvn/repo/>

#SVNParentPath /var/svn

#AuthType Basic

#AuthUserFile /usr/local/apache/passwd/passwords

#AuthName "Subversion repository"

#Require user somebody

but as mentioned, i want to use a .htaccess file.

thanks for any hint

----------

## UberLord

You're using multiviews yes?

does http://hostname/websvn/wsvn work ?

If so, move the wsvn.php file to the htdocs root

http://hostname/wsvn now works  :Smile: 

----------

## BlinkEye

thanks for your help.

yes, i use multiview (at least it's activated in the websvn configs). you're right, if i had put wsvn.php in /websvn, it would be wrong. but http://localhost/websvn AND http://localhost/wsvn both work, except that i can't chose any repository from http://localhost/websvn anymore (links to a wrong place).

the howto isn't specific enough:

```
Finally, Apache needs to know that you want to enable MultiViews for the root

directory.  This can be done by including this line in the directory's

.htaccess file (assuming that the appropriate AllowOverrides directive is set

up):

Options MultiViews

If all has gone well, repositories should now by accessible by

http://servername/wsvn/repname
```

accessing repositories works, but i don't think the hole idea is to lose the ability to access them via websvn?

what is meant with letting know apache about multiview? i tried both, adding "Options MultiViews" to the root directory directive of apache or to the /websvn directive. none works, neither with or without Multiview and with or without a /websvn directive. i couldn't achieve to put Multiview in a .htaccess file, if i do that i'm no longer able to access  neither /websvn nor /wsvn. 

any help appreciated

----------

## UberLord

You're right - you can only have websvn or wsvn working - ie multiviews or no multiviews

You could always redirect requests to /websvn to /wsvn

----------

## UberLord

However, there's nothing to stop you from using webapp-config to install it to another location on the same server - one for multiviews and one without.

But that's up to you  :Wink: 

----------

## BlinkEye

i can't believe that. this would be really stupid. i don't want links a user might use which won't work correctly. 

i figured out a little "hack" to use both - but it has an issue:

```
# cat /var/www/localhost/websvn/.htaccess

RewriteEngine on

RewriteCond %{SERVER_PORT} 80

RewriteRule .* https://%{SERVER_NAME}/wsvn [R,L]

RewriteCond  http://%{SERVER_NAME}/websvn/ http://%{SERVER_NAME.$/wsvn

RewriteRule .* http://%{SERVER_NAME}/wsvn [R,L]
```

this allows a user to access http://hostname/websvn (redirects him to http://hostname/wsvn ), http://hostname/wsvn or https://hostname/wsvn. what doesn't work is https://hostname/websvn.

common guys, some one sure has a working solution. i'm still not at all satisfied

----------

## BlinkEye

 *UberLord wrote:*   

> However, there's nothing to stop you from using webapp-config to install it to another location on the same server - one for multiviews and one without.
> 
> But that's up to you 

 

thanks, i did that. but the situation doesn't change - because in your apache's root folder you have a svn.php or whatever which will redirect you to your websvn folder. this works, but a user is still able to access the websvn folder directly and with multiviews enabled you'll not get a proper directory listing. i think i may move the current multiview version of websvn to a directory no one ever guesses in order not to confuse users.

now, the BIG issue remains: although with multiview enabled i'm able to access my repos like http://hostname/websvn/repo setting some access limitations in apaches common.conf ONLY works for the first repos:

```
<Location /svn/honeyd/>

AuthType Basic

AuthUserFile /usr/local/apache/passwd/passwords

AuthName "repos1"

Require user user1

</Location>

<Location /svn/up/>

AuthType Basic

AuthUserFile /usr/local/apache/passwd/passwords

AuthName "repos2"

Require user user1

</Location>
```

accessing the repos1 asks me for a username and password, but not for the repos2.

as mentioned in my first post placing .htaccess files in the repos directories won't work neither. i thought one GREAT use of multiview was to use repo-specific restriction instead of global subversion ones ...

----------

## UberLord

 *BlinkEye wrote:*   

> i can't believe that. this would be really stupid. i don't want links a user might use which won't work correctly.

 

Why is it really stupid to configure for multiviews or not for multiviews?

Can you buy a car with left hand drive AND right hand drive? And even if you could, could you use both at the same time?

----------

## BlinkEye

 *UberLord wrote:*   

>  *BlinkEye wrote:*   i can't believe that. this would be really stupid. i don't want links a user might use which won't work correctly. 
> 
> Why is it really stupid to configure for multiviews or not for multiviews?
> 
> Can you buy a car with left hand drive AND right hand drive? And even if you could, could you use both at the same time?

 

i might have used the wrong words, so, sorry about that. but we're talking about the same: i don't like that i turn on multiviews and then i'm still able to access my repos via the listed way, although with errors. this would be like an apache running purely on https, but you could still access it via port 80 with some layout errors. 

anyway, back to the topic. i really need that access restricting. i simply can't get it to work! i appreciate any help, post your configs, pour out your ideas ... thanks!

----------

## BlinkEye

bump

----------

## UberLord

```
<location /websvn>

Order deny,allow

Deny all

</location>
```

May work

----------

## BlinkEye

 *UberLord wrote:*   

> 
> 
> ```
> <location /websvn>
> 
> ...

 

thanks for your input. this is a very good idea (i had just to change "Deny all" to "Deny from all"). i still don't like the idea of getting an access restricted error, so i put a .htaccess file in the websvn/ directory with the following:

```
RewriteEngine on

RewriteCond %{SERVER_PORT} 80

RewriteRule .* https://%{SERVER_NAME}/wsvn [R,L]
```

which redirects a user from http://servername/websvn to https://servername/wsvn (which is the multiview installation)

so, i got one thing working. the most important thing for me is now to get directory based access restricting to work. why does apache not read my .htaccess files in the corresponding /var/svn/repo_name ? why is it only possible to get it to work from within the apache conf file (i don't want to restart apache everytime i add a new repository with restricted access)?

----------

## UberLord

I'm no apache expert, but I think you need to allow the top level folder/location to allow overrides

----------

## BlinkEye

it's not working yet but i investigate further. i've read that somewhere too, so it might be the issue. thanks a lot for your help

----------

