1.安装配置apache
yum install httpd #安装httpd
systemctl enable httpd #设置开机启动
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/m/mod_xsendfile-0.12-10.el7.x86_64.rpm #下载xsendfile扩展
rpm -ivh mod_xsendfile-0.12-10.el7.x86_64.rpm #安装扩展
注意:如果安装的时候,提示与httpd版本不匹配,依赖不足,可以到http://mirrors.opencas.cn/epel查找合适的安装源
2.创建配置文件:
sudo vi /etc/httpd/conf.d/demo.conf
添加如下配置,更改自己的域名
<VirtualHost *:80>
ServerName www.XXX.com #域名
ServerAlias www.XXX.com #别名
DocumentRoot /var/www/edusoho/web
# enable the .htaccess rewrites
AllowOverride All
Order allow,deny
Allow from All
ErrorLog /var/log/edusoho_error.log
CustomLog /var/log/edusoho_access.log combined
</VirtualHost>
重启Apache:
systemctl restart apache