lamp(1.0)架构部署phpmyadmin
lamp
1.lamp简介
所谓lamp,其实就是由Linux+Apache+Mysql/MariaDB+Php/Perl/Python的一组动态网站或者服务器的开源软件,除Linux外其它各部件本身都是各自独立的程序,但是因为经常被放在一起使用,拥有了越来越高的兼容度,共同组成了一个强大的Web应用程序平台。
LAMP指的是Linux(操作系统)、Apache(HTTP服务器)、MySQL(也指MariaDB,数据库软件)和PHP(有时也是指Perl或Python)的第一个字母,一般用来建立web应用平台。
2. web服务器工作流程
web服务器的资源分为两种,静态资源和动态资源
- 静态资源就是指静态内容,客户端从服务器获得的资源的表现形式与原文件相同。可以简单的理解为就是直接存储于文件系统中的资源
- 动态资源则通常是程序文件,需要在服务器执行之后,将执行的结果返回给客户端
阶段①显示的是httpd服务器(即apache)和php服务器通过FastCGI协议进行通信,且php作为独立的服务进程运行
阶段②显示的是php程序和mysql数据库间通过mysql协议进行通信。php与mysql本没有什么联系,但是由Php语言写成的程序可以与mysql进行数据交互。同理perl和python写的程序也可以与mysql数据库进行交互
2.1 cgi与fastcgi
CGI(Common Gateway Interface,通用网关接口),CGI是外部应用程序(CGI程序)与WEB服务器之间的接口标准,是在CGI程序和Web服务器之间传递信息的过程。CGI规范允许Web服务器执行外部程序,并将它们的输出发送给Web浏览器,CGI将web的一组简单的静态超媒体文档变成一个完整的新的交互式媒体。
FastCGI(Fast Common Gateway Interface)是CGI的改良版,CGI是通过启用一个解释器进程来处理每个请求,耗时且耗资源,而FastCGI则是通过master-worker形式来处理每个请求,即启动一个master主进程,然后根据配置启动几个worker进程,当请求进来时,master会从worker进程中选择一个去处理请求,这样就避免了重复的生成和杀死进程带来的频繁cpu上下文切换而导致耗时
2.2 httpd与php结合的方式
httpd与php结合的方式有以下三种:
- modules:php将以httpd的扩展模块形式存在,需要加载动态资源时,httpd可以直接通过php模块来加工资源并返回给客户端
- httpd prefork:libphp5.so(多进程模型的php)
- httpd event or worker:libphp5-zts.so(线程模型的php)
- CGI:httpd需要加载动态资源时,通过CGI与php解释器联系,获得php执行的结果,此时httpd负责与php连接的建立和断开等
- FastCGI:利用php-fpm机制,启动为服务进程,php自行运行为一个服务,https通过socket与php通信
较于CGI方式,FastCGI更为常用,很少有人使用CGI方式来加载动态资源
2.3 web工作流程
通过上面的图说明一下web的工作流程:
- 客户端通过http协议请求web服务器资源
- web服务器收到请求后判断客户端请求的资源是静态资源或是动态资源
- 若是静态资源则直接从本地文件系统取之返回给客户端。
- 否则若为动态资源则通过FastCGI协议与php服务器联系,通过CGI程序的master进程调度worker进程来执行程序以获得客户端请求的动态资源,并将执行的结果通过FastCGI协议返回给httpd服务器,httpd服务器收到php的执行结果后将其封装为http响应报文响应给客户端。在执行程序获取动态资源时若需要获得数据库中的资源时,由Php服务器通过mysql协议与MySQL/MariaDB服务器交互,取之而后返回给httpd,httpd将从php服务器收到的执行结果封装成http响应报文响应给客户端。
3. lamp平台构建
环境说明:
系统平台 | IP | 需要安装的服务 |
---|---|---|
centos8 | 192.168.10.145 | httpd-2.4 mysql-5.7 php php-mysql |
lamp平台软件安装次序:
httpd --> mysql --> php
3.1 安装httpd
配置yum源
[root@localhost yum.repos.d]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2495 100 2495 0 0 17206 0 --:--:-- --:--:-- --:--:-- 17206
[root@localhost yum.repos.d]# yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
[root@localhost yum.repos.d]# sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
[root@localhost yum.repos.d]# sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*
[root@localhost yum.repos.d]# cd
[root@localhost ~]#
创建apahce服务的用户和组
[root@localhost ~]# groupadd -r apache
[root@localhost ~]# useradd -r -M -s /sbin/nologin -g apache apache
[root@localhost ~]#
安装依赖包
[root@localhost ~]# yum -y install openssl-devel pcre-devel expat-devel libtool gcc gcc-c++
[root@localhost ~]# dnf -y install wget libxml2-devel
[root@localhost ~]# wget https://downloads.apache.org/apr/apr-1.7.0.tar.gz
[root@localhost ~]# wget https://downloads.apache.org/apr/apr-util-1.6.1.tar.gz
[root@localhost ~]# wget https://downloads.apache.org/httpd/httpd-2.4.54.tar.gz
安装apr以及apr-util
[root@localhost ~]# tar xf apr-1.7.0.tar.gz
[root@localhost ~]# tar xf apr-util-1.6.1.tar.gz
[root@localhost ~]# cd apr-1.7.0
[root@localhost apr-1.7.0]# vim configure
$RM "$cfgfile" //删除此行
[root@localhost apr-1.7.0]# ./configure --prefix=/usr/local/apr
[root@localhost apr-1.7.0]# make
[root@localhost apr-1.7.0]# make install
make[1]: Entering directory '/root/apr-1.7.0'
make[1]: Nothing to be done for 'local-all'.
make[1]: Leaving directory '/root/apr-1.7.0'
[root@localhost apr-1.7.0]# cd ../apr-util-1.6.1
[root@localhost apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
[root@localhost apr-util-1.6.1]# make
[root@localhost apr-util-1.6.1]# make install
[root@localhost ~]# ls
anaconda-ks.cfg apr-1.7.0.tar.gz apr-util-1.6.1.tar.gz
apr-1.7.0 apr-util-1.6.1 httpd-2.4.54.tar.gz
[root@localhost ~]# cd
安装apache
[root@localhost ~]# tar xf httpd-2.4.54.tar.gz
[root@localhost ~]# cd httpd-2.4.54
[root@localhost httpd-2.4.54]# ./configure --prefix=/usr/local/apache \
> --enable-so \
> --enable-ssl \
> --enable-cgi \
> --enable-rewrite \
> --with-zlib \
> --with-pcre \
> --with-apr=/usr/local/apr \
> --with-apr-util=/usr/local/apr-util/ \
> --enable-modules=most \
> --enable-mpms-shared=all \
> --with-mpm=prefork
[root@localhost httpd-2.4.54]# make
[root@localhost httpd-2.4.54]# make install
make[1]: Leaving directory '/root/httpd-2.4.54'
安装后配置
[root@localhost ~]# echo 'export PATH=/usr/local/apache/bin:$PATH' > /etc/profile.d/httpd.sh
[root@localhost ~]# source /etc/profile.d/httpd.sh
[root@localhost ~]# ln -s /usr/local/apache/include /usr/include/apache
[root@localhost ~]# vim /etc/man_db.conf
MANDATORY_MANPATH /usr/man
MANDATORY_MANPATH /usr/share/man
MANDATORY_MANPATH /usr/local/share/man
MANDATORY_MANPATH /usr/local/apache/man
[root@localhost ~]# cd /usr/lib/systemd/system
[root@localhost system]# cp sshd.service httpd.service
[root@localhost system]# vim httpd.service
[root@localhost system]# cat httpd.service
[Unit]
Description=web server daemon
Documentation=man:httpd5
After=network.target sshd-keygen.target
[Service]
Type=forking
ExecStart=/usr/local/apache/bin/apachectl start
ExecStop=/usr/local/apache/bin/apachectl stop
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target
[root@localhost system]#
[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl status httpd
● httpd.service - web server daemon
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset:>
Active: inactive (dead)
Docs: man:httpd5
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# ss -anlt
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
LISTEN 0 128 [::]:22 [::]:*
LISTEN 0 128 *:80 *:*
[root@localhost ~]#
[root@localhost ~]# systemctl enable httpd
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
[root@localhost ~]#
3.2 安装mysql
安装依赖包
[root@localhost ~]# yum -y install ncurses-devel openssl-devel openssl cmake mariadb-devel ncurses-compat-libs
[root@localhost ~]# cd /usr/src
[root@localhost src]# wget https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz
--2022-08-02 21:18:17-- https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz
Resolving downloads.mysql.com (downloads.mysql.com)... 23.3.217.230, 2600:140b:2:99c::2e31, 2600:140b:2:99d::2e31
Connecting to downloads.mysql.com (downloads.mysql.com)|23.3.217.230|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://cdn.mysql.com/archives/mysql-5.7/mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz [following]
--2022-08-02 21:18:23-- https://cdn.mysql.com/archives/mysql-5.7/mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz
Resolving cdn.mysql.com (cdn.mysql.com)... 23.59.157.177
Connecting to cdn.mysql.com (cdn.mysql.com)|23.59.157.177|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 674830866 (644M) [application/x-tar-gz]
Saving to: 'mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz'
mysql-5.7.38-li 100%[====>] 643.57M 2.89MB/s in 3m 51s
2022-08-02 21:22:15 (2.78 MB/s) - 'mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz' saved [674830866/674830866]
[root@localhost src]#
//创建用户
[root@localhost src]# useradd -M -r -s /sbin/nologin mysql
[root@localhost src]# id mysql
uid=994(mysql) gid=991(mysql) groups=991(mysql)
[root@localhost src]#
//解压软件至/usr/local/
[root@localhost ~]# cd /usr/local
[root@localhost local]# ll
total 0
drwxr-xr-x. 14 root root 164 Aug 2 20:46 apache
drwxr-xr-x. 7 root root 71 Aug 2 20:35 apr
drwxr-xr-x. 5 root root 43 Aug 2 20:41 apr-util
drwxr-xr-x. 2 root root 6 Jun 22 2021 bin
drwxr-xr-x. 2 root root 6 Jun 22 2021 etc
drwxr-xr-x. 2 root root 6 Jun 22 2021 games
drwxr-xr-x. 2 root root 6 Jun 22 2021 include
drwxr-xr-x. 2 root root 6 Jun 22 2021 lib
drwxr-xr-x. 3 root root 17 Jun 27 21:48 lib64
drwxr-xr-x. 2 root root 6 Jun 22 2021 libexec
drwxr-xr-x. 9 root root 129 Aug 2 21:24 mysql-5.7.38-linux-glibc2.12-x86_64
drwxr-xr-x. 2 root root 6 Jun 22 2021 sbin
drwxr-xr-x. 5 root root 49 Jun 27 21:48 share
drwxr-xr-x. 2 root root 6 Jun 22 2021 src
[root@localhost local]#
[root@localhost local]# ln -sv mysql-5.7.38-linux-glibc2.12-x86_64/ mysql
'mysql/mysql-5.7.38-linux-glibc2.12-x86_64' -> 'mysql-5.7.38-linux-glibc2.12-x86_64/'
[root@localhost local]#
//修改目录/usr/local/mysql的属主属组
[root@localhost local]# chown -R mysql.mysql mysql*
[root@localhost local]#
//添加环境变量
[root@localhost local]# echo 'export PATH=/usr/local/mysql/bin:$PATH' > /etc/profile.d/mysql.sh
[root@localhost local]# source /etc/profile.d/mysql.sh
//创建头文件
[root@localhost local]# ln -s /usr/local/mysql/include /usr/include/mysql
//添加帮助文件
[root@localhost local]# vim /etc/man_db.conf
MANDATORY_MANPATH /usr/man
MANDATORY_MANPATH /usr/share/man
MANDATORY_MANPATH /usr/local/share/man
MANDATORY_MANPATH /usr/local/apache/man
MANDATORY_MANPATH /usr/local/mysql/man //添加
[root@localhost local]#
[root@localhost local]# vim /etc/ld.so.conf.d/mysql.conf
[root@localhost ~]# cat /etc/ld.so.conf.d/mysql.conf
/usr/local/mysql/lib/
[root@localhost local]# ldconfig
[root@localhost local]# cd
//创建数据存放目录
[root@localhost ~]# mkdir /opt/data
[root@localhost ~]# chown -R mysql.mysql /opt/data
[root@localhost ~]# ll -d /opt/data
drwxr-xr-x. 2 mysql mysql 6 Aug 3 09:09 /opt/data
//初始化
[root@localhost ~]# mysqld --initialize --user mysql --datadir /opt/data/
2022-08-03T01:10:54.936977Z 1 [Note] A temporary password is generated for root@localhost: wN;gYChu=4fR
//编写配置文件
[root@localhost ~]# dnf -y remove mariadb*
[root@localhost ~]# vim /etc/my.c
[mysqld]
basedir = /usr/local/mysql
datadir = /opt/data
socket = /tmp/mysql.sock
port = 3306
pid-file = /opt/data/mysql.pid
user = mysql
skip-name-resolve
编写服务控制脚本
[root@localhost ~]# cd /usr/lib/systemd/system/
[root@localhost system]# cp httpd.service mysql.service
[root@localhost system]# vim mysqld.service
[Unit]
Description=mysql server daemon
After=network.target sshd-keygen.target
[Service]
Type=forking
ExecStart=/usr/local/mysql/support-files/mysql.server start
ExecStop=/usr/local/mysql/support-files/mysql.server stop
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target
[root@localhost system]# cd
[root@localhost ~]#
[root@localhost ~]# systemctl damon-reload
Unknown operation damon-reload.
[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl enable --now mysqld
Created symlink /etc/systemd/system/multi-user.target.wants/mysqld.service → /usr/lib/systemd/system/mysqld.service.
[root@localhost ~]# ss -anlt
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
LISTEN 0 128 [::]:22 [::]:*
LISTEN 0 80 *:3306 *:*
LISTEN 0 128 *:80 *:* //使用临时密码登录数据库修改密码
[root@localhost ~]# mysql -uroot -p'wN;gYChu=4fR'
mysql> set password = password('123456');
查看是否修改成功
[root@localhost ~]# mysql -uroot -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.38 MySQL Community Server (GPL)
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
3.3编译安装php
//下载php软件包
[root@localhost ~]# cd /usr/src/
[root@localhost src]# wget https://www.php.net/distributions/php-7.4.30.tar.gz
//解压软件包
[root@localhost src]# tar xf php-7.4.30.tar.gz
[root@localhost src]# ls
debug kernels mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz php-7.4.30 php-7.4.30.tar.gz
//安装依赖包
[root@localhost ~]# yum -y install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libicu-devel libjpeg libjpeg-devel libpng libpng-devel openldap-devel pcre-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel mhash mhash-devel php-mysqlnd
[root@localhost ~]# yum -y install http://mirror.centos.org/centos/8-stream/PowerTools/x86_64/os/Packages/oniguruma-devel-6.8.2-2.el8.x86_64.rpm
[root@localhost ~]# dnf -y install libsqlite3x-devel
[root@localhost ~]# dnf -y install libzip-devel
//编译安装
[root@localhost ~]# cd /usr/src/
[root@localhost src]# cd php-7.4.30
[root@localhost php-7.4.30]# ./configure --prefix=/usr/local/php7 \
--with-config-file-path=/etc \
--enable-fpm \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
--enable-soap \
--with-openssl \
--enable-bcmath \
--with-iconv \
--with-bz2 \
--enable-calendar \
--with-curl \
--enable-exif \
--enable-ftp \
--enable-gd \
--with-jpeg \
--with-zlib-dir \
--with-freetype \
--with-gettext \
--enable-json \
--enable-mbstring \
--enable-pdo \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-readline \
--enable-shmop \
--enable-simplexml \
--enable-sockets \
--with-zip \
--enable-mysqlnd-compression-support \
--with-pear \
--enable-pcntl \
--enable-posix
[root@localhost php-7.4.30]# make && make install
//配置环境变量
[root@localhost local]# echo 'export PATH=/usr/local/php7/bin:$PATH' > /etc/profile.d/php.sh
[root@localhost local]# source /etc/profile.d/php.sh
[root@localhost local]# which php
/usr/local/php7/bin/php
[root@localhost php-7.4.30]# php -v
PHP 7.4.30 (cli) (built: Aug 2 2022 22:27:01) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
//配置php-fpm
[root@localhost php-7.4.30]# cp php.ini-production /etc/php.ini
cp: overwrite '/etc/php.ini'? y
[root@localhost php-7.4.30]# cd sapi/
[root@localhost sapi]# cd fpm/
[root@localhost fpm]# file init.d.php-fpm
init.d.php-fpm: POSIX shell script, ASCII text executable
[root@localhost fpm]# cp init.d.php-fpm /etc/init.d/php-fpm
[root@localhost fpm]# chmod +x /etc/init.d/php-fpm
[root@localhost fpm]# cd /usr/local/php7/
[root@localhost php7]# ls
bin etc include lib php sbin var
[root@localhost php7]# cd etc/
[root@localhost etc]# cp php-fpm.conf.default php-fpm.conf
[root@localhost etc]# ls
pear.conf php-fpm.conf php-fpm.conf.default php-fpm.d
[root@localhost etc]# cd php-fpm.d/
[root@localhost php-fpm.d]# ls
www.conf.default
[root@localhost php-fpm.d]# cp www.conf.default www.conf
[root@localhost php-fpm.d]# ls
www.conf www.conf.default
//编辑php-fpm的配置文件(/usr/local/php7/etc/php-fpm.conf):
//配置fpm的相关选项为你所需要的值:
[root@localhost ~]# vim /usr/local/php7/etc/php-fpm.conf
[root@localhost ~]# tail /usr/local/php7/etc/php-fpm.conf
; files from a glob(3) pattern. This directive can be used everywhere in the
; file.
; Relative path can also be used. They will be prefixed by:
; - the global prefix if it's been set (-p argument)
; - /usr/local/php7 otherwise
include=/usr/local/php7/etc/php-fpm.d/*.conf
pm.max_children = 50 //最多同时提供50个进程提供50个并发服务
pm.start_servers = 5 //启动时启动5个进程
pm.min_spare_servers = 2 //最小空闲进程数
pm.max_spare_servers = 8 //最大空闲进程数
//取消httpd.conf的注释,启动httpd的相关模块
[root@localhost php-fpm.d]# vim /usr/local/apache/conf/httpd.conf
#LoadModule proxy_module modules/mod_proxy.so //取消井号
#LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so //取消井号
//编写测试文件
[root@localhost ~]# rm -rf /usr/local/apache/htdocs/index.html
[root@localhost ~]# vim /usr/local/apache/htdocs/index.php
[root@localhost ~]# cat /usr/local/apache/htdocs/index.php
<?php
phpinfo();
?>
[root@localhost ~]# chown -R apache.apache /usr/local/apache/htdocs/
[root@localhost ~]# ll -d /usr/local/apache/htdocs/
drwxr-xr-x. 3 apache apache 39 Aug 2 22:45 /usr/local/apache/htdocs/
//配置虚拟主机
[root@localhost ~]# vim /usr/local/apache/conf/httpd.conf
//在配置文件的最后加入以下内容
<VirtualHost *:80>
DocumentRoot "/usr/local/apache/htdocs/runtime"
ServerName runtime.example.com
ProxyRequests Off
ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/usr/local/apache/htdocs/$1
<Directory "/usr/local/apache/htdocs">
Options none
AllowOverride none
Require all granted
</Directory>
</VirtualHost>
[root@localhost ~]# vim /usr/local/apache/conf/httpd.conf
//搜索ADDType,添加以下内容
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php //添加此行
AddType application/x-httpd-php-source .phps //添加此行
//启动php httpd
[root@localhost local]# service php-fpm start
Starting php-fpm done
[root@localhost ~]# service php-fpm --full-restart
Gracefully shutting down php-fpm . done
Starting php-fpm done
[root@localhost local]# systemctl restart httpd
[root@localhost local]# ss -anlt
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 128 127.0.0.1:9000 0.0.0.0:*
LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
LISTEN 0 80 *:3306 *:*
LISTEN 0 128 *:80 *:*
LISTEN 0 128 [::]:22 [::]:*
3.4查看结果
4.lamp架构上部署phpmyadmin
数据库创建一个用户并授权
[root@localhost ~]# mysql -uroot -p123456
mysql> grant all on admin.* to 'admin'@'%' identified by '123456';
Query OK, 0 rows affected, 1 warning (0.10 sec)
mysql> grant all on admin.* to 'admin'@'localhost' identified by '123456';
Query OK, 0 rows affected, 2 warnings (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
4.2 下载phpmyadmin并解压和配置
[root@localhost ~]# wget https://files.phpmyadmin.net/phpMyAdmin/5.2.0/phpMyAdmin-5.2.0-all-languages.tar.gz
[root@localhost ~]# tar xf phpMyAdmin-5.2.0-all-languages.tar.gz -C /usr/local/apache/htdocs/runtime/
[root@localhost ~]# cd /usr/local/apache/htdocs/runtime/
[root@localhost runtime]# ls
index.php phpMyAdmin-5.2.0-all-languages
[root@localhost runtime]# mv phpMyAdmin-5.2.0-all-languages/* .
mv: overwrite './index.php'? y
[root@localhost runtime]# cp config.sample.inc.php config.inc.php
[root@localhost runtime]# vim config.inc.php
$cfg['Servers'][$i]['host'] = '127.0.0.1'; //把localhost改成为127.0.0.1
[root@localhost runtime]# systemctl restart httpd
检查结果,使用账号admin密码123456登录

· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· 2 本地部署DeepSeek模型构建本地知识库+联网搜索详细步骤