海哥 发表于 2024-8-24 22:12:54

全国职业院校技能大赛-云盘算赛项

一、LNMP情况搭建

1、centos7.9

自行准备linux环境,笔者使用的是centos7.9.2009
查看版本命令为:
cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
# setenforce 0
# hostnamectl set-hostname blog
# curl -O http://10.24.2.208/Application/wp-lnmp-c7.9.tar.gz
#tar xf wp-lnmp-c7.9.tar.gz
# rm -rf /etc/yum.repos.d/CentOS-*
# cat /etc/yum.repos.d/local.repo

name=wordpress
baseurl=file:///root/wp-lnmp-c7.9/packages/
gpgcheck=0
enabled=1
# yum install -y unzip 2、nginx

# yum install -y nginx
# vi /etc/nginx/nginx.conf.default
      location / {
         root   html;
         index index.php index.html index.htm;
     }

   location ~ \.php$ {
         root           html;
         fastcgi_pass   127.0.0.1:9000;
         fastcgi_indexindex.php;
         fastcgi_paramSCRIPT_FILENAME/scripts$fastcgi_script_name;
         include      fastcgi_params;
     }
# vi /etc/nginx/nginx.conf
 server {
     listen       80;
     listen       [::]:80;
     server_name_;
     root         /usr/share/nginx/html;

       # Load configuration files for the default server block.
     include /etc/nginx/default.d/*.conf;
 location / {  
     root   html;
     index index.phpindex.html index.htm;         #localtion 加入这个解析
 }
     error_page 404 /404.html;
     location = /404.html {
     }
     location ~ \.php$ {
         root           html;
         fastcgi_pass   127.0.0.1:9000;
         fastcgi_indexindex.php;
         fastcgi_paramSCRIPT_FILENAME/usr/share/nginx/html$fastcgi_script_name;    #加入php解析
         include      fastcgi_params;
     }

     error_page 500 502 503 504 /50x.html;
     location = /50x.html {
 }
 } 3、mariadb

# yum install -y mariadb mariadb-server
# systemctl start mariadb
# mysqladmin -uroot password '123456'
# mysql -uroot -p123456 -e "create database wordpress;"
# mysql -uroot -p123456
MariaDB [(none)]> grant all on *.* to root@'localhost' identified by '123456';
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.001 sec) 4、php

# yum install -y php*
# systemctl start php-fpm 5、wordpress

# unzip wp-lnmp-c7.9/wordpress-4.7.3-zh_CN.zip
# rm -rf /usr/share/nginx/html/*
# cp -rvf wordpress/* /usr/share/nginx/html/
# systemctl restart nginx php-fpm
# chown nginx:nginx /usr/share/nginx/html/
# chown -R 755 /usr/share/nginx/html/
二、LAMP情况搭建

1、centos7.9

自行准备linux环境,笔者使用的是centos7.9.2009
查看版本命令为:
cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
# setenforce 0
# hostnamectl set-hostname blog
# curl -O http://10.24.2.208/Application/wp-lnmp-c7.9.tar.gz
#tar xf wp-lnmp-c7.9.tar.gz
# rm -rf /etc/yum.repos.d/CentOS-*
# cat /etc/yum.repos.d/local.repo

name=wordpress
baseurl=file:///root/wp-lnmp-c7.9/packages/
gpgcheck=0
enabled=1
# yum install -y unzip
2、apache

# yum install -y httpd
3、mariadb

# yum install -y mariadb mariadb-server
# systemctl start mariadb
# mysqladmin -uroot password '123456'
# mysql -uroot -p123456 -e "create database wordpress;"
# mysql -uroot -p123456
MariaDB [(none)]> grant all on *.* to root@'localhost' identified by '123456';
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.001 sec)
4、php

# yum install -y php*
5、wordpress
# unzip wp-lnmp-c7.9/wordpress-4.7.3-zh_CN.zip
# rm -rf /var/www/html/*
# cp -rvf wordpress/* /var/www/html/
# chown apache:apache -R /var/www/html/
# chown 755-R /var/www/html/
# systemctl start php-fpm httpd

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: 全国职业院校技能大赛-云盘算赛项