当前位置:首页 » 操作系统 » linuxhttpd安装

linuxhttpd安装

发布时间: 2022-11-22 03:39:54

① 怎么在linux下安装apache服务器

解决方法: 安装准备工作 登录linux(root/123456) 利用netconfig命令设置IP地址等信息 (1)——设置IP、子网掩码、网关、主DNS (2)——service network restart 重启网络服务使修改生效 也可以通过修改文件进行设置 vi /etc/sysconfig/network-scripts/ifcfg-eth0 设置IPADDR=IP地址,NETMASK=掩码,ONBOOT=YES,启动时启动网卡 vi /etc/resolv.conf 设置DNS 设置完成后通过ifconfig命令可以查看当前系统的网络信息 通过SecurCRT工具链接到linux下 通过Zmodem Upload List添加需要从本地传输到linux下的文件,然后执行Start Zmodem Upload启动传输。 APACHE的安装 [root@sugar ~]# gzip -d httpd-2.2.4.tar.gz[root@sugar ~]# tar xvf httpd-2.2.4.tar [root@sugar ~]# cd httpd-2.2.4 [root@sugar ~]# ./configure [root@sugar ~]# make [root@sugar ~]# make install apache默认安装路径:/usr/local/apache2 /usr/local/apache2下面关键目录说明 conf :apache服务器的配置目录 htdocs: 需要发布应用程序的目录 bin : apache服务器的可执行程序目录 apache的配置修改 [root@sugar ~]# vi /usr/local/apache2/conf/httpd.conf 将#ServerName :80 中的“#”删掉,并将 改为本机的linux的ip地址 apache服务安装检测 apache安装是否成功的检测 启动apache服务 说明:apache服务的启动和停止 [root@sugar ~]# cd /usr/local/apache2/bin [root@sugar ~]# ./apachectl stop 这是停止apache服务 [root@sugar ~]# ./apachectl start 这是启动apache服务 在window平台通过ie访问linux上面apache的测试页面, your_linux_ip/ 如图所示 如果出现it works字样,说明apache安装成功

② 15.Linux下Apache rpm包安装方法,并解决依赖性问题(附自动启动方法)

1.修改虚拟机设置,按下图所示

2.挂载镜像文件,如果报错,有可能是因为上面的 已连接 忘记打钩了。

1.必须先进入到rpm的包文件中

2.安装httpd包

可以查询出httpd包的全名,根据包全名开始安装

3.安装时发生错误,报错显示有依赖性,所以先安装被依赖的包apr-util-ldap

4.安装apr-util-ldap也发生依赖错误,所以先安装apr-util

5.安装apr-util发生模块依赖错误,在模块依赖查询网站查询此模块所在的软件包,

6.先安装上面模块所在的软件包,成功

7.再回到第5步,来安装apr-util成功

8.apr-util安装成功后,回到第4步,安装apr-util-ldap,成功

9.apr-util-ldap安装成功后,回到第2步,安装httpd,仍发生依赖错误。

10.继续安装依赖的软件包httpd-tools

11.httpd-tools安装成功,回到第2步,尝试安装httpd。终于成功

截止此时,Apache的主要功能已经安装成功。

但是,缺少其他组件,Apache功能还不完善,所以接着安装它的其他组件

1.安装httpd-devel

2.安装httpd-manual

2.成功,至此全部安装成功

3.查询是否安装

查询系统中安装的所有有httpd关键字的软件包

成功后,卸载ISO镜像

③ Linux服务器Apache怎么安装

解决方法:
安装准备工作
登录linux(root/123456)
利用netconfig命令设置IP地址等信息
(1)——设置IP、子网掩码、网关、主DNS
(2)——service network restart 重启网络服务使修改生效
也可以通过修改文件进行设置
vi /etc/sysconfig/network-scripts/ifcfg-eth0 设置IPADDR=IP地址,NETMASK=掩码,ONBOOT=YES,启动时启动网卡 vi /etc/resolv.conf 设置DNS

设置完成后通过ifconfig命令可以查看当前系统的网络信息

通过SecurCRT工具链接到linux下

通过Zmodem Upload List添加需要从本地传输到linux下的文件,然后执行Start Zmodem Upload启动传输。

APACHE的安装
[root@sugar ~]# gzip -d httpd-2.2.4.tar.gz[root@sugar ~]# tar xvf httpd-2.2.4.tar
[root@sugar ~]# cd httpd-2.2.4
[root@sugar ~]# ./configure
[root@sugar ~]# make
[root@sugar ~]# make install

apache默认安装路径:/usr/local/apache2
/usr/local/apache2下面关键目录说明
conf :apache服务器的配置目录
htdocs: 需要发布应用程序的目录
bin : apache服务器的可执行程序目录
apache的配置修改

[root@sugar ~]# vi /usr/local/apache2/conf/httpd.conf
将#ServerName www.example.com:80 中的“#”删掉,并将 www.example.com 改为本机的linux的ip地址

