CentOS部署部署Edusoho

关闭SELINUX

sudo vi /etc/selinux/config

将内容修改为以下信息:

# SELINUX=enforcing # 禁用该配置
# SELINUXTYPE=targeted # 禁用该配置
SELINUX=disabled # 禁用该配置

修改配置后执行以下命令使其配置生效:

setenforce 0

安装 apache 和 xsendfile 依赖

yum install httpd
rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/m/mod_xsendfile-0.12-10.el7.x86_64.rpm

注意:如果安装的时候,提示与httpd版本不匹配,依赖不足,可以到http://mirrors.opencas.cn/epel 查找合适的安装源

安装PHP和相关插件

yum install -y php php-cli php-curl php-fpm php-intl php-mcrypt php-mysql php-gd php-mbstring php-xml php-dom

修改PHP配置

vim /etc/php.ini

将以下配置参数进行修改:

post_max_size = 1024M             # 672 行
memory_limit = 1024M              # 405 行
upload_max_filesize = 1024M       # 800 行

修改PHP-FPM配置

sudo vi /etc/php-fpm.d/www.conf

添加以下配置参数:

listen.owner = apache
listen.group = apache
listen.mode = 0666

设置PHP-FPM启动脚本

sudo systemctl start php-fpm    # 启动php-fpm
sudo systemctl enable php-fpm   # 开机启动php-fpm

下载安装edusoho

wget http://download.edusoho.com/edusoho-VERSION.tar.gz  (注:将VERSION替换为当前EduSoho最新版本号,可从官网www.edusoho.com查询获取)
tar zxvf edusoho-VERSION.tar.gz
cp -r edusoho /var/www
cd /var/www && sudo chown -R apache:apache ./

创建配置edusoho

sudo vi /etc/httpd/conf.d/edusoho.conf

在文件中添加以下内容:

<VirtualHost *:80>
    ServerName mooc.ttxit.com
    ServerAlias mooc.ttxit.com

    DocumentRoot /edu/edusoho/web
    <Directory /edu/edusoho/web>
        # enable the .htaccess rewrites
        AllowOverride All
        Order allow,deny
        Allow from All
    </Directory>
    ErrorLog /var/log/edusoho_error.log
    CustomLog /var/log/edusoho_access.log combined
</VirtualHost>

配置启动apache服务

sudo systemctl start httpd    # 启动apache
sudo systemctl enable httpd   # 开机启动apache
标签:部署Centos 发布于:2019-10-16 23:56:22