以下是在linux干净环境下的操作实录,如果有小白用户想自己在linux下通过命令行部署安装tipask系统可以按照下面的操作一步步执行即可。
操作的环境是CentOS 7.5 64位,执行下面的操作之前需要先通过ssh工具登陆到服务器。
一、安装php7.1:由于centos默认的yum源自带的php版本比较低,这里我需要添加一个yum源来安装最新的php版本
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
执行结果如下图:
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
开始安装php7.1版本,执行如下命令:
yum install php71w php71w-fpm php71w-cli php71w-common php71w-devel php71w-gd php71w-pdo php71w-mysqlnd php71w-mbstring php71w-fileinfo php71w-openssl
二、安装mysql(centos 下将mysql换成了 mariadb mysql的另外一个分支,这里直接用就行了,跟mysql一样)
yum -y install mariadb mariadb-server
yum -y install nginx
user=nginx
group=nginx
mkdir /home/wwwroot/
cd /home/wwwroot
unzip -d tipask tipask.zip
chown -R nginx:nginx tipask //修改用户组权限
chmod -R 775 tipask/bootstrap/cache tipask/storage //修改相关目录读写权限
server {
listen 80;
server_name demo.tipask.cc; #配置的站点域名,根据实际域名自行调整
set $domain public;
set $project_root /home/wwwroot/tipask;
root $project_root/$domain;
charset utf-8;
#access_log /home/wwwroot/tipask/storage/tipask.access.log combined; #需要查看访问日志的可以去掉注释
#error_log /home/wwwroot/tipask/storage/tipask.error.log error;#需要查看错误日志的可以去掉注释
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php?$1 last;
}
location / {
index index.php index.html;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $project_root/$domain$fastcgi_script_name;
include fastcgi_params;
}
}
systemctl start nginx.service
systemctl start mariadb.service //启动mysql服务
mysqladmin -u root -p password nrRwncbm //密码是随机生成的,可自行修改
mysql -uroot -pnrRwncbm //登录mysql
create database tipaskx charset utf8mb4; //创建tipask数据库
systemctl start php-fpm.service
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!