Win10平台下安装并配置Apache服务器

Win10平台下安装并配置Apache服务器,第1张

资源链接: https://pan.baidu.com/s/1UYmQ-nf9OVudO4g8ePtpBQ

提取码:5x02

首先确定自己的安装位置,将文件解压到自己的安装位置,解压出来的文件可以重新歼空命名。打开解压后的文件找到Apache24文件夹;Apache24文件夹的路径就是我们的安装路径我的是 G:/AndroidWeb/ApachePackage/Apache/Apache24

无法打开的可以修改后缀为txt修改,改完之后再回来。

1.安装目录不在C盘,比如我是G盘,那么输入 G: 回车

2.进入Apache24文件夹下面的bin目录,我的输入 cd G:/AndroidWeb/ApachePackage/Apache/Apache24/bin

3.安装Apache: httpd.exe -k install -n “localhost”

4.如果出问题需要卸载:(上述问题氏派瞎是我们的修改没有保存,所以说目录不合法) httpd.exe -k uninstall -n "localhost"

5.开启服务: httpd.exe -k start -n "localhost"

6.关闭服务: httpd.exe -k stop -n "localhost"

7.测试是否成功:终端进入进入Apache24文件夹下面的bin目录 cd G:/AndroidWeb/ApachePackage/Apache/Apache24/bin ,开启服务 httpd.exe -k start -n "localhost" ,打开浏览器,地址栏输入 http://localhost 并回车,显示It works!,表明Apache配置成功。

8.对应的进程。

9.快速开启服务,重羡档启,关闭:

其实,网上这块的部署文章非常多 。随便搜索,都有 。

这篇文章,老徐帮大家挑选几个比较重点的过程 &命令

1. 有些 linux 版本中已经预置了有Apache,并且已经是服务了,所有首先检查系统中是否已经存在httpd的服务

1)先检查 服务器 上是否已经启动了此察派服务 。

命令如下

ps -ef|grep httpd

2)查看linux系统服务中有没庆纳有httpd

chkconfig --list | grep httpd

3)如果有服务存在,那么败差贺需要先关闭httpd服务自启动

命令 chkconfig httpd off

4)停止httpd服务

命令 service httpd stop

5)再次查看,是否有进程存在

命令 ps -ef|grep httpd

6)如果有进程存在,关闭进程

命令 kill -9 pid

1)先检查 安装包 的名字

命令 rpm -qa|grep httpd

<pre style="box-sizing: border-boxfont-family: Monaco, Menlo, Consolas, "Courier New", monospacefont-size: 12pxwhite-space: pre-wrapdisplay: blockpadding: 9.5pxmargin: 0px 0px 10pxline-height: 1.38462color: rgb(51, 51, 51)word-break: break-alloverflow-wrap: break-wordbackground-color: rgb(245, 245, 245)border: 1px solid rgb(204, 204, 204)border-radius: 4pxfont-style: normalfont-variant-ligatures: normalfont-variant-caps: normalfont-weight: 400letter-spacing: normalorphans: 2text-align: starttext-indent: 0pxtext-transform: nonewidows: 2word-spacing: 0px-webkit-text-stroke-width: 0pxtext-decoration-thickness: initialtext-decoration-style: initialtext-decoration-color: initial">[root@istester]~# rpm -qa|grep httpd

httpd-2.2.15-69.el6.centos.x86_64

httpd-tools-2.2.15-69.el6.centos.x86_64</pre>

2)根据安装包名字删除包

rpm -e httpd-tools-2.2.15-69.el6.centos.x86_64

rpm -e httpd-2.2.15-69.el6.centos.x86_64

3)删除httpd.conf文件

<pre class="prettyprint" style="box-sizing: border-boxfont-family: Monaco, Menlo, Consolas, "Courier New", monospacefont-size: 12pxwhite-space: pre-wrapdisplay: blockpadding: 9.5pxmargin: 0px 0px 10pxline-height: 1.38462color: rgb(51, 51, 51)word-break: break-alloverflow-wrap: break-wordbackground-color: rgb(245, 245, 245)border: 1px solid rgb(204, 204, 204)border-radius: 4pxfont-style: normalfont-variant-ligatures: normalfont-variant-caps: normalfont-weight: 400letter-spacing: normalorphans: 2text-align: starttext-indent: 0pxtext-transform: nonewidows: 2word-spacing: 0px-webkit-text-stroke-width: 0pxtext-decoration-thickness: initialtext-decoration-style: initialtext-decoration-color: initial">#先检查文件在哪

find / -name httpd.conf

rm /xxx/xxx/httpd.conf</pre>

3. 准备事项已完成,剩下的就是常规安装了 。

注:我们通过yum的方式,在线安装,非常简单 。

1)检查是否存在httpd包

<pre style="box-sizing: border-boxfont-family: Monaco, Menlo, Consolas, "Courier New", monospacefont-size: 12pxwhite-space: pre-wrapdisplay: blockpadding: 9.5pxmargin: 0px 0px 10pxline-height: 1.38462color: rgb(51, 51, 51)word-break: break-alloverflow-wrap: break-wordbackground-color: rgb(245, 245, 245)border: 1px solid rgb(204, 204, 204)border-radius: 4pxfont-style: normalfont-variant-ligatures: normalfont-variant-caps: normalfont-weight: 400letter-spacing: normalorphans: 2text-align: starttext-indent: 0pxtext-transform: nonewidows: 2word-spacing: 0px-webkit-text-stroke-width: 0pxtext-decoration-thickness: initialtext-decoration-style: initialtext-decoration-color: initial">[www@istester ~]$ yum list httpd

Loaded plugins: security

base | 3.7 kB 00:00

epel | 4.7 kB 00:00

