需要安装软件
rpm -qa | grep mysql
如安装,知道mysql账号密码,可以直接使用,跳过此步骤
如已安装(centos可能默认已安装mysql或者之前有人已经安装过),不知道mysql账号密码,则需要进行卸载
rpm -e --nodeps qt-mysql-4.8.7-8.el7.x86_64
将查询到的所有mysql全部卸载,确保查询mysql为空
由于mariadb也属于mysql子产品,也需要卸载
rpm -qa | grep -i mariadb
查询如有,则使用相同卸载指令进行卸载
cd /opt
mkdir mysql
wget https://dev.mysql.com/get/mysql80-community-release-el7-5.noarch.rpm
yum -y install mysql80-community-release-el7-3.noarch.rpm
需要修改配置,mysql稳定版本是5.7/5.6,当然如果需要使用最新版本可以忽略这一步
cd /etc/yum.repos.d/
vim mysql-community.repo
yum -y install mysql-community-server
确保在运行中,如不在运行请打开
systemctl status mysqld # 查询msyql服务状态
systemctl start mysqld # 打开mysql服务
systemctl restart mysqld # 重启mysql服务
systemctl stop mysqld # 关闭mysql服务
cat /var/log/mysqld.log | grep password
mysql -uroot -p
ALTER user 'root'@'localhost' IDENTIFIED BY 'Mima@123';
# 修改成功后,退出
eixt
cd /opt
mkdir wiki
wget https://github.com/phachon/mm-wiki/releases/download/v0.2.1/mm-wiki-v0.2.1-linux-amd64.tar.gz
tar -zxvf mm-wiki-v0.2.1-linux-amd64.tar.gz -C ./wiki/
cd wiki/install
./install
安装成功后,配置端口号为8090,在浏览器打开127.0.0.1:8090进行wiki初始配置(注意:配置后该端口号将弃用,请谨慎操作)
PS:如确需要修改配置,可进入wiki的安装路径下,修改配置文件并重启服务
配置开机启动以及环境变量等
cd /etc/systemd/system
vim wiki.service
文件内容按如下内容调整
[Unit]
Description= wiki
Documentation= https://github.com/phachon/mm-wiki/releases/download/v0.2.1/mm-wiki-v0.2.1-linux-amd64.tar.gz
[Service]
EnvironmentFile=/root/wiki/conf/mm-wiki.conf
ExecStart=/root/wiki/mm-wiki
Restart=on-failure
[Install]
WantedBy=multi-user.target
yum -y install nginx # 安装nginx
yum -y install epel-release # 安装扩展包
vi /etc/nginx/nginx.conf
#user nginx; # 一定要注释掉
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 4096;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
server {
listen 80;
listen [::]:80;
server_name baidu.com; # 添加域名,如果你有,如果没有填写公网 IP
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
proxy_pass http://127.0.0.1:8080; # 添加这里
proxy_connect_timeout 600;
proxy_read_timeout 600;
}
error_page 404 /404.html;
location = /404.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
}
将配置指向该配置
重点:如无此步骤,nginx将无法使用自定义的配置
/usr/sbin/nginx -c /etc/nginx/nginx.conf
查询nginx使用的配置
nginx -t
必须确保使用的配置为自定义的配置
systemctl status nginx # 查询nginx状态
systemctl start nginx # 打开nginx服务
systemctl restart nginx # 重启nginx服务
systemctl stop nginx # 关闭nginx服务
本地使用127.0.0.1,局域网使用ip进入(账号密码为初始化配置的账号密码)