当前位置: 首页 > 工具软件 > Apache2::ASP > 使用案例 >

apache2: 安装和配置

张通
2023-12-01

LAMP:linux+apache+mysql+php

LNMP:linux+nginx+mysql+php


apacheweb服务器,依賴php,就像windowsIIS依赖ASP


nginxhttp和反向代理服务器,也是IMAP/POP3/SMTP代理服务器.


##############################################

apache安装和配置:


直接安装:

sudoapt-get install apache2

修改配置在web测试

/etc/apache2/apache2.conf

ServerName localhost:80


安装包安装:

apache2改名httpd,依赖aprapr-utilpcre


安装aprapr-util

cpapr apr-util httpd/srclib

cdhttpd/srclib/apr

./configure --prefix=/usr/local/apr

make

makeinstall


cdhttpd/srclib/apr-util

./configure --prefix=/usr/local/apr-util

--with-apr=/usr/local/apr

make

makeinstall


安装pcre

cdpcre

./configure --prefix=/usr/local/pcre

make

makeinstall


安装apache:

./configure --prefix=/usr/local/apache2

--with-apr=/usr/local/apr

--with-apr-util=/usr/local/apr-util

--with-pcre=/usr/local/pcre

make

makeinstall


更改配置:

sudovi /usr/local/apache2/conf/httpd.conf

ServerName localhost:80


启动服务:

/usr/local/apache2/bin/apachectl–k start/stop/restart


web测试:

http://localhost:80


web页面在/usr/local/apache2/htdocs/


很多应用依赖apache,需要根据需要修改配置即可.

直接安装的配置文件是: /etc/apache2/apache2.conf

手动安装的配置文件是: /usr/local/conf/httpd.conf


 类似资料: