Preparing the environment:
Ali cloud ecs machine, 2 nuclear 4G100G plate, centos7.6
Software Requirements:
httpd,python,mysql,memcached,ReviewBoard
Installation Environment:
yum install wget vim lrzsz unzip git -y
System update package
yum update yum -y install epel-release yum install initscripts -y yum -y install python-pip yum install python-setuptools -y yum install python-devel -y yum install gcc python-devel libffi-devel openssl-devel patch -y
Install httpd
yum install httpd -y yum install mod_wsgi -y
Install Database
yum install mysql-devel -y yum install mysql-server -y yum install mariadb* -y
Install memcache
yum install memcached -y yum install python-memcached -y
Installation reviewboard
pip install -U pip setuptools pip install mysql-python yum install ReviewBoard -y ##pip install ReviewBoard ## easy_install mercurial easy_install P4PythonInstaller
Create a database
systemctl start mariadb mysql > create database reviewboard default charset utf8 collate utf8_general_ci; mysql > grant all privileges on reviewboard.* to 'reviewboard'@'127.0.0.1' identified by 'reviewboard'; mysql > grant all privileges on reviewboard.* to 'reviewboard'@'%' identified by 'reviewboard'; mysql > flush privileges;
Create a site
rb-site install /var/www/reviewboard
Domain Name: 192.168.4.101 (local ip as a web site) Root Path [/]: / Database Type: MySQL Database the Name [Reviewboard]: Reviewboard (use database created) Database Server [localhost]: 127.0.0.1 Database the Username: Reviewboard Database password: Reviewboard Cache Type: memcached Memcache Server [localhost: 11211]: localhost: 11211 the Username [admin]: admin password: ******** (set the login page admin password) E-Mail Address: 111111111 @ qq.com Company / Organization the Name (optional): * (you can fill in your own logo) the Allow US to Support the collect the Data [the Y-/ the n-]:? (you can just press Enter)
Configuration changes
/var/www/reviewboard/conf/settings_local.py allowed_hosts = [ '*'] ## to allow web interview chown -R & lt Apache: Apache / var / WWW / Reviewboard / CP / var / WWW / Reviewboard / the conf / Apache - An the /etc/httpd/conf.d/ wsgi.conf CAT /var/www/reviewboard/conf/apache-wsgi.conf >> /etc/httpd/conf/httpd.conf
Start Service
service memcached start service httpd restart
Access page: http://192.168.4.101/
Use https and domain names:
Create a certificate directory mkdir -p / etc / apache2 / ssl / cd / etc / apache2 / ssl / rz upload the certificate [root @ localhost ~] # LL / etc / apache2 / ssl / Total 8 -rw-r - r-- the root 13 is the root 1679-Nov. 1 14:10 superlee.com.key -rw-R & lt - r---Nov. 1 3912 of the root 13 is the root 14:10 superlee.com.pem
安装mod_ssl yum install mod_ssl openssl -y a2enmod ssl a2ensite default-ssl
修改httpd配置
<Directory /> AllowOverride All RewriteEngine on RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(.*)?$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R] </Directory> <VirtualHost *:443> ServerName reviewboard.tuosuperlee.com DocumentRoot "/var/www/reviewboard/htdocs" SSLEngine on SSLCertificateFile /etc/apache2/ssl/superlee.com.pem SSLCertificateKeyFile /etc/apache2/ssl/superlee.com.key # Error handlers ErrorDocument 500 /errordocs/500.html WSGIPassAuthorization On WSGIScriptAlias "/" "/var/www/reviewboard/htdocs/reviewboard.wsgi/" <Directory "/var/www/reviewboard/htdocs"> AllowOverride All Options -Indexes +FollowSymLinks Require all granted </Directory> # Prevent the server from processing or allowing the rendering of # certain file types. <Location "/media/uploaded"> SetHandler None Options None AddType text/plain .html .htm .shtml .php .php3 .php4 .php5 .phps .asp AddType text/plain .pl .py .fcgi .cgi .phtml .phtm .pht .jsp .sh .rb <IfModule mod_php5.c> php_flag engine off </IfModule> # Force all uploaded media files to download. <IfModule mod_headers.c> Header set Content-Disposition "attachment" </IfModule> </Location> # Alias static media requests to filesystem Alias /media "/var/www/reviewboard/htdocs/media" Alias /static "/var/www/reviewboard/htdocs/static" Alias /errordocs "/var/www/reviewboard/htdocs/errordocs" Alias /favicon.ico "/var/www/reviewboard/htdocs/static/rb/images/favicon.png" </VirtualHost>
重启httpd
systemctl restart httpd
浏览器访问域名:
访问reviewboard.superlee.com 自动跳转443
附:综合源history记录
2 df -h 3 yum install wget vim lrzsz unzip -y 4 yum install git -y 5 yum install httpd -y 6 yum update 7 yum install mod_wsgi -y 8 ll /etc/httpd/conf.d/wsgi.conf 9 yum install initscripts 10 yum -y install epel-release 11 yum -y install python-pip 12 yum install python-setuptools 13 yum install python-devel 14 yum install mod_wsgi 15 yum install memcached -y 16 yum install gcc python-devel libffi-devel openssl-devel patch -y 17 yum install mysql-devel 18 yum install mysql-server 19 yum install mariadb* 20 pip install -U pip setuptools 21 pip install mysql-python 22 mysql 23 systemctl start mariadb 24 mysql 25 yum install ReviewBoard 26 pip install ReviewBoard 27 yum install git-core 28 easy_install mercurial 29 easy_install P4PythonInstaller 30 rb-site install /var/www/reviewboard 31 chown -R apache:apache /var/www/reviewboard/ 32 cp /var/www/reviewboard/conf/apache-wsgi.conf /etc/httpd/conf.d/ 33 cat /var/www/reviewboard/conf/apache-wsgi.conf >> /etc/httpd/conf/httpd.conf 34 service memcached start 35 service httpd restart 36 history 37 ll /etc/apache2/ssl/ 38 ll /etc/apache2/ssl 39 ll /etc/apache2/ 40 mkdir -p /etc/apache2/ssl/ 41 cd /etc/apache2/ssl/ 42 rz 43 ll 44 yum install mod_ssl openssl 45 a2enmod ssl 46 a2ensite default-ssl 47 vi /etc/httpd/conf/httpd.conf 48 systemctl restart httpd 49 vi /var/www/reviewboard/conf/settings_local.py 50 systemctl restart httpd