1. Pre-install and configure the jdk environment
cd / opt
2. Install and configure apache
Install apache online
yum install httpd httpd-devel
start the service
service httpd start
Enable port filtering in the firewall
vi /etc/sysconfig/iptables
追加:-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
Restart the service: service iptables restart
Access verification: http://192.168.0.206/
View service level: chkconfig --list | grep httpd
Set the boot to start automatically: chkconfig httpd on
Modify the ServerName configuration:
vi /etc/httpd/conf/httpd.conf, modified to: ServerName localhost:80
2. Install SVN service
yum install mod_dav_svn subversion
The mod_dav_san module is used as the interface between Subversion and Apache. Through it, Apache can access the repository, and the client can also use the HTTP extension protocol WebDAV/DeltaV to access.
-- Check if the module is integrated
ls /etc/httpd/modules/ | grep svn
-- view svn version
svn --version
--Create svn library home directory
mkdir /svn/
--Modify the configuration file after apache integrates svn (the file generated when mod_dav_svn is installed)
vi /etc/httpd/conf.d/subversion.conf
Append the following configuration at the end of the file:
#Include /svn/httpd.conf
<Location /svn/>
DAV svn
SVNListParentPath on
SVNParentPath /svn
AuthType Basic
AuthName "Subversion repositories"
AuthUserFile /svn/passwd.http
AuthzSVNAccessFile /svn/authz
Require valid-user
</Location>
RedirectMatch ^(/svn)$ $1/
--Create authorization related files
touch /svn/passwd.http
touch /svn/authz
3. Install MySql (svnadmin project needs to connect to the database)
--Online installation related services
yum install mysql-server mysql mysql-devel
--start service
service mysqld start
View service level: chkconfig --list | grep mysqld
Set the boot to start automatically: chkconfig mysqld on
Enable port filtering in the firewall
vi /etc/sysconfig/iptables
追加:-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
Restart the service: service iptables restart
--Set mysql root user password
mysqladmin -u root password 'test'
--login to the database
mysql -u root -p
-- authorize remote access
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'test' WITH GRANT OPTION;
FLUSH PRIVILEGES;
--quit
exit
4. Install tomcat and deploy svnadmin
--Extract (current directory: /opt)
tar -zxvf apache-tomcat-7.0.61.tar.gz
Enable port filtering in the firewall
vi /etc/sysconfig/iptables
追加:-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
Restart the service: service iptables restart
--Clean up the webapps directory files and upload the war package of svnadmin
cd apache-tomcat-7.0.61/webapps/
rm -rf *
--Unzip the war package
unzip svnadmin.war -d svnadmin
--delete war package
rm -rf svnadmin.war
--Modify the project database configuration file
vi svnadmin / WEB-INF / jdbc.properties
Mainly modify the connection configuration such as username and password:
db=MySQL
#MySQL
MySQL.jdbc.driver=com.mysql.jdbc.Driver
MySQL.jdbc.url=jdbc:mysql://127.0.0.1:3306/svnadmin?characterEncoding=utf-8
MySQL.jdbc.username=root
MySQL.jdbc.password=rentuo
--Execute the database script, here use the SQLyog client to complete the initialization of the following steps
Execute the two scripts db/mysql5.sql and db/lang/en.sql
--start tomcat
cd /opt/apache-tomcat-7.0.61/
./bin/startup.sh
--Visit: http://192.168.0.206:8080/svnadmin/, enter the user name and password to enter the management page:
5. Create multi-library svn
URL: access prefix to select the address of the apache service
--Set the user for the manager group of the scm project (the user created at the first login)
set user group - set user (manager group)
-- View the server svn directory:
A scm SVN library directory will be created under the /svn/ directory.
At the same time, there will be an additional httpd.conf file with the same content as subversion.conf, which has been configured in /etc/httpd/conf.d/subversion.conf.
--View file content: cat /svn/authz
[aliases]
[groups]
scm_developer=
scm_manager=root
scm_tester =
[scm:/]
@scm_manager=rw
--View file content: cat passwd.http
root:{SHA}EihbTlHCo5g9sgUIO0kSrfVxHR7=
--View apache configuration file
cat /etc/httpd/conf/httpd.conf
Can see the group and user named apache
-- Assign this user permission to access svn
chown -R apache.apache scm
chmod -R 777 scm
--Turn off SELinux (Access Control for Linux)
Modify the /etc/selinux/config file
# vi /etc/selinux/config
Change SELINUX=enforcing to SELINUX=disabled
Just restart the machine
# reboot