[关闭]
@wddzzz 2018-04-26T21:43:28.000000Z 字数 3103 阅读 1027

服务器配置流程

服务器 SVN linux


环境

一台购置好的服务器,Cent OS 6.5 64位操作系统。

0.准备

  1. rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
  1. rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

1.安装

  1. yum install httpd //安装apache
  2. yum install mysql-server //安装mysql
  3. yum install php56w php56w-mysql //安装php
  4. yum install phpmyadmin //安装phpmyadmin
  5. yum install subversion //安装svn
  6. yum install mod_dav_svn //同上

或者一句话直接全部安装

  1. yum install httpd mysql-server php56w php56w-mysql phpmyadmin subversion mod_dav_svn

2.启动服务

  1. service httpd start
  2. service mysqld start

3.Config MySQL

  1. mysql_secure_installation

配置过程参考:http://www.jb51.net/article/47727.htm

  1. [root@server1 ~]# mysql_secure_installation
  2. NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
  3. SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
  4. In order to log into MySQL to secure it, we'll need the current
  5. password for the root user. If you've just installed MySQL, and
  6. you haven't set the root password yet, the password will be blank,
  7. so you should just press enter here.
  8. Enter current password for root (enter for none):<–初次运行直接回车
  9. OK, successfully used password, moving on…
  10. Setting the root password ensures that nobody can log into the MySQL
  11. root user without the proper authorisation.
  12. Set root password? [Y/n] <– 是否设置root用户密码,输入y并回车或直接回车
  13. New password: <– 设置root用户的密码
  14. Re-enter new password: <– 再输入一次你设置的密码
  15. Password updated successfully!
  16. Reloading privilege tables..
  17. … Success!
  18. By default, a MySQL installation has an anonymous user, allowing anyone
  19. to log into MySQL without having to have a user account created for
  20. them. This is intended only for testing, and to make the installation
  21. go a bit smoother. You should remove them before moving into a
  22. production environment.
  23. Remove anonymous users? [Y/n] <– 是否删除匿名用户,生产环境建议删除,所以直接回车
  24. … Success!
  25. Normally, root should only be allowed to connect from 'localhost'. This
  26. ensures that someone cannot guess at the root password from the network.
  27. Disallow root login remotely? [Y/n] <–是否禁止root远程登录,根据自己的需求选择Y/n并回车,建议禁止
  28. … Success!
  29. By default, MySQL comes with a database named 'test' that anyone can
  30. access. This is also intended only for testing, and should be removed
  31. before moving into a production environment.
  32. Remove test database and access to it? [Y/n] <– 是否删除test数据库,直接回车
  33. - Dropping test database…
  34. … Success!
  35. - Removing privileges on test database…
  36. … Success!
  37. Reloading the privilege tables will ensure that all changes made so far
  38. will take effect immediately.
  39. Reload privilege tables now? [Y/n] <– 是否重新加载权限表,直接回车
  40. … Success!
  41. Cleaning up…
  42. All done! If you've completed all of the above steps, your MySQL
  43. installation should now be secure.
  44. Thanks for using MySQL!
  45. [root@server1 ~]#

4.Config Startup

  1. chkconfig httpd on
  2. chkconfig mysqld on

5.配置phpmyadmin配置文件

phpMyAdmin的Apache配置文件路径:/etc/httpd/conf.d/phpMyAdmin.conf
找到以下代码段,修改为允许任意ip访问:Allow from All:

  1. <Directory /usr/share/phpMyAdmin/>
  2. AddDefaultCharset UTF-8
  3. <IfModule mod_authz_core.c>
  4. # Apache 2.4
  5. <RequireAny>
  6. Require ip 127.0.0.1
  7. Require ip ::1
  8. </RequireAny>
  9. </IfModule>
  10. <IfModule !mod_authz_core.c>
  11. # Apache 2.2
  12. Order Deny,Allow
  13. Deny from All
  14. Allow from 127.0.0.1
  15. Allow from ::1
  16. Allow from All //在这里添加这一行
  17. </IfModule>
  18. </Directory>

6.配置SVN

阿里云服务器需要手动开启3690端口以支持SVN的服务:

1.登录到阿里云后台

找位置

云服务ECS-安全组-配置规则

找位置

右上角 快速创建规则

创建规则

按照图中填写,确定即可

2.重启服务器

  1. reboot

3.创建测试svn

  1. svnadmin create /home/svn/test
  2. svnserve -d -r /home/svn //启动svn服务

4.修改svn配置文件

打开/home/svn/test/conf/svnserve.conf,找到以下代码行,取消注释

  1. auth-access = write
  2. password-db = passwd
  3. authz-db = authz

以后再创建svn的时候,复制这个配置文件到新的svn里,因为这三行默认都是注释掉的。

7.创建站点

创建站点详情见另一更详细的文档。

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注