apache服务安装检测
apache安装是否成功的检测
启动apache服务
说明:apache服务的启动和停止
[root@sugar ~]# cd /usr/local/apache2/bin

[root@sugar ~]# ./apachectl stop 这是停止apache服务
[root@sugar ~]# ./apachectl start 这是启动apache服务

在window平台通过ie访问linux上面apache的测试页面,
http://your_linux_ip/ 如图所示

如果出现it works字样,说明apache安装成功

④ linux用RPM安装HTTPD

rpm -ivh httpd-(要求全名) 在目录下把名字补齐就行了
rpm -e httpd 卸载

⑤ 如何 在Redhat Linux 系统上安装和配置apache 服务器

下载安装就不说了,
配置
apache
2.0的主配置文件为httpd.conf。以rpm包方式安装则配置文件保存在/etc/httpd/conf/目录下。可以直接修改httpd.conf文件也可以用redhat
linux自带的图形化工具来配置。打开启动程序->系统设置->服务器设置->http服务器
port
80
#定义了web服务器的侦听端口,默认值为80
user
apache
#一般情况下,以nobody用户和nobody组来运行web服务器
serveradmin
root@localhost
#指定服务器管理员的e-mail地址。服务器自动将错误报告到该地址。
serverroot
/etc/httpd
#服务器的根目录,一般情况下,所有的配置文件在该目录下
maxkeepaliverequests
100
#永久连接的http请求数
maxclients
150
#同一时间连接到服务器上的客户机总数
errorlog
logs/error_log
#用来指定错误日志文件的名称和路径
pidfile
run/httpd.pid
#用来存放httpd进程号,以方便停止服务器。
timeout
300
#设置请求超时时间,若网速较慢则应把值设大。
documentroot
/var/www/html
#用来存放网页文件

⑥ Centos 下Apache(httpd) 安装过程

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

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

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-box; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; white-space: pre-wrap; display: block; padding: 9.5px; margin: 0px 0px 10px; line-height: 1.38462; color: rgb(51, 51, 51); word-break: break-all; overflow-wrap: break-word; background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); border-radius: 4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-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-box; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; white-space: pre-wrap; display: block; padding: 9.5px; margin: 0px 0px 10px; line-height: 1.38462; color: rgb(51, 51, 51); word-break: break-all; overflow-wrap: break-word; background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); border-radius: 4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">#先检查文件在哪
find / -name httpd.conf

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

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

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

1)检查是否存在httpd包

<pre style="box-sizing: border-box; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; white-space: pre-wrap; display: block; padding: 9.5px; margin: 0px 0px 10px; line-height: 1.38462; color: rgb(51, 51, 51); word-break: break-all; overflow-wrap: break-word; background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); border-radius: 4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-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-box; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; white-space: pre-wrap; display: block; padding: 9.5px; margin: 0px 0px 10px; line-height: 1.38462; color: rgb(51, 51, 51); word-break: break-all; overflow-wrap: break-word; background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); border-radius: 4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Total 20 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_64 3/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_64 2/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-box; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; white-space: pre-wrap; display: block; padding: 9.5px; margin: 0px 0px 10px; line-height: 1.38462; color: rgb(51, 51, 51); word-break: break-all; overflow-wrap: break-word; background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); border-radius: 4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">[root@istester www]# service httpd status
httpd (pid 10339) is running...</pre>

2)查看进程

<pre style="box-sizing: border-box; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; white-space: pre-wrap; display: block; padding: 9.5px; margin: 0px 0px 10px; line-height: 1.38462; color: rgb(51, 51, 51); word-break: break-all; overflow-wrap: break-word; background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); border-radius: 4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-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老徐

⑦ 如何在Linux下搭建apache服务器

一:准备工作在安装httpd之前必须要配置好DNS服务二Httpd安装Apache的主要步骤如下:1. 解包tar zxvf httpd-2.2.9.tar.gz -C /usr/src/
2. 编译前的配置cd /usr/src/httpd-2.2.9./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite这一步是根据你的特定平台和个人需求配置源代码树。位于发行源代码根目录的configure脚本会完成这个步骤(对下载Apache CVS版源代码的开发者,需要装有autoconf和libtool ,并需要执行buildconf ,对于官方的发行版则没这个必要)。 要想用所有的默认值配置源代码树只要简单的执行 ./configure 命令就可以了,同时configure还可以接受命令行参数以改变默认值。 最重要的选项是Apache安装目录的前缀:--prefix ,因为Apache需要知道这个目录才能正常运作。更多的微调选项请参考配置选项详解。 这样,你就可以通过在配置选项中指定要启用或禁用哪些模块来定制Apache的特性。Base组的模块默认包含在Apache中。其他组的模块可以通过 --enable-mole 指令启用。其中mole是模块名去掉"mod_"并将下划线转换成连字符后的字符串。你也可以使用 --enable-mole=shared 指令将模块编译为可在运行时加载和卸载的动态共享对象(DSO)。同样的,你也可以使用 --disable-mole 指令禁用Base组的模块。注意,使用这些指令的时候configure不会对你拼写错误的模块发出警告说找不到某某模块,而只是简单的忽略这个选项。 另外,有时候还必须提供给configure脚本关于编译器、库、头文件位置的更多信息。这些可以通过环境变量或者命令行选项传递给configure脚本。要了解更多信息,请参考配置源代码树。 为了让你对能指定什么有一个简单的印象,此例演示编译Apache ,并将其安装在/sw/pkg/apache目录,指定了一个特定的编译器以及编译参数,而且允许今后将两个附加的模块mod_rewrite和mod_speling通过DSO机制在运行时动态加载: $ CC="pgcc" CFLAGS="-O2" \./configure --prefix=/sw/pkg/apache \--enable-rewrite=shared \--enable-speling=shared configure需要运行几分钟,以测试指定的功能在你的系统中是否有效,并建立稍后编译时所需的许多Makefile文件。 3. 编译并安装make && make install

