# ForumSystem **Repository Path**: JACKERC/forum-system ## Basic Information - **Project Name**: ForumSystem - **Description**: 校园论坛 - **Primary Language**: PHP - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-03-24 - **Last Updated**: 2022-06-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ForumSystem ## 介绍 校园论坛 ## 软件架构 论坛界面: Vue+HTML+CSS+JavaScript 后台界面: Laravel+PHP ## 安装教程 ### 安装依赖 ```bash yum install -y gcc gcc-c++ make zlib zlib-devel pcre pcre-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers zip vim net-tools unzip autoconf binutils wget https://nih.at/libzip/libzip-1.2.0.tar.gz tar -zxvf libzip-1.2.0.tar.gz cd libzip-1.2.0 ./configure make -j4 && make install cp /usr/local/lib/libzip/include/zipconf.h /usr/local/include/zipconf.h ``` ### 安装PHP ```bash cd ~ yum -y install wget wget https://www.php.net/distributions/php-7.3.27.tar.gz tar -zxvf php-7.3.27.tar.gz cd php-7.3.27 ./configure --prefix=/usr/local/php7 --with-config-file-path=/usr/local/php7 --enable-mbstring --with-openssl --enable-ftp --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-pear --enable-sockets --with-freetype-dir=/usr --with-zlib --with-libxml-dir=/usr --with-xmlrpc --enable-zip --enable-fpm --enable-xml --enable-sockets --with-gd --with-zlib --with-iconv --enable-zip --with-freetype-dir=/usr/lib/ --enable-soap --enable-pcntl --enable-cli --with-curl make -j4 && make install # 环境变量 echo 'export PHP_HOME=/usr/local/php7' >> /etc/profile echo 'export PATH=$PATH:$PHP_HOME/bin' >> /etc/profile source /etc/profile # 配置PHP cp ~/php-7.3.27/php.ini-production /usr/local/php7/php.ini cd /usr/local/php7/ sed -i \ -e 's/display_errors\s*=[^\n]*/display_errors = On/g' \ -e 's/session\.save_handler\s*=[^\n]*/session\.save_handler = Redis/g' \ -e 's/session\.save_path\s*=[^\n]*/session\.save_path = "tcp:\/\/192\.168\.31\.100:6379\?auth=redis"/g' \ php.ini cd /usr/local/php7/etc cp php-fpm.conf.default php-fpm.conf sed -i 's/^[^p]*pid\s*=\s*run\/php-fpm.pid$/pid = run\/php-fpm.pid/g' php-fpm.conf cd php-fpm.d/ cp www.conf.default www.conf ``` `启动脚本` ```bash cp ~/php-7.3.27/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm chmod +x /etc/init.d/php-fpm chkconfig --add php-fpm chkconfig php-fpm on ``` ### 安装Nginx ```bash cd ~ wget http://nginx.org/download/nginx-1.9.9.tar.gz tar -zxvf nginx-1.9.9.tar.gz cd nginx-1.9.9/ ./configure --with-http_ssl_module make -j4 && make install # 配置防火墙、 firewall-cmd --add-port=80/tcp --zone=public --permanent firewall-cmd --add-port=443/tcp --zone=public --permanent systemctl restart firewalld ``` `启动脚本` ```bash cat << EOF > /etc/init.d/nginx #! /bin/bash #chkconfig: 2345 80 90 #description:auto_run ### BEGIN INIT INFO # Provides: nginx # Short-Description: starts nginx # Description: starts the nginx Process Manager daemon ### END INIT INFO NGINX_HOME=/usr/local/nginx NGINX_EXEC=$NGINX_HOME/sbin/nginx NGINX_CONF=$NGINX_HOME/conf/nginx.conf case $1 in start) echo "Starting nginx..." $NGINX_EXEC ;; stop) echo "Stopping nginx..." $NGINX_EXEC -s stop ;; restart) echo "Restarting nginx..." $NGINX_EXEC -s stop $NGINX_EXEC -c $NGINX_CONF $NGINX_EXEC -s reload ;; *) echo "Usage: -bash {start|stop|restart}" exit 1 ;; esac EOF chmod +x /etc/init.d/nginx chkconfig --add nginx chkconfig nginx on ``` `nginx 配置` ```bash cat << EOF > /usr/local/nginx/conf/nginx.conf worker_processes 1; error_log /var/logs/error.log; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name 127.0.0.1; root /var/www/html; index index.php index.html index.htm; location / { try_files $uri $uri/ /index.php?s=$uri&$args; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~ /\.ht { deny all; } } } EOF ``` ### 安装PHPRedis ```bash cd ~ wget https://github.com/phpredis/phpredis/archive/develop.zip unzip develop.zip cd phpredis-develop/ phpize ./configure --with-php-config=/usr/local/php7/bin/php-config make -j4 && make install cd ~ wget http://download.redis.io/releases/redis-5.0.0.tar.gz tar -zxvf redis-5.0.0.tar.gz cd redis-5.0.0/ make -j4 cd src make install mkdir /usr/local/redis mkdir /usr/local/redis/bin mkdir /usr/local/redis/etc mv ~/redis-5.0.0/redis.conf /usr/local/redis/etc/ cd ~/redis-5.0.0/src mv mkreleasehdr.sh redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-sentinel redis-server redis-trib.rb /usr/local/redis/bin/ cd /usr/local/redis/etc/ sed -i \ -e 's/[^b]*bind\s*127\.0\.0\.1[^\n]*/# bind 127\.0\.0\.1/g' \ -e 's/[^p]*protected\-mode\s*[^\n]*/protected\-mode no/g' \ -e 's/[^d]*daemonize\s*[^\n]*/daemonize yes/g' \ -e 's/[^p]*requirepass[^\n]*/requirepass redis/g' \ redis.conf echo '/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf' >> /etc/rc.d/rc.local ``` ### 安装MariaDB ```bash cat << EOF > /etc/yum.repos.d/MariaDB.repo [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.2/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 EOF yum install MariaDB-server MariaDB-client -y systemctl restart mariadb systemctl enable mariadb mysql -uroot SET PASSWORD=PASSWORD('123456'); GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION; FLUSH PRIVILEGES; EXIT ``` ### 安装Composer ```bash php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');" php composer-setup.php mv composer.phar /usr/local/bin/composer composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ composer selfupdate ``` ## 使用说明 ### 下载项目 ```bash git init git pull git@gitee.com:JACKERC/forum-system.git ``` ### 安装依赖 ```bash cd ForumSystem/ForumClient npm install cd ../ForumServer composer install ``` ## 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request ## 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)