您的位置:首页 > 运维架构 > Linux

在linux环境下使用命令行控制redmine各项服务

2017-02-09 15:50 375 查看
最近有学员问:在windows环境下或者linux图形界面时,redmine各项服务可以通过操作图形界面操控,如下图所示。但是当在linux纯命令行界面时,该如何操作来控制redmine各项服务呢?








解决方案:
步骤1:打开linux下的命令行窗口,进入redmine的安装目录文件夹,发现文件“ctlscript.sh”,运行./ctlscript.sh,出现如下提示:

[root@localhost opt]# cd redmine-3.0.3-0/
[root@localhost redmine-3.0.3-0]# ls
apache2 ctlscript.sh mysql README.txt uninstall
apps git perl ruby uninstall.dat
changelog.txt img php scripts use_redmine
common licenses postgresql sqlite
config manager-linux.run properties.ini subversion

[root@localhost redmine-3.0.3-0]# ./ctlscript.sh
usage: ./ctlscript.sh help
./ctlscript.sh (start|stop|restart|status)
./ctlscript.sh (start|stop|restart|status) mysql
./ctlscript.sh (start|stop|restart|status) apache
./ctlscript.sh (start|stop|restart|status) subversion

help - this screen
start - start the service(s)
stop - stop the service(s)
restart - restart or start the service(s)
status - show the status of the service(s)

步骤2:如果是设置所有的服务,直接操作./ctlscript.sh + start/stop/restart/status就可以了,如下所示:

[root@localhost redmine-3.0.3-0]# ./ctlscript.sh status
subversion already running
apache already running
mysql already running

[root@localhost redmine-3.0.3-0]# ./ctlscript.sh restart
/opt/redmine-3.0.3-0/subversion/scripts/ctl.sh : subversion stopped
Syntax OK
/opt/redmine-3.0.3-0/apache2/scripts/ctl.sh : httpd stopped
/opt/redmine-3.0.3-0/mysql/scripts/ctl.sh : mysql stopped
170209 15:23:53 mysqld_safe Logging to '/opt/redmine-3.0.3-0/mysql/data/mysqld.log'.
170209 15:23:53 mysqld_safe Starting mysqld.bin daemon with databases from /opt/redmine-3.0.3-0/mysql/data
/opt/redmine-3.0.3-0/mysql/scripts/ctl.sh : mysql started at port 3306
Syntax OK
/opt/redmine-3.0.3-0/apache2/scripts/ctl.sh : httpd started at port 80
/opt/redmine-3.0.3-0/subversion/scripts/ctl.sh : subversion started at port 3690

步骤3:如果是设置单独的服务,直接操作./ctlscript.sh + start/stop/restart/status + apache/mysql/subversion就可以了,例如apache服务的关闭、状态查询和开启,如下所示:

[root@localhost redmine-3.0.3-0]# ./ctlscript.sh stop apache
Syntax OK
/opt/redmine-3.0.3-0/apache2/scripts/ctl.sh : httpd stopped
[root@localhost redmine-3.0.3-0]# ./ctlscript.sh status apache
apache not running
[root@localhost redmine-3.0.3-0]# ./ctlscript.sh start apache
Syntax OK
/opt/redmine-3.0.3-0/apache2/scripts/ctl.sh : httpd started at port 80
mysql和subversion的服务状态操作类似,不在赘述,同学们自行实验即可。

Redmine项目管理平台之实战视频课程(新增第5章应用技术更新)

http://edu.51cto.com/course/course_id-3686.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息