day23LAMP黄金架构学习笔记

day23LAMP黄金架构学习笔记

黄金web架构之LAMP

什么是LAMP

LAMP是公认的最常见、最古老的黄金Web技术栈、

其实就是

Linux 操作系统

Apache/Nginx web服务器

Mysql/Mariadb

Perl/Php/Python

部署LAMP实战

一、环境准备

软件准备

LAMP

Apache——>httpd

MySQL——>5.6.31

PHP——>7.2.17

apr-1.5.2.tar.bz2

apr-util-1.5.4.tar.bz2

httpd-2.4.37.tar.bz2

mysql-5.6.43

php-7.2.17.tar.xz

wordpress-4.7.3-zh_CN.tar.gz

关闭防火墙

[root@ztd ~]# iptables -F

[root@ztd ~]# systemctl stop firewalld

[root@ztd ~]# systemctl disable firewalld

[root@ztd ~]# setenforce 0

setenforce: SELinux is disabled

[root@ztd ~]#

基础软件库安装(这就好比一个房子要装修,你要去准备水泥、沙子,木材等等..)

1.底层的一些依赖

yum install gcc patch libffi-devel python-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel net-tools vim -y

2.后续会涉及的一些命令

yum install cmake make pcre-devel ncurses-devel openssl-devel libcurl-devel -y

3.后续涉及的一些命令

yum install libxml2-devel libjpeg-devel libpng-devel freetype-devel libcurl-devel wget -y

linux很多软件的运行,依赖于操作系统本身的一些软件支持

yum groupinstall "Development tools" -y

桌面开发工具包(图形化相关包)

yum groupinstall "Desktop Platform Development" -y

编译安装顺序,由于软件之间存在依赖性,会有先后顺序。

说明:

apache必须要先于php安装

apache和mysql之间并没有直接先后顺序的依赖,所以谁先谁后没所谓。

在php-5.3版本前,mysql必须先于php的编译;因为php需要实现连接数据库的功能,它通过mysql的接口才能编译出该功能;

在php-5.3版本或者之后,php已经集成了一套连接mysql数据的代码,并不依赖mysql的接口,这个时候,mysql和php的编译顺序也就无所谓了。

二、编译安装mysql

1、安装需求

软件版本安装目录数据目录端口

mysql-5.6.31

/usr/local/mysql

/usr/local/mysql/data

3306

2、安装步骤

㈠ 创建mysql用户

[root@ztd ~]#

[root@ztd ~]# useradd -r -s /sbin/nologin mysql

㈡ 下载,并且解压缩

源码搜索地址,https://repo.huaweicloud.com/mysql/Downloads/MySQL-5.6/

开始下载

[root@ztd ~]# cd /usr/local/

[root@ztd local]# mkdir software-mysql

[root@ztd local]# cd software-mysql/

[root@ztd software-mysql]# wget -c https://repo.huaweicloud.com/mysql/Downloads/MySQL-5.6/mysql-5.6.51.tar.gz

--2022-04-02 15:50:07-- https://repo.huaweicloud.com/mysql/Downloads/MySQL-5.6/mysql-5.6.51.tar.gz解压缩

[root@ztd software-mysql]# lltotal 31652-rw-r--r-- 1 root root 32411131 Jan 5 2021 mysql-5.6.51.tar.gz[root@ztd software-mysql]# tar -zxf mysql-5.6.51.tar.gz [root@ztd software-mysql]# lltotal 31656drwxr-xr-x 33 7161 31415 4096 Jan 5 2021 mysql-5.6.51-rw-r--r-- 1 root root 32411131 Jan 5 2021 mysql-5.6.51.tar.gz[root@ztd software-mysql]#

㈢ 进入目录,根据需求配置编译参数

[root@ztd software-mysql]# cd mysql-5.6.51

# 创建编译脚本,设置编译参数

[root@ztd mysql-5.6.51]# vim cmake.sh

[root@ztd mysql-5.6.51]# vim cmake.sh

[root@ztd mysql-5.6.51]# cat cmake.sh

cmake . \

-DCMAKE_INSTALL_PREFIX=/usr/local/mysql/ \

-DMYSQL_DATADIR=/usr/local/mysql/data \

-DENABLED_LOCAL_INFILE=1 \

-DWITH_INNOBASE_STORAGE_ENGINE=1 \

-DMYSQL_TCP_PORT=3306 \

-DDEFAULT_CHARSET=utf8mb4 \

-DDEFAULT_COLLATION=utf8mb4_general_ci \

