I want to directly access the content in the version library and automatically execute php and directly access images like accessing directories. The svn module has been loaded in apache and the svn http access is opened through {code. However, in localhostsvn, php will be directly opened... I want to directly access the content in the version library and automatically execute php and directly access images like accessing directories.
The svn module has been loaded in apache and passed
DAV svn SVNPath "/Users/mike/opt/svn"
Opened the svn http access. Howeverhttp://localhost/svnPhp will be opened directly (you can see the content), but the image cannot be opened (blank)
Reply content:
I want to directly access the content in the version library and automatically execute php and directly access images like accessing directories.
The svn module has been loaded in apache and passed
DAV svn SVNPath "/Users/mike/opt/svn"
Opened the svn http access. Howeverhttp://localhost/svnPhp will be opened directly (you can see the content), but the image cannot be opened (blank)
The svn module of apache can only provide the svn preview function and cannot be used to directly execute files. Because svn is not stored in files on the server, it is stored in data files in a certain format. The svn module is used to parse this format.
You can useSvn hookThe svn hook function allows you to insert the command you want to execute before or after the version is submitted.
First, create a web directory on the server for later access. For example, you can solve the permission problem yourself)
mkdir /wwwroot/svn-preview/
Configure the php runtime environment of this directory in apache to ensure that it can be accessed.
Check out a copy of code to this directory (replace the svn url by yourself)
svn co http://my-svn-host/my-svn-path /wwwroot/svn-preview/ --username=my-svn-username
Now we have completed the latest version of code and can access it. Then we need to solve the problem of automatic synchronization. Find the svn repos directory. From your example, it seems to be/Users/mike/opt/svnThis directory.
cd /Users/mike/opt/svn/hooksls
As you can see, there are a lot of hook template files (ending with tmpl, you just need to remove the suffix and change it to take effect ). What we need is synchronization after submission, so findpost-commit.tmpl, Copy it
cp post-commit.tmpl post-commitchmod +x post-commitvim post-commit
In this case, the hook file is opened. In this example, an email notification is sent after each submission.#Add them to the beginning of the line and comment them out. We don't need it. Adding our command at the end is actually a line
svn up /wwwroot/svn-preview/ --username=my-svn-username --password=my-svn-password
Submit a file to svn and access the file to see if the synchronization is normal.
You must add the source code before configuring svn for synchronization.
Export LANG = zh_CN.UTF8
Svn up/wwwroot/svn-preview/-- username = my-svn-username -- password = my-svn-password