兰州网站建设,兰州网站建设公司,兰州小程序开发|兰州软件开发|兰州东方商易科技
在线客服,兰州网站建设|兰州APP开发|兰州小程序开发|兰州软件开发|兰州东方商易科技
新闻详情

Web环境搭建教程:lamp
2022-06-10

写一个Web环境搭建教程,用于能够运行WordPress,这个Web服务器搭建教程使用云服务器搭建Web,我用阿里云服务器CentOS做个示例。

一步:购买ECS服务器

这里比较简单,先领取一下阿里云代金券,购买阿里云服务器ECS,选择CentOS系统即可,推荐CentOS 6.x 64位。

第二步:配置yum源

备份repo

1

2

mv /etc/yum.repos.d /etc/yum.repos.d.back

mkdir /etc/yum.repos.d

新建CentOS源

1

vi /etc/yum.repos.d/CentOS-Base.repo

输入

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

# CentOS-Base.repo

#

# The mirror system uses the connecting IP address of the client and the

# update status of each mirror to pick mirrors that are updated to and

# geographically close to the client.  You should use this for CentOS updates

# unless you are manually picking other mirrors.

#

# If the mirrorlist= does not work for you, as a fall back you can try the

# remarked out baseurl= line instead.

#

#

[base]

name=CentOS-$releasever - Base

baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#released updates

[updates]

name=CentOS-$releasever - Updates

baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful

[extras]

name=CentOS-$releasever - Extras

baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$releasever - Plus

baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus

gpgcheck=1

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users

[contrib]

name=CentOS-$releasever - Contrib

baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/contrib/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib

gpgcheck=1

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

新增epel、remi、MariaDB

1

2

3

yum install yum-utils -y

yum install https://mirrors.tuna.tsinghua.edu.cn/epel/6/x86_64/epel-release-6-8.noarch.rpm

yum install https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/remi-release-6.rpm

1

vi /etc/yum.repos.d/MariaDB.repo

输入

1

2

3

4

5

6

7

# MariaDB 10.3 CentOS repository list - created 2019-01-10 05:49 UTC

# http://downloads.mariadb.org/mariadb/repositories/

[mariadb]

name = MariaDB

baseurl = https://mirrors.tuna.tsinghua.edu.cn/mariadb/yum/10.3/centos6-amd64/

gpgkey=https://mirrors.tuna.tsinghua.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB

gpgcheck=1

第三步:安装Apache、PHP、MariaDB

1

2

3

yum makecache

yum-config-manager --enable remi remi-php73

yum install php php-bcmath php-cli php-common php-dba php-devel php-embedded php-enchant php-fpm php-gd php-intl php-ldap php-mbstring php-mysql php-mysqlnd php-odbc php-pdo php-pear php-pecl-memcache php-pgsql php-process php-pspell php-recode php-snmp php-soap php-xml php-xmlrpc php-opcache mod_ssl sendmail unzip crontabs MariaDB-server MariaDB-client

第四步:启动Apache、设置数据库密码

1

2

service httpd restart && service mysql restart

mysql_secure_installation

二维码,兰州网站建设公司,兰州网站建设,兰州做网站,兰州APP开发,兰州APP定制,兰州小程序开发,兰州微信小程序开发,兰州app软件定制
客服,兰州网站建设公司,兰州网站建设,兰州做网站,兰州APP开发,兰州APP定制,兰州小程序开发,兰州微信小程序开发,兰州app软件定制
联系电话,兰州网站建设公司,兰州网站建设,兰州做网站,兰州APP开发,兰州APP定制,兰州小程序开发,兰州微信小程序开发
联系电话:0931-8414525
技术支持:15719323307
投诉建议:18153688379
联系地址,兰州网站建设公司,兰州网站建设,兰州做网站,兰州APP开发,兰州APP定制,兰州小程序开发,兰州微信小程序开发,兰州app软件定制
兰州市七里河区敦煌路街道中天健广场1幢718
兰州市西津西路16号兰州中心写字楼1单元2110
兰州市定西南路229号(甘肃省科学院)
ICP备案号:陇ICP备17003752号-2 甘公网安备 甘公网安备 6201032000477
联系我们,兰州网站建设公司,兰州网站建设,兰州做网站,兰州APP开发,兰州APP定制,兰州小程序开发,兰州微信小程序开发,兰州app软件定制
联系我们,兰州网站建设公司,兰州网站建设,兰州做网站,兰州APP开发,兰州APP定制,兰州小程序开发,兰州微信小程序开发,兰州app软件定制
联系我们,兰州网站建设公司,兰州网站建设,兰州做网站,兰州APP开发,兰州APP定制,兰州小程序开发,兰州微信小程序开发,兰州app软件定制