Linux上安装Apache与问题说明
2014-11-13 16:21
344 查看
下载Apache包,这里下载后和Windows不一样,需要编译和安装:
http://httpd.apache.org/ Apache Apache httpd 2.4.9 Released
下载:httpd-2.4.9.tar.gz
解压:
进入:
安装目录:
配置:
编译:
安装:
启动与停止:
/usr/local/apache2/bin/apachectl start apaceh启动
/usr/local/apache2/bin/apachectl stop 停止
/usr/local/apache2/bin/apachectl restart 重启
如果遇到无法停止httpd服务的情况,使用命令:
一般商用服务器都是由专门供应商来维护的,所以不用担心gcc的问题,但是如果你想测试却没有安装gcc,可以参考:
Rehat5 安装 GCC http://cuisuqiang.iteye.com/blog/1711153
如果你在安装中还遇到了configure: error: APR not found的错误,可以参考:
Apache安装问题:configure: error: APR not found . Please read the documentation http://cuisuqiang.iteye.com/blog/2068794
如果你没有安装FTP导致不能上传文件,可以参考:
Linux 下FTP搭建 http://cuisuqiang.iteye.com/blog/846521
或者安装SSH Secure来解决这个问题
如果遇到如下问题:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 117.135.131.19. Set the 'ServerName' directive globally to suppress this message
这和conf/httpd.conf配置文件内的ServerName有关
这里把ServerName放开,写ServerName localhost:80即可
如果在集群中传递的参数到后台是乱码,可以注意以下几点:
1:页面用的什么编码 JSP的 pageEncoding="UTF-8"
2:Tomcat用的什么编码 Connector中有定义编码的参数
3:集群中如果使用AJP了,AJP使用的什么编码 <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" useBodyEncodingForURI="true" URIEncoding="UTF8" />
4:Apache使用的什么编码 http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html#indexoptions
如果你遇到了服务无法启动的情况,也不报错的,查看logs下的日志,首次安装报错如下:
AH01177: Failed to lookup provider 'shm' for 'slotmem': is mod_slotmem_shm loaded??
我想日志已经说的很清楚了,这里编译安装后,配置文件conf/httpd.conf没有开启mod_slotmem_shm模块,编辑该文件,放开
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
访问http://IP:8008/ 输出It works!
请您到ITEYE网站看 java小强 原创,谢谢!
http://cuisuqiang.iteye.com/!
自建博客地址:http://www.javacui.com/ ,内容与ITEYE同步!
http://httpd.apache.org/ Apache Apache httpd 2.4.9 Released
下载:httpd-2.4.9.tar.gz
解压:
tar –zxvf httpd-2.4.9.tar.gz
进入:
cd tar –zxvf httpd-2.4.9
安装目录:
mkdir /usr/local/apache2
配置:
./configure --prefix=/usr/local/apache2 --enable-so -enable-proxy -enable-proxy_http=shared--enable-module=so --enable-mods-shared=all --enable-proxy-ajp=shared --enable-proxy-balancer -with-mpm=worker --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre
编译:
make
安装:
make install
启动与停止:
/usr/local/apache2/bin/apachectl start apaceh启动
/usr/local/apache2/bin/apachectl stop 停止
/usr/local/apache2/bin/apachectl restart 重启
如果遇到无法停止httpd服务的情况,使用命令:
killall -9 httpd
一般商用服务器都是由专门供应商来维护的,所以不用担心gcc的问题,但是如果你想测试却没有安装gcc,可以参考:
Rehat5 安装 GCC http://cuisuqiang.iteye.com/blog/1711153
如果你在安装中还遇到了configure: error: APR not found的错误,可以参考:
Apache安装问题:configure: error: APR not found . Please read the documentation http://cuisuqiang.iteye.com/blog/2068794
如果你没有安装FTP导致不能上传文件,可以参考:
Linux 下FTP搭建 http://cuisuqiang.iteye.com/blog/846521
或者安装SSH Secure来解决这个问题
如果遇到如下问题:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 117.135.131.19. Set the 'ServerName' directive globally to suppress this message
这和conf/httpd.conf配置文件内的ServerName有关
# ServerName gives the name and port that the server uses to identify itself. # This can often be determined automatically, but we recommend you specify # it explicitly to prevent problems during startup. # # If your host doesn't have a registered DNS name, enter its IP address here. # #ServerName www.example.com:80
这里把ServerName放开,写ServerName localhost:80即可
如果在集群中传递的参数到后台是乱码,可以注意以下几点:
1:页面用的什么编码 JSP的 pageEncoding="UTF-8"
2:Tomcat用的什么编码 Connector中有定义编码的参数
3:集群中如果使用AJP了,AJP使用的什么编码 <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" useBodyEncodingForURI="true" URIEncoding="UTF8" />
4:Apache使用的什么编码 http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html#indexoptions
如果你遇到了服务无法启动的情况,也不报错的,查看logs下的日志,首次安装报错如下:
AH01177: Failed to lookup provider 'shm' for 'slotmem': is mod_slotmem_shm loaded??
我想日志已经说的很清楚了,这里编译安装后,配置文件conf/httpd.conf没有开启mod_slotmem_shm模块,编辑该文件,放开
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
访问http://IP:8008/ 输出It works!
请您到ITEYE网站看 java小强 原创,谢谢!
http://cuisuqiang.iteye.com/!
自建博客地址:http://www.javacui.com/ ,内容与ITEYE同步!
相关文章推荐
- Linux下apache 2.2.6+php5.2.5+mysql5.0.46+Zend Optim安装详细说明
- Linux下Apache安装64位问题
- Linux安装apache环境及遇到的问题解决
- 关于Linux下安装Oracle时报错:out of memory的问题分析说明
- 关于Linux下安装Oracle时报错:out of memory的问题分析说明
- 首发:Linux+Apache+PHP+MySQL+Zend Optimizer+PHPMyAdmin安装及常见问题
- Redhat Enterprise Linux Advanced Server 4上安装MYSQL+APACHE+PHP+ZEND问题
- linux下 安装apache ,php等问题
- linux安装apache过程中注意的问题
- Linux下安装apache遇到的一些问题
- Linux下安装apache可能遇到的问题总结
- Apache2.2.17+PHP5.2.5+MySQL5安装说明配置遇到问题解决笔记
- [转]linux+php5.1.6+mysql5.0.2+apache2.0.55安装配置说明
- 在64位linux系统下载安装apache的问题
- linux下apache安装后403问题的解决办法
- linux 源码安装apache PHP palin txt phpinfo 问题
- 玩转Linux之Apache服务器的安装及相关问题处理方案
- 【Linux】由telnet实验引发的安装Apache问题
- linux问题-kali中安装apache和CGI
- linux下 Apache mysql python mod_python Django 配置安装说明,绝对可以安装上的说明