我的虚拟主机配置文件统一放在/etc/httpd/conf/sites-available目录下,然后在/etc/httpd/conf/sites-enabled目录中分别对/etc/httpd/conf/sites-available中要启用的虚拟主机建立符号链接:
sudo mkdir -p /etc/httpd/conf/sites-available /etc/httpd/conf/sites-available
vim /etc/httpd/conf/sites-available/redmine.vhost
输入下面的内容:
<VirtualHost 58.63.245.211:80> ServerName redmine.dayatang.org ServerAdmin webmaster@dayatang.org DocumentRoot /home/apache/sites/redmine/public/ ErrorLog logs/redmine.dayatang.org_error_log LogLevel warn CustomLog logs/redmine.dayatang.org_access_log combined DefaultInitEnv RAILS_ENV production MaxRequestLen 20971520 <Directory "/home/apache/sites/redmine/public/"> Options Indexes ExecCGI FollowSymLinks Order allow,deny Allow from all AllowOverride all </Directory> <Location /> AddHandler fcgid-script .fcgi FCGIWrapper "/usr/local/bin/ruby /home/apache/sites/redmine/public/dispatch.fcgi" .fcgi </Location> </Virtualhost>存盘退出后在/etc/httpd/conf/sites-available中建立符号链接:
sudo ln -s /etc/httpd/conf/sites-available/redmine.vhost /etc/httpd/conf/sites-enabled/redmine.vhost如果Apache主配置文件尚未导入/etc/httpd/conf/sites-enabled目录,修改Apache主配置文件:
sudo vim /etc/httpd/conf/httpd.conf在文件末尾加入这么一行:
Include conf/sites-enabled/*.vhost存盘退出。
测试是否成功在命令行窗口运行下述命令:
sudo chown -R apache:apache /home/apache sudo service httpd restart然后打开浏览器,在地址栏中输入redmine.dayatang.org,看看是否可进入欢迎页面。
修改日志配置Redmine默认将日志记录到应用主目录下的log子目录。随着时间的推移,日志文件可能变得很大。为此可以考虑让它们增长到一定大小之后自动分割为多个文件。可以修改config/additional_environment.rb做到这一点。
cp config/additional_environment.rb.example config/additional_environment.rb vim config/additional_environment.rb输入下面的内容:
#Logger.new(PATH,NUM_FILES_TO_ROTATE,FILE_SIZE) config.logger = Logger.new('/path/to/logfile.log', 2, 1000000) config.logger.level = Logger::INFO我的/path/to/logfile.log是/usr/share/redmine/log/redmine.log。
备份Redmine备份要包括下面的内容:
数据(存储在redmine数据库内)
附件(存储在Redmine主目录下的files子目录内)
下面是一个简单的脚本,可用于每日备份:
# Database /usr/bin/mysqldump -u <username> -p<password> <redmine_database> | gzip > /path/to/backup/db/redmine_`date +%y_%m_%d`.gz # Attachments rsync -a /path/to/redmine/files /path/to/backup/files最简化的Ubuntu 10.04下Redmine部署方法
Ubuntu 9.10下搭建基于PostgreSQL的Redmine
如何将Turnkey Redmine 虚拟机从Redmine 1.0.5 升级到1.2