基础环境
安装epel源
[[email protected] ~]# yum -y install epel-release
停用防火墙
[[email protected] ~]# systemctl stop firewalld
[[email protected] ~]# systemctl disable firewalld
关闭selinux
暂时关闭:
setenforce 0
永久关闭:
vim /etc/sysconfig/selinux
selinux=disabled
LAMP环境
1.安装相关的包
[[email protected] ~]# yum -y install httpd [[email protected] ~]# yum -y install php php-cli php-curl php-fpm php-intl php-mcrypt php-mysql php-gd php-mbstring php-xml php-dom [[email protected] ~]# yum -y install mariadb-server mariadb [[email protected] ~]# yum -y install mod_xsendfile
2.配置apache
[[email protected] ~]# systemctl start httpd [[email protected] ~]# systemctl enable httpd Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/ httpd.service. 10/15 浏览器测试欢迎页面192.168.119.126 [[email protected] ~]# rm -rf /etc/httpd/conf.d/welcome.conf [[email protected] ~]# vim /var/www/html/index.html welcome to edusoho!
3.配置mysql
[[email protected] ~]# systemctl start mariadb [[email protected] ~]# systemctl enable mariadb Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/ mariadb.service. [[email protected] ~]# mysql_secure_installation YYYYY [[email protected] ~]# mysql -uroot -p MariaDB [(none)]> create database edusoho; Query OK, 1 row affected (0.00 sec) MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | edusoho | | mysql | | performance_schema | +--------------------+ 4 rows in set (0.00 sec)
4.配置php
[[email protected] ~]# vim /etc/php.ini
/string查找并修改
post_max_size = 1024M
memory_limit = 1024M
upload_max_filesize = 1024M
date.timezone = Asia/ShangHai
[[email protected] ~]# vim /etc/php-fpm.d/www.conf
listen.owner = apache
listen.group = apache
listen.mode = 0666
[[email protected] web]# systemctl start php-fpm
[[email protected] web]# systemctl enable php-fpm
11/15
[[email protected] ~]# cd /var/www/html/
[[email protected] html]# ls
index.html
[[email protected] html]# vim index.php
<?php
phpinfo()
?>
浏览器中输入本机的ip地址/index.php,出现info页面表明php安装成功
否则,重启httpd服务,php-fpm服务
LAMP环境OK....
edusoho部署
1.download
[[email protected] ~]# wget http://download.edusoho.com/edusoho-7.5.12.tar.gz [[email protected] Desktop]# tar xf edusoho-7.5.12.tar.gz [[email protected] Desktop]# mv edusoho /var/www/html/ [[email protected] ~]# chown -R apache.apache /var/www/html/edusoho/
2.部署
[[email protected] ~]# vim /etc/httpd/conf.d/edusoho.conf
<VirtualHost *:80> ServerName www.xiaochen.org DocumentRoot /var/www/html/edusoho/web </VirtualHost> <Directory "/var/www/html/edusoho/web"> AllowOverride All Require all granted </Directory>
检查配置文件是否有语法错误
[[email protected] ~]# httpd -t AH00558: httpd: Could not reliably determine the server‘s fully qualified domain name, using ::1. Set the ‘ServerName‘ directive globally to suppress this message Syntax OK [[email protected] ~]# systemctl restart httpd
3.访问测试并安装网站
AccessKey: B8V2t1Lu8d983R7Wz3oSMfigGvYY3hTE SecretKey: pOHSPsnXGx6KoeGYh5Q4l9k1Ej0IATn0