日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

基于centos搭建reviewboard

發布時間:2023/12/20 编程问答 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 基于centos搭建reviewboard 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

基于centos ,apache, mysql 安裝 reviewboard 3.0.17

Prepartion

1.CentOS Linux release 8.1.1911 (Core)

2.Samba install

3.dependences install

$ yum install gcc libffi-devel openssl-devel patch $ sudo yum install python2-devel.x86_64 $ sudo dnf install redhat-rpm-config $ sudo yum install make

Apache

1.Install Apache

To install Apache on your CentOS server, use the following command:

$ sudo yum install httpd.x86_64

2.Activate Apache

To activate Apache, start its service first.

1.start httpd.service

$sudo systemctl start httpd.service
  • Next, set the Apache service to start when the system boots:
  • $sudo systemctl enable httpd.service

    3.Verify Apache Service

    Display information about Apache, and verify it’s currently running with:

    $ sudo systemctl status httpd.service ● httpd.service - The Apache HTTP ServerLoaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)Active: active (running) since Mon 2020-01-27 08:55:21 EST; 1s agoDocs: man:httpd.service(8)Main PID: 3536 (httpd)Status: "Started, listening on: port 80"Tasks: 213 (limit: 5030)Memory: 17.2MCGroup: /system.slice/httpd.service├─3536 /usr/sbin/httpd -DFOREGROUND├─3537 /usr/sbin/httpd -DFOREGROUND├─3538 /usr/sbin/httpd -DFOREGROUND├─3539 /usr/sbin/httpd -DFOREGROUND└─3540 /usr/sbin/httpd -DFOREGROUNDJan 27 08:55:21 soar systemd[1]: Starting The Apache HTTP Server... Jan 27 08:55:21 soar systemd[1]: Started The Apache HTTP Server. Jan 27 08:55:21 soar httpd[3536]: Server configured, listening on: port 80

    4.Configure firewalld to Allow Apache Traffic

    In a standard installation, CentOS 7 is set to prevent traffic to Apache.

    Normal web traffic uses the http protocol on Port 80, while encrypted web traffic uses the https protocol, on Port 443.

  • Modify your firewall to allow connections on these ports using the following commands:
  • $sudo firewall-cmd --permanent --add-port=80/tcp $sudo firewall-cmd --permanent --add-port=443/tcp
  • Once these complete successfully, reload the firewall to apply the changes with the command:
  • $sudo firewall-cmd --reload

    5.Install mod_wsgi

    需要先確認是否有安裝apxs,若未安裝通過httpd-devl 安裝

    $ whereis apxs $ sudo yum install httpd-devel.x86_64

    安裝mod_wsgi

    $wget https://pypi.python.org/packages/28/a7/de0dd1f4fae5b2ace921042071ae8563ce47dac475b332e288bc1d773e8d/mod_wsgi-4.5.7.tar.gz $tar xzf mod_wsgi-4.5.7.tar.gz $cd mod_wsgi-4.5.7/ $./configure --with-apxs=/usr/bin/apxs --with-python=/usr/bin/python2 $sudo make && make install $cd ../

    配置http.conf

    $ sudo vim /etc/httpd/conf/httpd.conf添加一行: LoadModule wsgi_module modules/mod_wsgi.so

    MySQL

    1.Install MySQL

    $ wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.19-1.el8.x86_64.rpm-bundle.tar$ tar xvf mysql-8.0.19-1.el8.x86_64.rpm-bundle.tar $ sudo rpm -ivh mysql-community-common-8.0.19-1.el8.x86_64.rpm $ sudo rpm -ivh mysql-community-libs-8.0.19-1.el8.x86_64.rpm $ sudo rpm -ivh mysql-community-client-8.0.19-1.el8.x86_64.rpm $ sudo rpm -ivh mysql-community-devel-8.0.19-1.el8.x86_64.rpm $ sudo rpm -ivh mysql-community-server-8.0.19-1.el8.x86_64.rpm

    2.Install MySQLClient

    Must installed dependences before install mysqlclient,you can reference “Prepartion” section

    $ sudo pip2 install -U mysqlclient

    3.Config MySQL

    1.Reference apache to start mysql service
    $ sudo systemctl start mysqld.service $ sudo systemctl enable mysqld.service $ sudo systemctl status mysqld.service ● mysqld.service - MySQL ServerLoaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)Active: active (running) since Mon 2020-01-27 10:36:00 EST; 28s agoDocs: man:mysqld(8)http://dev.mysql.com/doc/refman/en/using-systemd.htmlMain PID: 14388 (mysqld)Status: "Server is operational"Tasks: 39 (limit: 5030)Memory: 243.1MCGroup: /system.slice/mysqld.service└─14388 /usr/sbin/mysqldJan 27 10:35:36 soarnex systemd[1]: Starting MySQL Server... Jan 27 10:36:00 soarnex systemd[1]: Started MySQL Server.
    2.Modify mysql password

    第一步:修改配置文件免密碼登錄mysql

    1、進入文件:vi /etc/my.cnf,添加skip-grant-tables2、重啟mysql: $ sudo systemctl restart mysqld.service

    第二步免密碼登錄mysql

    1、登錄:mysql -u root -p2、提示輸入密碼按回車進入3、進入數據庫,輸入:use mysql;4、查看root用戶信息:select host, user, authentication_string, plugin from user;5、更新root用戶信息,把密碼設置為空字符串:update user set authentication_string='' where user='root';

    第三步、退出mysql;注釋掉/etc/my.cnf文件最后的 skip-grant-tables ;重啟mysql

    $ sudo systemctl restart mysqld.service

    第四步:設置密碼

    1、重新開啟一個客戶端;2、登錄mysql(這時候還是不用輸入密碼,因為上面已經把密碼設置為空字符串了);3、修改root用戶密碼:ALTER user 'root'@'localhost' IDENTIFIED BY 'root'; 提示如下信息表示修改成功: Query OK, 0 rows affected (0.04 sec)4、退出mysql后就可以用密碼登錄了

    第四步的第3點執行容易出現如下信息提示,無法修改密碼,請從第一步重復再次執行,(第三步與第四步的執行可以多等一些時間–猜測與時間有關)

    You must reset your password using ALTER USER statement before executing this statement

    第五步:修改密碼策略

    設置密碼的默認規則:大于8位的包含數字、字符、特殊字符、大小寫,此規則可以修改,

    如下是MySQL 8.0版本修改密碼策略的方法:root密碼:root123

    mysql> SHOW VARIABLES LIKE 'validate_password%'; +--------------------------------------+--------+ | Variable_name | Value | +--------------------------------------+--------+ | validate_password.check_user_name | ON | | validate_password.dictionary_file | | | validate_password.length | 8 | | validate_password.mixed_case_count | 1 | | validate_password.number_count | 1 | | validate_password.policy | MEDIUM | | validate_password.special_char_count | 1 | +--------------------------------------+--------+ 7 rows in set (0.02 sec)mysql> set global validate_password.policy=0; Query OK, 0 rows affected (0.00 sec)mysql> set global validate_password.length=1; Query OK, 0 rows affected (0.00 sec)mysql> SHOW VARIABLES LIKE 'validate_password%'; +--------------------------------------+-------+ | Variable_name | Value | +--------------------------------------+-------+ | validate_password.check_user_name | ON | | validate_password.dictionary_file | | | validate_password.length | 4 | | validate_password.mixed_case_count | 1 | | validate_password.number_count | 1 | | validate_password.policy | LOW | | validate_password.special_char_count | 1 | +--------------------------------------+-------+ 7 rows in set (0.00 sec)mysql> ALTER user 'root'@'localhost' IDENTIFIED BY 'root123'; Query OK, 0 rows affected (0.02 sec)
    3.使用mysql 管理工具 navicat

    https://blog.csdn.net/dabao87/article/details/80571877

    4.數據庫的備份與恢復

    https://www.cnblogs.com/boundless-sky/p/6087976.html

    5.Reviewboard mysql 異常恢復
    reviewboard可以了, 你試下: 以前的指令是:https://stackoverflow.com/questions/8843776/mysql-table-is-marked-as-crashed-and-last-automatic-repair-failed MySQL table is marked as crashed and last (automatic?) repair failedsudo service mysql stop cd /var/lib/mysql/$DATABASE_NAME myisamchk -r $TABLE_NAME myisamchk -r -v -f $TABLE_NAME sudo service mysql start

    Reviewboard

    1.Install Reviewboard

    sudo pip2 install oauthlib==1.0.1 sudo pip2 install Reviewboard

    2.Creating Review Board Site

    Must Create reviewboard database and user first.

    1.MySQL

    In MySQL, before creating your database, make sure that your server is configured to use the UTF-8 encoding for text. In the file my.cnf, add the following settings:

    [client] default-character-set=utf8[mysqld] character-set-server=utf8

    After making these changes, restart your MySQL server.

    Next, start up the mysql command prompt as your root user, and create a new database and user (replacing myuser and myspassword with your desired username and password, respectively):

    $ mysql -u root -p mysql> CREATE DATABASE reviewboard CHARACTER SET utf8; mysql> CREATE USER 'toney'@'localhost' IDENTIFIED BY 'toney123'; mysql> GRANT ALL PRIVILEGES ON reviewboard.* to 'toney'@'localhost';

    Note:
    此處reviewboard database 用戶可以創建為 reviewboard/reviewboard,便于記憶

    2.Install site
    $ sudo rb-site install /var/www/review.com

    需特別注意如下項:

    • What is the login and password for this database?
    • Create an administrator account
    3.Configuration

    創建軟連接

    $ cd /etc/httpd/conf.d $ sudo ln -s /var/www/review.com/conf/apache-wsgi.conf review.conf

    修改confsettings_local.py

    修改 DEBUG=True -- enable debug DISABLE_FOLLOW_MENU = True -- disabled follow menu sudo vim /var/www/review.com/confsettings_local.py

    去除Suuport

    vim ./lib64/python2.7/site-packages/reviewboard/templates/base/_nav_support_menu.html<li> <a href="#"> {% trans "Support" %} <span class="rb-icon rb-icon-dropdown-arrow"></span> </a> <ul> <li><a href="{{RB_MANUAL_URL}}">{% trans "Documentation" %}</a></li> <li><a href="{% url 'support' %}">{% trans "Get Support" %}</a></li> </ul> </li>

    修改目錄權限

    $ sudo chown -R apache "/var/www/review.com/data" $ sudo chown -R apache "/var/www/review.com/htdocs/media/ext"

    安裝Apache的時候默認創建apache 用戶,訪問頁面時都是通過此用戶訪問相關文件,所以需要修改相關文件的權限

    Note:可以通過/etc/httpd/conf/httpd.conf 修改訪問用戶名

    4.Restart httpd.service
    $ sudo systemctl restart httpd.service

    此時可以正常訪問reviewboard site.

    總結

    以上是生活随笔為你收集整理的基于centos搭建reviewboard的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。