-DWITH_EXTRA_CHARSETS=all \

-DMYSQL_USER=mysql

[root@ztd mysql-5.6.51]# #添加执行权限[root@ztd mysql-5.6.51]# chmod +x cmake.sh[root@ztd mysql-5.6.51]# ll cmake.sh -rwxr-xr-x 1 root root 295 Apr 2 15:58 cmake.sh[root@ztd mysql-5.6.51]#

执行该脚本./cmake.sh

关于编译传输的解释

首先执行cmake这个命令,用于设置安装mysql的一些参数

后面就是cmake命令的各种参数,比如调整端口,安装目录,安装用户等

cmake . \

-DCMAKE_INSTALL_PREFIX=/usr/local/mysql/ \ 安装路径

-DMYSQL_DATADIR=/usr/local/mysql/data \ 数据目录

-DENABLED_LOCAL_INFILE=1 \ 开启加载外部文件功能;1开启,0关闭

-DWITH_INNOBASE_STORAGE_ENGINE=1 \ 将InnoDB存储引擎静态编译到服务器

-DMYSQL_TCP_PORT=3306 \ 端口

-DDEFAULT_CHARSET=utf8mb4 \ 字符集

-DDEFAULT_COLLATION=utf8_general_ci \ 字符校验规则

-DWITH_EXTRA_CHARSETS=all \ 扩展字符集

-DMYSQL_USER=mysql 用户身份mysql

㈣ 编译并安装

[root@ztd mysql-5.6.51]# make && make install

开始编译,以及安装到指定的位置

㈤ 安装mysql后续配置

修改mysql安装目录的权限,属主,属组

[root@ztd mysql-5.6.51]# chown -R mysql.mysql /usr/local/mysql/

[root@ztd mysql-5.6.51]# ll /usr/local/mysql/

total 244

drwxr-xr-x 2 mysql mysql 4096 Apr 2 16:25 bin

drwxr-xr-x 3 mysql mysql 4096 Apr 2 16:25 data

drwxr-xr-x 2 mysql mysql 4096 Apr 2 16:25 docs

drwxr-xr-x 3 mysql mysql 4096 Apr 2 16:25 include

drwxr-xr-x 3 mysql mysql 4096 Apr 2 16:25 lib

-rw-r--r-- 1 mysql mysql 200256 Jan 5 2021 LICENSE

drwxr-xr-x 4 mysql mysql 4096 Apr 2 16:25 man

drwxr-xr-x 10 mysql mysql 4096 Apr 2 16:25 mysql-test

-rw-r--r-- 1 mysql mysql 566 Jan 5 2021 README

drwxr-xr-x 2 mysql mysql 4096 Apr 2 16:25 scripts

drwxr-xr-x 28 mysql mysql 4096 Apr 2 16:25 share

drwxr-xr-x 4 mysql mysql 4096 Apr 2 16:25 sql-bench

drwxr-xr-x 2 mysql mysql 4096 Apr 2 16:25 support-files

[root@ztd mysql-5.6.51]#

初始化数据库,生成可用的数据库文件。

1.移除默认的mysql配置文件,改名即可

[root@ztd mysql-5.6.51]#

[root@ztd mysql-5.6.51]# mv /etc/my.cnf /etc/my.cnf.ori

[root@ztd mysql-5.6.51]#

2.确保没有mysql进程

[root@ztd mysql-5.6.51]# ps -ef|grep mysql

root 18535 1426 0 16:30 pts/0 00:00:00 grep --color=auto mysql

3.进入mysql安装目录,开始初始化

[root@ztd mysql-5.6.51]# cd /usr/local/mysql/

[root@ztd mysql]# ./scripts/mysql_install_db --user=mysql

Installing MySQL system tables...2022-04-02 16:31:33 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

看到两个ok后表示安装正确

4.验证数据库目录里是否有文件

[root@ztd mysql]# ll /usr/local/mysql/data

total 110604

-rw-rw---- 1 mysql mysql 12582912 Apr 2 16:31 ibdata1

-rw-rw---- 1 mysql mysql 50331648 Apr 2 16:31 ib_logfile0

-rw-rw---- 1 mysql mysql 50331648 Apr 2 16:31 ib_logfile1

drwx------ 2 mysql mysql 4096 Apr 2 16:31 mysql

drwx------ 2 mysql mysql 4096 Apr 2 16:31 performance_schema

drwxr-xr-x 2 mysql mysql 4096 Apr 2 16:25 test

[root@ztd mysql]#

