1、下載需要的nginx包
如果有有網(wǎng)絡服務器:則
首先查詢要下載的包
yum search nginx(需要查詢的包名)
yum install --downloadonly --downloaddir=/home/rpm_nginx(我的包地址) nginx(多個則以空格分開)
yum install --downloadonly --downloaddir=/home/rpm_php php sphinx-php php-common php-fpm php-dbg php-cli php-libguestfs php-pgsql php-devel php-xml php-ldap php-json php-embedded php-tidy php-enchant php-intl php-odbc php-dba php-pdo php-soap php-gmp php-mysqlnd php-process php-bcmath php-recode php-gd php-snmp php-xmlrpc php-mbstring
如果沒有網(wǎng):則在以下地址可下載rpm包,類似地址跟多
https://developer.aliyun.com/mirror/
https://mirrors.tuna.tsinghua.edu.cn/
https://rpm.org/
https://pkgs.org/
https://rpmfind.net/
2、安裝nginx、php
(1)在各自的包目錄下執(zhí)行命令 rpm -ivh --force *.rpm 一定要全部強制安裝,php一定要安裝fpm
rpm -ivh --force *.rpm
常用的nginx命令
systemctl enable nginx 開機自啟
systemctl disable nginx 開機不自啟
systemctl start nginx 啟動服務
systemctl reload nginx 重新加載nginx.conf配置文件
systemctl restart nginx 重啟服務
systemctl stop nginx 停止服務
~ 檢查nginx是否已經(jīng)安裝了開機自動啟動
systemctl status nginx 查看nginx狀態(tài)
ps -ef | grep nginx 查看進程nginx進程
netstat -antlp | grep nginx 查看nginx服務端口
yum remove nginx yum 卸載nginx軟件包
3、安裝mariadb,方法同上
啟動mariadb
systemctl start mariadb.service
開啟啟動
systemctl enable mariadb.service
啟動之后mariadb初始化設置密碼(默認沒有密碼)
mysql -uroot
use mysql;
SET password=PASSWORD('root1234'); #這里的root1234是新密碼
FLUSH PRIVILEGES;
4、創(chuàng)建數(shù)據(jù)庫
Use mysql;
CREATE DATABASE jcy;
USE jcy;
source /home/jcy.sql;
至此,數(shù)據(jù)庫完成。
5、部署項目
(1)根目錄新建文件夾 www
(2)復制項目到此文件夾
(3)修改nginx配置文件內(nèi)容:文章來源:http://www.zghlxwxcb.cn/news/detail-760948.html
index index.php index.html index.htm default.php default.html default.htm;
root /www/public(此處為項目運行目錄);
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location ~* (runtime|application)/{
return 403;
}
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
location ~ \.php?.*$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
問題解決:
如果有以下問題,則解決。
1、nginx: [warn] could not build optimal types_hash, you should increase either types_hash_max_size: 2048 or types_hash_bucket_size: 64; ignoring types_hash_bucket_size
解決辦法:修改里面的值,增大兩倍,沒有的補上文章來源地址http://www.zghlxwxcb.cn/news/detail-760948.html
到了這里,關于麒麟V10離線rpm安裝nginx+php+mariadb環(huán)境的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!