epel/primary_db | 6.0 MB 00:00

extras | 3.4 kB 00:00

extras/primary_db| 28 kB 00:00

updates | 3.4 kB 00:00

updates/primary_db | 3.2 MB 00:00

Available Packages

httpd.x86_64 2.2.15-69.el6.centos base</pre>

2、安装Apache

yum install httpd

<pre style="box-sizing: border-boxfont-family: Monaco, Menlo, Consolas, "Courier New", monospacefont-size: 12pxwhite-space: pre-wrapdisplay: blockpadding: 9.5pxmargin: 0px 0px 10pxline-height: 1.38462color: rgb(51, 51, 51)word-break: break-alloverflow-wrap: break-wordbackground-color: rgb(245, 245, 245)border: 1px solid rgb(204, 204, 204)border-radius: 4pxfont-style: normalfont-variant-ligatures: normalfont-variant-caps: normalfont-weight: 400letter-spacing: normalorphans: 2text-align: starttext-indent: 0pxtext-transform: nonewidows: 2word-spacing: 0px-webkit-text-stroke-width: 0pxtext-decoration-thickness: initialtext-decoration-style: initialtext-decoration-color: initial">Total20 MB/s | 932 kB 00:00

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Installing : apr-util-ldap-1.3.9-3.el6_0.1.x86_64 1/4

Updating : httpd-tools-2.2.15-69.el6.centos.x86_64 2/4

Installing : httpd-2.2.15-69.el6.centos.x86_643/4

Cleanup: httpd-tools-2.2.15-53.el6.centos.x86_64 4/4

Verifying : httpd-tools-2.2.15-69.el6.centos.x86_64 1/4

Verifying : httpd-2.2.15-69.el6.centos.x86_642/4

Verifying : apr-util-ldap-1.3.9-3.el6_0.1.x86_64 3/4

Verifying : httpd-tools-2.2.15-53.el6.centos.x86_64 4/4

Installed:

httpd.x86_64 0:2.2.15-69.el6.centos

Dependency Installed:

apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1

Dependency Updated:

httpd-tools.x86_64 0:2.2.15-69.el6.centos

Complete!</pre>

安装过程,不用理会,如果看到如上提示,说明安装成功了。

3、设置Apache服务的启动级别

chkconfig --levels 235 httpd on

Apache是一个服务,所以,可以通过设置服务的启动级别来让它启动。

4、启动服务

两种方式,

1)如下 /etc/init.d/httpd start

2)如下

service httpd start

5、查看服务是否正常启动

两种方式,

1)查看服务状态

<pre style="box-sizing: border-boxfont-family: Monaco, Menlo, Consolas, "Courier New", monospacefont-size: 12pxwhite-space: pre-wrapdisplay: blockpadding: 9.5pxmargin: 0px 0px 10pxline-height: 1.38462color: rgb(51, 51, 51)word-break: break-alloverflow-wrap: break-wordbackground-color: rgb(245, 245, 245)border: 1px solid rgb(204, 204, 204)border-radius: 4pxfont-style: normalfont-variant-ligatures: normalfont-variant-caps: normalfont-weight: 400letter-spacing: normalorphans: 2text-align: starttext-indent: 0pxtext-transform: nonewidows: 2word-spacing: 0px-webkit-text-stroke-width: 0pxtext-decoration-thickness: initialtext-decoration-style: initialtext-decoration-color: initial">[root@istester www]# service httpd status

httpd (pid 10339) is running...</pre>

2)查看进程

<pre style="box-sizing: border-boxfont-family: Monaco, Menlo, Consolas, "Courier New", monospacefont-size: 12pxwhite-space: pre-wrapdisplay: blockpadding: 9.5pxmargin: 0px 0px 10pxline-height: 1.38462color: rgb(51, 51, 51)word-break: break-alloverflow-wrap: break-wordbackground-color: rgb(245, 245, 245)border: 1px solid rgb(204, 204, 204)border-radius: 4pxfont-style: normalfont-variant-ligatures: normalfont-variant-caps: normalfont-weight: 400letter-spacing: normalorphans: 2text-align: starttext-indent: 0pxtext-transform: nonewidows: 2word-spacing: 0px-webkit-text-stroke-width: 0pxtext-decoration-thickness: initialtext-decoration-style: initialtext-decoration-color: initial">[root@istester www]# ps -ef|grep httpd | grep -v grep

root 10339 1 0 23:15 ?00:00:00 /usr/sbin/httpd

apache 10341 10339 0 23:15 ?00:00:00 /usr/sbin/httpd

apache 10342 10339 0 23:15 ?00:00:00 /usr/sbin/httpd

apache 10343 10339 0 23:15 ?00:00:00 /usr/sbin/httpd

apache 10344 10339 0 23:15 ?00:00:00 /usr/sbin/httpd

apache 10345 10339 0 23:15 ?00:00:00 /usr/sbin/httpd

apache 10346 10339 0 23:15 ?00:00:00 /usr/sbin/httpd

apache 10347 10339 0 23:15 ?00:00:00 /usr/sbin/httpd

apache 10348 10339 0 23:15 ?00:00:00 /usr/sbin/httpd</pre>

补充,

1)停止服务

service httpd stop

2)重启服务

service httpd restart

6、安装之后的说明:

1)验证是否安装成功

现在打开 http://ip 地址,看看有没有Apache的默认页面出来了?如果有就对了。

2)安装目录说明

Apache默认将网站的根目录指向 /var/www/html

默认的主配置文件是 /etc/httpd/conf/httpd.conf

配置存储在的/etc/httpd/conf.d/目录

End

文 / IDO老徐


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/tougao/12430943.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-25
下一篇 2023-05-25

发表评论

登录后才能评论

评论列表(0条)

保存