After we have installed the website service management system wdcp, we may have questions like this or that during use. Below are some points for you to learn. If you do not know anything, go to the wdlinux forum to find related tutorials. How
After we have installed the website service management system wdcp, we may have questions like this or that during use. Below are some points for you to learn. If you do not know anything, go to the wdlinux forum to find related tutorials.
How to modify the interface or template of the wdcp system
Wdcp is templated from version 2. that is to say, you can modify the template to modify the interface or page. Note the following two points:
1 it must be applied according to the structure and tag of the original template.
2. the wdcp version and related connections must be retained.
The template directory file is under the templates Directory. The Complete Directory is
/Www/wdlinux/wdcp/templates
Modification method
1. create a directory in/www/wdlinux/wdcp, such as templates_me.
The Complete Directory is
/Www/wdlinux/wdcp/templates_me
The newly designed page or template can be placed in this directory.
However, you must follow the structure and label call method of the original template.
2. after the upload is modified, log on to the background system settings and set the template directory to the directory set above, as shown in figure
Save and refresh
Important
For a new page or template, the relevant version and connection information of wdlinux must be retained.
If you want to remove it, you can contact and authorize it to remove it.
2. install SVN on the basis of the one-click WDCP installation package and implement synchronous nginx web update
I. Installation
1. check whether cvs is installed.
Rpm-qa | grep subversion
2. Installation
Yum install subversion
3. test whether the installation is successful.
/Usr/bin/svnserve -- version
If the following message is displayed, the installation is successful.
--------------------------------------
Svnserve, Version 1.6.11 (r934serve)
Compiled on Apr 11, maid: 28: 04
Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/site.
This product contains software developed by CollabNet (http://www.Collab.Net.
The backend (FS) module of the library is available in the following versions:
* Fs_base: The module can only operate BDB version libraries.
* Fs_fs: This module works with the text file (FSFS) version Library.
Cyrus SASL authentication is available.
--------------------------------------------------------------
II. configuration
1. create a directory: repos can be used to store all SVN files.
Mkdir-p/opt/svndata/repos
Note: The Directory (project name) path here can be changed in the following format:
Mkdir-p directory path (for example, mkdir-p/www/svn/project)
2. create a version repository (use svnadmin create directory repository path to be consistent with the directory created above)
Svnadmin create/opt/svndata/repos
3. modify the configuration file of the svn repository.
Vi/opt/svndata/repos/conf/svnserve. conf
Modify the format as follows. The value of realm is the project name, which is repos in this example.
[General]
Anon-access = none
Auth-access = write
Password-db =/opt/svndata/project/conf/passwd
Authz-db =/opt/svndata/project/conf/authz
Realm = repos
Note: modifications to user configuration files take effect immediately without the need to restart svn.
4. add a user
Vi/opt/svndata/repos/conf/passwd
To add SVN users, you only need to add an entry in the format of "username = password" to the/opt/svn/project/conf/passwd file.
For testing, I added the following content:
[Users]
# Harry = harryssecret
# Sally = sallyssecret
Pm = pm_pw
Server_group = server_pw
Client_group = client_pw
Test_group = test_pw
5. modify the user access policy
Vi/opt/svndata/repos/conf/authz
Record the user's access policy. The following is a reference:
[Groups]
Project_p = pm
Project_s = server_group
Project_c = client_group
Project_t = test_group
[Project:/]
@ Project_p = rw
* =
[Project:/server]
@ Project_p = rw
@ Project_s = rw
* =
[Project:/client]
@ Project_p = rw
@ Project_c = rw
* =
[Project:/doc]
@ Project_p = rw
@ Project_s = rw
@ Project_c = rw
@ Project_t = rw
* =
The above information indicates that only pm has the read and write permission for the root directory, server_group can access the server directory, client_group can access the client directory, and everyone can access the doc directory.
Of course, the above is a complicated permission control. if it is just a test, it can be simpler. Create a user group and place all users to one user group, as shown below:
[Groups]
Admin = pm, server_group, client_group, test_group
[/]
@ Admin = rw
This article does not detail permission control. you can consult du Niang.
5. start the svn service
Svnserve-d -- listen-port 3690-r/opt/svndata/repos (run as root user)
If multiple projects are under development at the same time, you can enable multiple SVN services through different ports. remember to add the port number when using TortoiseSVN.
6. test the svn server
Enter the website root directory
Cd/www/web/repos/public_html
Svn co svn: // 127.0.0.1: 3690/www/web/repos/public_html -- username pm -- password pm_pw
The following authentication prompt appears:
-----------------------------------------------------------------------
Note! Your password, for the authentication domain:
<Svn: // 127.0.0.1: 3690> repos
Only files on disks can be stored in plain text! If possible, consider configuring your system to make Subversion
You can save the encrypted password. See the documentation for details.
You can set the option "store-plaintext-passwords" to "yes" or "no" in "/root/. subversion/servers ",
To avoid this warning again.
-----------------------------------------------------------------------
Save unencrypted password (yes/no )?
Enter "yes" and press Enter. because no files have been added to the version repository, the version is 0, as shown below:
Obtain version 0.
3. configure post-commit to automatically synchronize svn version library files to the web Directory.
In order to directly synchronize the code submitted to the SVN server after modification, the WEB server needs to configure the SVN hook to enter the hooks directory,
Cd/opt/svndata/repos/hooks
Ls
You can see that there is a post-commit.tmpl file, this is a template file, copy a copy under this directory, name it post-commit, and set its user group to www, and set it to executable:
Cppost-commit.tmpl post-commit
Chown www: www post-commit
Chmod + x post-commit
In this way, you have the permission to access the www directory.
All the original code in the file is commented out. you can run the shell command to call this file every time the commit is completed.
The file content can be found below:
Vi post-commit
#! /Bin/sh
Export LANG = zh_CN.UTF-8
REPOS = "$1"
REV = "$2"
SVN_PATH =/usr/bin/svn
WEB_PATH =/web/repos/public_html
LOG_PATH =/tmp/svn_update.log
#/Usr/bin/svn update -- username user -- password $ WEB_PATH -- no-auth-cache
Echo "nnn ######### start to submit" 'date "+ % Y-% m-% d % H: % M: % S "'' ####################'> $ LOG_PATH
Echo 'whoam', $ REPOS, $ REV> $ LOG_PATH
$ SVN_PATH update -- username user -- password $ WEB_PATH -- no-auth-cache> $ LOG_PATH
Chown-R www: www $ WEB_PATH
Note:
1 ,#! /Bin/sh: run the shell command/* to set the environment variable. If no environment variable is set, an update error may occur */
2, export LANG = zh_CN.UTF-8 is to solve svn post commit Chinese garbled.
If you are GBK encoded, you may prompt: Error output cocould not be translated from the native locale to UTF-8
This is the client and server encoding problem, the default is UTF-8, you can try to set export LANG = zh_CN.GBK or export LANG = en_US.UTF-8
# Update
3. svn update-username the username of your version Library-password username password svn: // your IP address: Port/web/repos/public_html
4. chown-R www: www $ WEB_PATH
All the original code in the file is commented out. you can run the shell command to call this file every time the commit is completed.
3. how to install SVN and install nginx web synchronously based on the one-click WDCP installation package
1. check whether cvs is installed.
Rpm-qa | grep subversion
2. Installation
Yum install subversion
3. test whether the installation is successful.
/Usr/bin/svnserve -- version
If the following message is displayed, the installation is successful.
--------------------------------------
Svnserve, Version 1.6.11 (r934serve)
Compiled on Apr 11, maid: 28: 04
Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/site.
This product contains software developed by CollabNet (http://www.Collab.Net.
The backend (FS) module of the library is available in the following versions:
* Fs_base: The module can only operate BDB version libraries.
* Fs_fs: This module works with the text file (FSFS) version Library.
Cyrus SASL authentication is available.
--------------------------------------------------------------
II. configuration
1. create a directory: repos can be used to store all SVN files.
Mkdir-p/opt/svndata/repos
Note: The Directory (project name) path here can be changed in the following format:
Mkdir-p directory path (for example, mkdir-p/www/svn/project)
2. create a version repository (use svnadmin create directory repository path to be consistent with the directory created above)
Svnadmin create/opt/svndata/repos
3. modify the configuration file of the svn repository.
Vi/opt/svndata/repos/conf/svnserve. conf
Modify the format as follows. The value of realm is the project name, which is repos in this example.
[General]
Anon-access = none
Auth-access = write
Password-db =/opt/svndata/project/conf/passwd
Authz-db =/opt/svndata/project/conf/authz
Realm = repos
Note: modifications to user configuration files take effect immediately without the need to restart svn.
4. add a user
Vi/opt/svndata/repos/conf/passwd
To add SVN users, you only need to add an entry in the format of "username = password" to the/opt/svn/project/conf/passwd file.
For testing, I added the following content:
[Users]
# Harry = harryssecret
# Sally = sallyssecret
Pm = pm_pw
Server_group = server_pw
Client_group = client_pw
Test_group = test_pw
5. modify the user access policy
Vi/opt/svndata/repos/conf/authz
Record the user's access policy. The following is a reference:
[Groups]
Project_p = pm
Project_s = server_group
Project_c = client_group
Project_t = test_group
[Project:/]
@ Project_p = rw
* =
[Project:/server]
@ Project_p = rw
@ Project_s = rw
* =
[Project:/client]
@ Project_p = rw
@ Project_c = rw
* =
[Project:/doc]
@ Project_p = rw
@ Project_s = rw
@ Project_c = rw
@ Project_t = rw
* =
The above information indicates that only pm has the read and write permission for the root directory, server_group can access the server directory, client_group can access the client directory, and everyone can access the doc directory.
Of course, the above is a complicated permission control. if it is just a test, it can be simpler. Create a user group and place all users to one user group, as shown below:
[Groups]
Admin = pm, server_group, client_group, test_group
[/]
@ Admin = rw
This article does not detail permission control. you can consult du Niang.
5. start the svn service
Svnserve-d -- listen-port 3690-r/opt/svndata/repos (run as root user)
If multiple projects are under development at the same time, you can enable multiple SVN services through different ports. remember to add the port number when using TortoiseSVN.
6. test the svn server
Enter the website root directory
Cd/www/web/repos/public_html
Svn co svn: // 127.0.0.1: 3690/www/web/repos/public_html -- username pm -- password pm_pw
The following authentication prompt appears:
-----------------------------------------------------------------------
Note! Your password, for the authentication domain:
Repos
Only files on disks can be stored in plain text! If possible, consider configuring your system to make Subversion
You can save the encrypted password. See the documentation for details.
You can set the option "store-plaintext-passwords" to "yes" or "no" in "/root/. subversion/servers ",
To avoid this warning again.
-----------------------------------------------------------------------
Save unencrypted password (yes/no )?
Enter "yes" and press Enter. because no files have been added to the version repository, the version is 0, as shown below:
Obtain version 0.
3. configure post-commit to automatically synchronize svn version library files to the web Directory.
In order to directly synchronize the code submitted to the SVN server after modification, the WEB server needs to configure the SVN hook to enter the hooks directory,
Cd/opt/svndata/repos/hooks
Ls
You can see that there is a post-commit.tmpl file, this is a template file, copy a copy under this directory, name it post-commit, and set its user group to www, and set it to executable:
Cppost-commit.tmpl post-commit
Chown www: www post-commit
Chmod + x post-commit
In this way, you have the permission to access the www directory.
All the original code in the file is commented out. you can run the shell command to call this file every time the commit is completed.
The file content can be found below:
Vi post-commit
#! /Bin/sh
Export LANG = zh_CN.UTF-8
REPOS = "$1"
REV = "$2"
SVN_PATH =/usr/bin/svn
WEB_PATH =/web/repos/public_html
LOG_PATH =/tmp/svn_update.log
#/Usr/bin/svn update -- username user -- password $ WEB_PATH -- no-auth-cache
Echo "nnn ######### start to submit" 'date "+ % Y-% m-% d % H: % M: % S "'' ####################'> $ LOG_PATH
Echo 'whoam', $ REPOS, $ REV> $ LOG_PATH
$ SVN_PATH update -- username user -- password $ WEB_PATH -- no-auth-cache> $ LOG_PATH
Chown-R www: www $ WEB_PATH
Note:
1 ,#! /Bin/sh: run the shell command/* to set the environment variable. If no environment variable is set, an update error may occur */
2, export LANG = zh_CN.UTF-8 is to solve svn post commit Chinese garbled.
If you are GBK encoded, you may prompt: Error output cocould not be translated from the native locale to UTF-8
This is the client and server encoding problem, the default is UTF-8, you can try to set export LANG = zh_CN.GBK or export LANG = en_US.UTF-8
# Update
3. svn update-username the username of your version Library-password username password svn: // your IP address: Port/web/repos/public_html
4. chown-R www: www $ WEB_PATH
All the original code in the file is commented out. you can run the shell command to call this file every time the commit is completed.