制作启动mysql脚本,系统提供好了模板

拷贝脚本,放入linux一个固定的服务启动目录

[root@ztd mysql]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql

启动、检查mysql服务

[root@ztd mysql]# service mysql status

MySQL is not running [FAILED]

[root@ztd mysql]# service mysql start

Starting MySQL.Logging to '/usr/local/mysql/data/ztd.err'.

[ OK ]

[root@ztd mysql]# service mysql status

MySQL running (18719) [ OK ]

[root@ztd mysql]#

设置mysql默认密码

[root@ztd mysql]# /usr/local/mysql/bin/mysqladmin -uroot password 'ztd666'

Warning: Using a password on the command line interface can be insecure.

[root@ztd mysql]#

配置环境变量

[root@ztd mysql]# /usr/local/mysql/bin/mysqladmin -uroot password 'ztd666'

Warning: Using a password on the command line interface can be insecure.

[root@ztd mysql]# cat >> /etc/profile <

> export PATH=/usr/local/mysql/bin/:$PATH

> EOF

[root@ztd mysql]# source /etc/profile

[root@ztd mysql]# tail -1 /etc/profile

export PATH=/usr/local/mysql/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

[root@ztd mysql]#

测试mysql登录

[root@ztd mysql]# mysql -uroot -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.6.51 Source distribution

Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.

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>

三、编译安装Apache

1. 安装依赖包apr

apr(apache portable run-time libraries,Apache可移植运行库)的目的如其名称一样,主要为上层的应用程序提供一个可以跨越多操作系统平台使用的底层支持接口库。

下载文件

[root@ztd mysql]# cd ../

[root@ztd local]# mkdir software-apache

[root@ztd local]# cd software-apache/

[root@ztd software-apache]# wget -c http://archive.apache.org/dist/apr/apr-1.5.2.tar.bz2

解压缩,执行配置

[root@ztd software-apache]# ll

total 808

-rw-r--r-- 1 root root 826885 Apr 29 2015 apr-1.5.2.tar.bz2

[root@ztd software-apache]# tar -xf apr-1.5.2.tar.bz2

[root@ztd software-apache]# ll

total 812

drwxr-xr-x 27 1000 1000 4096 Apr 25 2015 apr-1.5.2

-rw-r--r-- 1 root root 826885 Apr 29 2015 apr-1.5.2.tar.bz2

[root@ztd software-apache]# cd apr-1.5.2

[root@ztd apr-1.5.2]# ./configure 进行编译安装

[root@ztd apr-1.5.2]# make && make install

安装apr-util软件

完整的APR(Apache portable Run-time libraries,Apache可移植运行库)实际上包含了三个开发包:apr、apr-util以及apr-iconv,每一个开发包分别独立开发,并拥有自己的版本。

apr-util该目录中也是包含了一些常用的开发组件。

这些组件与apr目录下的相比,它们与apache的关系更加密切一些。比如存储段和存储段组,加密等等

进行下载动作

[root@ztd apr-1.5.2]# cd ../

[root@ztd software-apache]# cd ../

[root@ztd local]# cd -

/usr/local/software-apache

[root@ztd software-apache]# wget -c https://archive.apache.org/dist/apr/apr-util-1.5.4.tar.bz2

--2022-04-02 17:01:57-- https://archive.apache.org/dist/apr/apr-util-1.5.4.tar.bz2

Resolving archive.apache.org (archive.apache.org)... 138.201.131.134, 2a01:4f8:172:2ec5::2

解压缩

[root@ztd software-apache]# tar -xf apr-util-1.5.4.tar.bz2

[root@ztd software-apache]# cd apr-util-1.5.4

[root@ztd apr-util-1.5.4]#

开始编译安装apr-utils ,且需要指定安装的apr命令路径

[root@ztd apr-util-1.5.4]# ./configure --with-apr=/usr/local/apr/bin/apr-1-config

编译且安装

[root@ztd apr-util-1.5.4]# make && make install

[root@ztd apr-util-1.5.4]# ls /usr/local/apr/lib

apr.exp libapr-1.a libapr-1.so.0 libaprutil-1.la libaprutil-1.so.0.5.4

apr-util-1 libapr-1.la libapr-1.so.0.5.2 libaprutil-1.so pkgconfig

aprutil.exp libapr-1.so libaprutil-1.a libaprutil-1.so.0

这些.so就好比windows下的.dll

ldconfig命令

思考:

==一个软件的库文件是有可能被其它软件所调用,那么其它软件能否找到你的库文件呢?==

