部署博客系统
一、设置防火墙
setenforce 0
firewall-cmd --permanent --add-server=http
firewall-cmd --permanent --add-server=https
firewall-cmd --reload
firewall-cmd --permanent --list-all
二、安装LAMP
yum -y install httpd mariadb-server mariadb php-mysql php gd php-gd
systemctl start httpd mariadb
systemctl enable httpd mariadb
mysql_secure_installation
show databases; #查看数据库
三、安装wordpress
1、Apache配置虚拟主机
vi /etc/httpd/conf.d/wordpress.conf
<VirtualHost *:80>
ServerName www.wordpress.com
ServerAlias wordpress.com
DocumentRoot /wwwroot/wordpress
</VirtualHost>
<Directory "/wwwroot/wordpress">
require all granted
</Directory>
httpd -t #检查语法是否正确
2、去管网上下在博客系统
wget wordpress-5.0.2-zh_CN.tar.gz #下载软件包
tar xf wordpress-5.0.2-zh_CN.tar.gz #解压
cp -rf wordpress/* /wwwroot/wordpress/ #把文件夹所有的内容,复制到存放网站的目录上
chown -R apache.apache /wwwroot/wordpress/ #改成当前运行网站的用户
刷新网站
修改时间的配置文件
vim /etc/php.ini
date.timezone = Asia/Sahnghai #找到这一行,修改为上海时间
重启启动服务
systemctl restart httpd
数据库的操作
mysql -uroot -p'1234' #登录到数据
show databases; #查看数据库
use mysql #进入库
show tables; #查看数据库列表
create database wordpress; #创建数据库
3、修改client端的hosts文件
vim /etc/hosts
192.168.2.10 www.wordpress.com wordpress.com #使域名可以解析到这个主机
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
部署ecshop网店系统
下载链接地址
https://account.shopex.cn/reg?refer=yunqi_ecshop_download&redirecturi=http://account.shopex.cn/order/confirm/goods_1966-487
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
部署Discuz论坛系统
下载链接地址
https://gitee.com/ComsenzDiscuz/DiscuzX
########################################################################################
部署edusoho网校系统
下载链接地址
http://dl.edusoho.com/edusoho-release/edusoho-8.3.1.tar.gz
一、安装软件包
yum -y install eple-release bash-completion vim
配置防火墙
setenforce 0
systemctl restart firewalld
systemctl enable firewalld
firewall-cmd --permanent --add-serice=http
firewall-cmd --permanent --add-serice=https
firewall-cmd --permanent --add-port=8080/tcp
firewall-cmd --reload
firewall-cmd --permanent --list-all
二、搭建LAMP环境
yum -y install httpd
yum -y install php php-cli php-curl php-fpm php-intl php-mcrpt php-mysql php-gd php-mbstring php-xml
yum -y install mariadb-server mariadb
去官网下载mod_xsendfile-0.12-10.e17.x86_64.rpm包并安装
apache
rm -rf /etc/httpd/conf.d/welcome.conf
sed -ri 's/List 80/List 8080/' /etc/httpd/conf/httpd.conf
systemctl start httpd
systemctl enable httpd
echo "test Apache" > /var/www/html/index.html
ss -an | grep :8080
mysql
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation
mysql -uroot -p
create database edusoho;
show databases;
php
vim /etc/php.ini
post_max_size = 1024M
memory_limit = 1024M
upload_max_filesize = 1024M
date.timezone = Asia/Shanghai
[可选]
vim /etc/php-fpm.d/www.conf
listen.owner = apache
listen.group = apache
liston.mode = 0666
systemctl start php-fpm
systemctl enable php-fpm
三、edusoho部署
wget http://dl.edusoho.com/edusoho-release/edusoho-8.3.1.tar.gz
tar xf edusoho-8.3.1.tar.gz
cp -rf edusoho /var/www/
chown -R apache.apache /var/www/edusoho
虚拟主机
vim /etc/httpd/conf.d/edusoho.conf
<VirtualHost *:8080>
ServerName www.edusoho.com
ServerAlias edusoho.com
DocumantRoot /var/www/edhusoho/web
CustomLog "logs/edusoho.com_access_log" combined
Errorlog "logs/edudoho.com_error_log"
</VirtualHost>
<Directory /var/www/edusoho/web>
AllowOverrride All
Require all granted
</directory>
重启apache服务
httpd -t
systemctl restart httpd
########################################################################################
实现HTTPS步骤
一、生成私钥和公钥,找CA机构为公钥签名
二、Apache虚拟主机
1、80做Rewrite规则
2、443,制定私钥和经过CA签名的公钥(证书)
三、防火墙80,443
client
在数据加密传输之前,一定会验证对方站点合法性
server
为什么要找CA机构签名?
答:如果给client提供未经CA签名的证书,client段不信任
Apache使用证书
cp -rf ----------------.key -----------------------.pem /etc/httpd
show apache.apache /etc/httpd/-----------------.*
ls -l /etc/httpd/--------------.pem
yum - install mod_ssl
http端口80转换443(虚拟主机的配置)
<VirtualHost *:443>
ServerName www.edusoho.com
ServerAlias edusoho.com
#DocumantRoot "/var/www/edusoho/web"
#CustomLog "logs/edusoho.com_access_log" combined
#ErrorLog "logs/edusoho.com_error_log"
RewriteEngine On
RewriteRule ^(.*)$ https://www.edusoho.com$1 [R=301,L]
</VirtualHost>
<VirtualHost *:443>
ServerName www.edusoho.com
#ServerAlias edusoho.com
DocumantRoot "/var/www/edusoho/web"
CustomLog "logs/edusoho.com_access_log" combined
ErrorLog "logs/edusoho.com_error_log"
SSLEngine On
SSLCertificateFlie /etc/httpd/---------------.pem #加密证书的认证
SSLCertificatekeyFile /etc/httpd/---------------.key #明文证书的认证
</VirtualHost>
<Directory /var/www/edusoho/web> #虚拟机主机的目录权限
AllowOverrride All
Require all granted
</directory>