基础环境
安装epel源
[root@aliyun ~]# yum -y install epel-release
停用防火墙
[root@aliyun ~]# systemctl stop firewalld
[root@aliyun ~]# systemctl disable firewalld
关闭selinux
暂时关闭:
setenforce 0
永久关闭:
vim /etc/sysconfig/selinux
selinux=disabled
LAMP环境
1.安装相关的包
[root@aliyun ~]# yum -y install httpd [root@aliyun ~]# yum -y install php php-cli php-curl php-fpm php-intl php-mcrypt php-mysql php-gd php-mbstring php-xml php-dom [root@aliyun ~]# yum -y install mariadb-server mariadb [root@aliyun ~]# yum -y install mod_xsendfile
2.配置apache
[root@aliyun ~]# systemctl start httpd [root@aliyun ~]# 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 [root@aliyun ~]# rm -rf /etc/httpd/conf.d/welcome.conf [root@aliyun ~]# vim /var/www/html/index.html welcome to edusoho!
3.配置mysql
[root@aliyun ~]# systemctl start mariadb [root@aliyun ~]# systemctl enable mariadb Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/ mariadb.service. [root@aliyun ~]# mysql_secure_installation YYYYY [root@aliyun ~]# 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
[root@aliyun ~]# vim /etc/php.ini
/string查找并修改
post_max_size = 1024M
memory_limit = 1024M
upload_max_filesize = 1024M
date.timezone = Asia/ShangHai
[root@aliyun ~]# vim /etc/php-fpm.d/www.conf
listen.owner = apache
listen.group = apache
listen.mode = 0666
[root@aliyun web]# systemctl start php-fpm
[root@aliyun web]# systemctl enable php-fpm
11/15
[root@aliyun ~]# cd /var/www/html/
[root@aliyun html]# ls
index.html
[root@aliyun html]# vim index.php
<?php
phpinfo()
?>
浏览器中输入本机的ip地址/index.php,出现info页面表明php安装成功
否则,重启httpd服务,php-fpm服务
LAMP环境OK....
edusoho部署
1.download
[root@aliyun ~]# wget http://download.edusoho.com/edusoho-7.5.12.tar.gz [root@aliyun Desktop]# tar xf edusoho-7.5.12.tar.gz [root@localhost Desktop]# mv edusoho /var/www/html/ [root@aliyun ~]# chown -R apache.apache /var/www/html/edusoho/
2.部署
[root@aliyun ~]# 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>
检查配置文件是否有语法错误
[root@localhost ~]# 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 [root@aliyun ~]# systemctl restart httpd
3.访问测试并安装网站
AccessKey: B8V2t1Lu8d983R7Wz3oSMfigGvYY3hTE SecretKey: pOHSPsnXGx6KoeGYh5Q4l9k1Ej0IATn0