-
Notifications
You must be signed in to change notification settings - Fork 3
Enhanced "Installation" to document WEBSVN_PATH_CONF. #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
20948be
Enhanced "Installation" two document WEBSVN_PATH_CONF.
ams-tschoening 5cb0503
Merge branch 'master' into ghi_86_conf_by_env_var
ams-tschoening e79b608
Fixed multiple spelling errors mentioned by @michael-o.
ams-tschoening 4106b5b
Fixed multiple spelling errors mentioned by @michael-o.
ams-tschoening 61141dd
"hard-coded" was the correct term.
ams-tschoening File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,18 +91,19 @@ <h2><a name="why"></a>Why WebSVN?</h2> | |
<p>Since it's written using PHP, WebSVN is also very portable and easy to install.</p> | ||
|
||
<h2><a name="installation"></a>Installation</h2> | ||
<h3>Sources and dependencies</h3> | ||
|
||
<p> | ||
Grab the source and stick it somewhere that your server can get to. You need to have | ||
<strong>PHP 5.6</strong> or greater installed and working. Additionally you need | ||
<strong>SVN 1.7</strong> or greater. Also note that WebSVN won't currently work in safe | ||
mode, due to the need to call the <code>svn</code> and <code>svnlook</code> commands. While | ||
no other external programs are required, you need to provide additional PHP libraries if not | ||
already installed. It's recommended to use the package manager of your OS-distribution for | ||
already installed. It's recommended to use the package manager of your operating system for | ||
each individual library or, if it doesn't provide those, that of PHP itself called | ||
<strong>PEAR</strong>. At least PEAR should most likely be available using the package | ||
manager of your OS-distribution. With e.g. a Debian based Linux simply issue the following | ||
commands to install the dependencies using PEAR: | ||
<strong>PEAR</strong>. At least PEAR should most likely be available using your package | ||
manager. With e.g., a Debian based operating system simply issue the following commands to | ||
install the dependencies using PEAR: | ||
</p> | ||
|
||
<ol> | ||
|
@@ -116,15 +117,114 @@ <h2><a name="installation"></a>Installation</h2> | |
<p> | ||
If it isn't already, make sure the cache directory has permissions of at least 0700 and is | ||
owned by the process your webserver is running under. This is used to cache RSS files. It | ||
is NOT recommended to set the directory to full write, 0777. | ||
is <em>not</em> recommended to set the directory to full write, 0777. | ||
</p> | ||
|
||
<h3>Configuration</h3> | ||
|
||
<p> | ||
WebSVN always requires a special configuration file, for which a template is provided as | ||
<code>include/distconfig.php</code>. Only the things mentioned in that template are valid | ||
configs at all and some of those are even necessary, e.g., WebSVN obviously needs to know | ||
which SVN repos it should publish. Making the necessary config file available to WebSVN can | ||
be done using two ways: Either simply by copying the template file to the hard-coded path | ||
ams-tschoening marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<code>include/config.php</code> and/or by setting the environment variable | ||
<code>WEBSVN_PATH_CONF</code> in a way so that PHP can read its value. That value is | ||
expected to be the path to the config file to use and things like symlinks work as well of | ||
course, as long as those are handled transparently by the file system. | ||
</p> | ||
|
||
<p> | ||
Using the environment variable has two main benefits: One doesn't neet to store additional | ||
files in the deployment of WebSVN and the path given by <code>WEBSVN_PATH_CONF</code> is | ||
used <em>additionally</em> to <code>include/config.php</code>, if that file is present at | ||
all. If not, the file given by the environment variable is used exclusively. This approach | ||
allows to override specially chosen configs of some main configuration file using another | ||
one based on things like the current location of a request to WebSVN. A webserver like | ||
Apache HTTPd could be configured using <code>Location</code> blocks to provide different | ||
paths to config files using the environment variable like in the following example: | ||
</p> | ||
|
||
<pre> | ||
<Location "/websvn/[...]"> | ||
SetEnv WEBSVN_PATH_CONF "/home/websvn/config/[...]/config.php" | ||
</Location></pre> | ||
|
||
<p> | ||
Considering both the hard-coded config file path and the more dynamic environment variable | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. drop the hyphen |
||
allows setups in which one installation of WebSVN hosts various SVN repos configured using | ||
<code>$config->parentPath(...)</code>. That statement would simply be added the those files | ||
only provided by the environment variable and depending on the location of some request. All | ||
other common things like available templates, syntax highlighting, etc. would be set in | ||
<code>include/config.php</code>. That allows structuring SVN repos using subdirs like is | ||
supported by <code>svnserve</code>, which is otherwise not supported by WebSVN. The latter | ||
checks if each directory is an SVN repo already or simply ignores it. The following is a | ||
more comprehensive example: | ||
</p> | ||
|
||
<ul> | ||
<li> | ||
/home/svn_repos/ParentDir1 | ||
<ul> | ||
<li>Repo1</li> | ||
<li>Repo2</li> | ||
<li> | ||
ParentDir2 | ||
<ul> | ||
<li>Repo3</li> | ||
<li>Repo4</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
<li> | ||
/home/svn_repos/ParentDir3 | ||
<ul> | ||
<li>Repo5</li> | ||
<li>Repo6</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
|
||
<pre> | ||
<Location "/websvn/ParentDir1"> | ||
SetEnv WEBSVN_PATH_CONF "/home/websvn/config/ParentDir1/config.php" | ||
</Location> | ||
|
||
<Location "/websvn/ParentDir1/ParentDir2"> | ||
SetEnv WEBSVN_PATH_CONF "/home/websvn/config/ParentDir1/ParentDir2/config.php" | ||
</Location> | ||
|
||
<Location "/websvn/ParentDir3"> | ||
SetEnv WEBSVN_PATH_CONF "/home/websvn/config/ParentDir3/config.php" | ||
</Location></pre> | ||
|
||
<p><code>/home/websvn/config/ParentDir1/config.php</code>:</p> | ||
|
||
<pre> | ||
<?php | ||
$config->parentPath("/home/svn_repos/ParentDir1"); | ||
?></pre> | ||
|
||
<p><code>/home/websvn/config/ParentDir1/ParentDir2/config.php</code>:</p> | ||
|
||
<pre> | ||
<?php | ||
$config->parentPath("/home/svn_repos/ParentDir1/ParentDir2"); | ||
?></pre> | ||
|
||
<p><code>/home/websvn/config/ParentDir3/config.php</code>:</p> | ||
|
||
<pre> | ||
<?php | ||
$config->parentPath("/home/svn_repos/ParentDir3"); | ||
?></pre> | ||
|
||
<p> | ||
Make a copy of | ||
<code>include/distconfig.php</code> and name it <code>include/config.php</code>, then edit | ||
it as directed in the file itself. Even with only the default config file, pointing your | ||
browser at the <code>index.php</code> file should display a WebSVN page that instructs you | ||
to set up one or more repositories. | ||
In such a setup, the directory <code>/home/websvn/config/</code> could be a SVN working copy | ||
containing the default config under <code>/home/websvn/config/config.php</code>, being | ||
symlinked into the formerly mentioned target in the installation directory of WebSVN. This | ||
allows all configs to be managed at the same place and optionally versioned as well. | ||
</p> | ||
|
||
<!-- | ||
|
@@ -258,7 +358,7 @@ <h3><a name="multiviewsexample"></a>Multiviews example</h3> | |
<p> | ||
First, Apache needs to know that you want to enable MultiViews for the root directory. You | ||
may need to enable the MultiViews option in the Apache configuration, as explained in | ||
<a href="http://httpd.apache.org/docs/2.2/content-negotiation.html#multiviews">these Apache | ||
<a href="http://HTTPd.apache.org/docs/2.2/content-negotiation.html#multiviews">these Apache | ||
docs</a>. For example, if my Apache directory root were set <code>/var/apache/htdocs</code>, | ||
the corresponding block in Apache might look something like this: | ||
</p> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.