一般来说,库文件安装到/lib,/lib64,/usr/lib/,/usr/lib64等,都可以找得到; 但是如果一个软件A把库文件安装到/usr/local/A/lib下,就要把这个路径加入到ldconfig命令可以找到的路径列表里面去,别人才能找到。

ldconfig是一个动态链接库管理命令;主要用途是在默认搜索目录(/lib,/lib64,/usr/lib/,/usr/lib64)以及动态库配置文件/etc/ld.so.conf中所列的目录中搜索出可共享的动态链接库。

问题:怎样将库文件的指定安装路径加入到ldconfig命令的搜索列表里?

[root@ztd apr-util-1.5.4]# echo "/usr/local/apr/lib/" >> /etc/ld.so.conf

[root@ztd apr-util-1.5.4]# cat /etc/ld.so.conf

include ld.so.conf.d/*.conf

/usr/local/apr/lib/

[root@ztd apr-util-1.5.4]#

2. 编译安装httpd

㈠ 解压软件并进入解压目录,第一曲

下载

[root@ztd software-apache]# wget -c https://archive.apache.org/dist/httpd/httpd-2.4.37.tar.bz2

--2022-04-02 17:25:03-- https://archive.apache.org/dist/httpd/httpd-2.4.37.tar.bz2

Resolving archive.apache.org (archive.apache.org)... 138.201.131.134, 2a01:4f8:172:2ec5::2

Connecting to archive.apache.org (archive.apache.org)|138.201.131.134|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: 7031632 (6.7M) [application/x-bzip2]

Saving to: ‘httpd-2.4.37.tar.bz2’

7% [===> ] 516,096 7.35KB/s eta 17m 34s^C

[root@ztd software-apache]# ll

total 2008

drwxr-xr-x 28 1000 1000 4096 Apr 2 16:59 apr-1.5.2

-rw-r--r-- 1 root root 826885 Apr 29 2015 apr-1.5.2.tar.bz2

drwxr-xr-x 20 1000 1000 4096 Apr 2 17:07 apr-util-1.5.4

-rw-r--r-- 1 root root 694427 Sep 20 2014 apr-util-1.5.4.tar.bz2

-rw-r--r-- 1 root root 524288 Apr 2 17:26 httpd-2.4.37.tar.bz2

[root@ztd software-apache]# rm -rf httpd-2.4.37.tar.bz2

[root@ztd software-apache]#

发现网速过慢,采用windows下载

[root@ztd software-apache]# yum install lrzsz -y

[root@ztd software-apache]# rz -E

rz waiting to receive.

[root@ztd software-apache]# ll

total 8364

drwxr-xr-x 28 1000 1000 4096 Apr 2 16:59 apr-1.5.2

-rw-r--r-- 1 root root 826885 Apr 29 2015 apr-1.5.2.tar.bz2

drwxr-xr-x 20 1000 1000 4096 Apr 2 17:07 apr-util-1.5.4

-rw-r--r-- 1 root root 694427 Sep 20 2014 apr-util-1.5.4.tar.bz2

-rw-r--r-- 1 root root 7031632 Apr 2 17:29 httpd-2.4.37.tar.bz2

[root@ztd software-apache]# tar zf httpd-2.4.37.tar.bz2

tar: You must specify one of the `-Acdtrux' or `--test-label' options

Try `tar --help' or `tar --usage' for more information.

[root@ztd software-apache]# tar -xf httpd-2.4.37.tar.bz2

[root@ztd software-apache]# ll

total 8368

drwxr-xr-x 28 1000 1000 4096 Apr 2 16:59 apr-1.5.2

-rw-r--r-- 1 root root 826885 Apr 29 2015 apr-1.5.2.tar.bz2

drwxr-xr-x 20 1000 1000 4096 Apr 2 17:07 apr-util-1.5.4

-rw-r--r-- 1 root root 694427 Sep 20 2014 apr-util-1.5.4.tar.bz2

drwxr-sr-x 11 root 40 4096 Oct 18 2018 httpd-2.4.37

-rw-r--r-- 1 root root 7031632 Apr 2 17:29 httpd-2.4.37.tar.bz2

[root@ztd software-apache]#

㈡ 根据需求配置,第二曲

1.修改配置参数,可以做成脚本

[root@ztd software-apache]# cat apache-configure.sh

./configure \

--enable-modules=all \

--enable-mods-shared=all \

--enable-so \

--enable-rewrite \

--with-pcre \

--enable-ssl \

--with-mpm=prefork \

--with-apr=/usr/local/apr/bin/apr-1-config \

--with-apr-util=/usr/local/apr/bin/apu-1-config

[root@ztd software-apache]#

添加执行权限,执行该脚本

[root@ztd software-apache]# chmod +x apache-configure.sh

[root@ztd software-apache]# ./apache-configure.sh^C

㈢ 编译并安装

编译且安装

[root@ztd httpd-2.4.37]# make && make install

查看是否安装了httpd

[root@ztd httpd-2.4.37]# ls /usr/local/apache2/

bin build cgi-bin conf error htdocs icons include logs man manual modules

[root@ztd httpd-2.4.37]#

四、编译安装php

1、下载。解压。并进入解压目录

[root@ztd httpd-2.4.37]# cd ../

[root@ztd software-apache]# cd ../

[root@ztd local]# mkdir software-php

[root@ztd local]# cd software-php/

[root@ztd software-php]# wget -c https://museum.php.net/php7/php-7.2.17.tar.xz

--2022-04-02 17:55:08-- https://museum.php.net/php7/php-7.2.17.tar.xz

Resolving museum.php.net (museum.php.net)... 185.85.0.29, 2a02:cb40:200::1ad

Connecting to museum.php.net (museum.php.net)|185.85.0.29|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: 12144120 (12M) [application/octet-stream]

Saving to: ‘php-7.2.17.tar.xz’

100%[===============================================================>] 12,144,120 52.6KB/s in 4m 27s

2022-04-02 17:59:37 (44.3 KB/s) - ‘php-7.2.17.tar.xz’ saved [12144120/12144120]

[root@ztd software-php]# tar -xf php-7.2.17.tar.xz

[root@ztd software-php]# cd php-7.2.17

[root@ztd php-7.2.17]# pwd

/usr/local/software-php/php-7.2.17

[root@ztd php-7.2.17]#

因配置参数过长,采用写脚本形式进行执行参数配置

[root@ztd php-7.2.17]# cat configure_php.sh

./configure \

--with-apxs2=/usr/local/apache2/bin/apxs \

--with-mysqli \

--with-pdo-mysql \

--with-zlib \

--with-curl \

--enable-zip \

--with-gd \

--with-freetype-dir \

--with-jpeg-dir \

--with-png-dir \

--enable-sockets \

--with-xmlrpc \

--enable-soap \

--enable-opcache \

--enable-mbstring \

--enable-mbregex \

--enable-pcntl \

--enable-shmop \

--enable-sysvmsg \

--enable-sysvsem \

--enable-sysvshm \

--enable-calendar \

--enable-bcmath

[root@ztd php-7.2.17]#

2、configure配置php编译

执行该脚本

[root@ztd php-7.2.17]#

[root@ztd php-7.2.17]# chmod +x configure_php.sh

[root@ztd php-7.2.17]#

3、编译且安装

[root@ztd php-7.2.17]# make && make install

五、结合php和apache配置

1、修改apache配置文件支持php

1.修改apache配置文件,找到你的安装路径

配置语言支持

159 LoadModule negotiation_module modules/mod_negotiation.so 去掉这一行的注释

482 Include conf/extra/httpd-languages.conf 打开此选项,扩展配置文件就生效了

让apache支持php语言的插件,当有用户访问php程序时,apache自动转发给php程序去解析。

166 LoadModule php7_module modules/libphp7.so 找到这一行,然后在下面添加语句

添加以下两行意思是以.php结尾的文件都认为是php程序文件,注意两句话的.php前面都是有一个空格的

也就是长这样

166 LoadModule php7_module modules/libphp7.so

167 AddHandler php7-script .php

168 AddType text/html .php

添加一个默认的网站首页,添加为php的文件

263 #

264 # DirectoryIndex: sets the file that Apache will serve if a directory

265 # is requested.

266 #

267

268 DirectoryIndex index.php index.html

269

270

关于网站默认的首页html文件,存放的目录路径,由以下参数控制

230 # DocumentRoot: The directory out of which you will serve your

231 # documents. By default, all requests are taken from this directory, but

232 # symbolic links and aliases may be used to point to other locations.

233 #

234 DocumentRoot "/usr/local/apache2/htdocs"

235

2.修改apache的子配置文件,优先支持中文,需要做如下两步操作

[root@lamp-241 php-7.2.17]# vim /usr/local/apache2/conf/extra/httpd-languages.conf

19 DefaultLanguage zh-CN

75 # Just list the languages in decreasing order of preference. We have

76 # more or less alphabetized them here. You probably want to change this.

77 #

78 LanguagePriority zh-CN en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv tr zh-CN zh-TW

3.修改apache的域名,也就是我们网站的域名配置

210 ServerName yuchao-lamp.cc

2、测试apache是否支持php

进入php的网页目录,创造php文件,测试这些

[root@ztd php-7.2.17]# vim /usr/local/apache2/conf/httpd.conf

[root@ztd php-7.2.17]# vim /usr/local/apache2/conf/httpd.conf

[root@ztd php-7.2.17]# vim /usr/local/apache2/conf/extra/httpd-languages.conf

[root@ztd php-7.2.17]# cd /usr/local/apache2/htdocs

[root@ztd htdocs]# pwd

/usr/local/apache2/htdocs

[root@ztd htdocs]# ll

total 4

-rw-r--r-- 1 root root 45 Jun 12 2007 index.html

[root@ztd htdocs]# rm -rf index.html

[root@ztd htdocs]# vim index.php

[root@ztd htdocs]# cat index.php

赫尔或或或或或

phpinfo();

?>

[root@ztd htdocs]#

3、启动apache

拷贝apache默认提供的一个脚本即可,就是启动apache的命令

[root@ztd htdocs]# service apache start

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::216:3ef

[root@ztd htdocs]# netstat -tnlp|grep 80

tcp6 0 0 :::80 :::* LISTEN 30425/httpd

六、部署web应用

1.下载源码

[root@ztd htdocs]#

[root@ztd htdocs]# cd ../

[root@ztd apache2]# cd ../

[root@ztd local]# mkdir software-wordpress

[root@ztd local]# cd software-wordpress/

[root@ztd software-wordpress]# wget -c https://cn.wordpress.org/wordpress-4.7.3-zh_CN.tar.gz

[root@ztd software-wordpress]# ll

total 8276

-rw-r--r-- 1 root root 8473348 Mar 7 2017 wordpress-4.7.3-zh_CN.tar.gz

[root@ztd software-wordpress]#

2.开始解压

[root@ztd software-wordpress]# tar -xf wordpress-4.7.3-zh_CN.tar.gz [root@ztd software-wordpress]# lltotal 8280drwxr-xr-x 5 nobody 65534 4096 Mar 7 2017 wordpress-rw-r--r-- 1 root root 8473348 Mar 7 2017 wordpress-4.7.3-zh_CN.tar.gz

3.解压缩该源码,放入到httpd的网页根目录中去

[root@ztd software-wordpress]# mv wordpress/* /usr/local/apache2/htdocs/

但是,注意,先看一下apache的启动进程,用户是谁修改权限,wordpress源码文件的属主、属组,防止权限有问题

[root@ztd software-wordpress]# ps -ef|grep 'apache'root 30425 1 0 19:25 ? 00:00:00 /usr/local/apache2/bin/httpd -k startdaemon 30426 30425 0 19:25 ? 00:00:00 /usr/local/apache2/bin/httpd -k startdaemon 30427 30425 0 19:25 ? 00:00:00 /usr/local/apache2/bin/httpd -k startdaemon 30428 30425 0 19:25 ? 00:00:00 /usr/local/apache2/bin/httpd -k startdaemon 30429 30425 0 19:25 ? 00:00:00 /usr/local/apache2/bin/httpd -k startdaemon 30430 30425 0 19:25 ? 00:00:00 /usr/local/apache2/bin/httpd -k startdaemon 30435 30425 0 19:26 ? 00:00:00 /usr/local/apache2/bin/httpd -k startdaemon 30436 30425 0 19:26 ? 00:00:00 /usr/local/apache2/bin/httpd -k startdaemon 30455 30425 0 19:42 ? 00:00:00 /usr/local/apache2/bin/httpd -k startdaemon 30458 30425 0 19:42 ? 00:00:00 /usr/local/apache2/bin/httpd -k startdaemon 30461 30425 0 19:42 ? 00:00:00 /usr/local/apache2/bin/httpd -k startroot 30479 1426 0 19:58 pts/0 00:00:00 grep --color=auto apache

[root@ztd software-wordpress]# chown -R daemon.daemon /usr/local/apache2/htdocs/

相关推荐

戒指怎么调节大小
365bet体育网址

戒指怎么调节大小

📅 07-06 👁️ 1565
桟的字典解释
365bet体育网址

桟的字典解释

📅 07-06 👁️ 2242
喤呷的意思
在线365bet盘口

喤呷的意思

📅 07-01 👁️ 9916