⑧ 如何在linux上安装apache

由于它们使用的套件管理方式不同(如Debian的pkg和Redhat的rpm)所以Apache在不同系统的安装方法不尽相同,但由于RPM文件在Linux系统中的安装最为简便,Fedora 、Redhat、Mandriva、SuSE、YellowDog等主流发行版本都使用rpm包管理方式,在这里就说一下Redhat中Apache的安装方法:
1.首先使用下面的命令检查系统是否已经安装了Apache或查看已经安装了何种版本:rpm -q httpd
2.要安装Apache,应将Red Hat安装盘中有Apache RPM安装包的那张放入光驱,加载光驱(别忘了)后在光盘Server目录下找到Apache的RPM安装包文件httpd-2.2.3-6.el5.i386.rpm,可使用下面命令安装Apache: rpm -ivh /mnt/Server/httpd-2.2.3-6.el5.i386.rpm
3.然后测试Apache服务器执行“/etc/init.d/httpd start”命令,确认Web服务已经启动后,在客户端使用的Web浏览器中输入Linux服务器的IP地址进行访问,如果出现一个Red Hat的测试页面则安装成功
下面来配置服务器:
httpd.conf(在/etc/httpd/conf目录下)配置文件主要由全局环境(Section 1: Global Environment)、主服务器配(Section 2: 'Main' server configuration)和虚拟主机(Section 3: Virtual Hosts)3个部分组成。部分都有相应的配置语句,该文件所有配置语句的语法为“配置参数名称 参数值”的形式,配置语句可以放在文件中的任何地方,但为了增强文件的可读性,最好将配置语句放在相应的部分。httpd.conf中每行包含一条语句,行末使用反斜杠“\”可以换行,但是反斜杠与下一行中间不能有任何其他字符(包括空白)。httpd.conf的配置语句除了选项的参数值以外,所有选项指令均不区分大小写,可以在每一行前用“#”号表示注释。
1.设置主目录的路径DocumentRoot "/var/www/html“
2.设置默认文档DirectoryIndex index.html index.html.var
3.设置Apache监听的IP地址和端口号Listen 80
4.设置相对根目录的路径ServerRoot "/etc/httpd“
5.设置日志文件
(1)错误日志ErrorLog logs/error_log
(2)访问日志CustomLog logs/access_log combined
6.设置网络管理员的E-mail地址ServerAdmin [email protected]
7.设置服务器主机名称ServerName 192.168.16.177:80
8.设置默认字符集AddDefaultCharset UTF-8,由于西欧(UTF-8)是Apache的默认字符集,因此当客户端访问服务器的中文网页时会出现乱码的现象 ,解决的办法是将语句“AddDefaultCharset UTF-8”改为“AddDefaultCharset GB2312”,然后重新启动Apache服务,中文网页就能正常显示了 。
9.使用Alias选项可以创建虚拟目录。 如创建名为/down的虚拟目录,它对应的物理路径是“/software/download”命令为Alias /down "/software /download"
10.可以使用和这对语句为主目录或虚拟目录设置权限,这些语句仅对被设置目录及其子目录起作用,目录的特性选项在下面的图中会出现。如

Options Indexes MultiViews
AllowOverride NoneOrder allow,deny

热点内容
内置存储卡可以拆吗 发布:2025-05-18 04:16:35 浏览:332
编译原理课时设置 发布:2025-05-18 04:13:28 浏览:372
linux中进入ip地址服务器 发布:2025-05-18 04:11:21 浏览:607
java用什么软件写 发布:2025-05-18 03:56:19 浏览:27
linux配置vim编译c 发布:2025-05-18 03:55:07 浏览:101
砸百鬼脚本 发布:2025-05-18 03:53:34 浏览:935
安卓手机如何拍视频和苹果一样 发布:2025-05-18 03:40:47 浏览:734
为什么安卓手机连不上苹果7热点 发布:2025-05-18 03:40:13 浏览:799
网卡访问 发布:2025-05-18 03:35:04 浏览:506
接收和发送服务器地址 发布:2025-05-18 03:33:48 浏览:368