linux 服务器部署 lnamp 二apache安装
来源:互联网 发布:构建高性能java服务器 编辑:程序博客网 时间:2024/06/07 17:03
一、yum安装
yum -y
install
httpd
二、编译安装
官方教程:http://httpd.apache.org/docs/2.4/install.html
1.下载
wget http://apache.fayea.com//httpd/httpd-2.4.27.tar.gztar xvzf httpd-2.4.25.tar.gzcd httpd-2.4.25
2../configure 报错
checking for APR... noconfigure: error: APR not found. Please read the documentation.需要安装三个依赖库:pcre,apr,apr-util
3.安装pcre perl的正则库wget https://ftp.pcre.org/pub/pcre/pcre-8.40.tar.gztar xvzf pcre-8.40.tar.gzcd pcre-8.40./configure --prefix=/usr/local/pcremake make install如果报错:configure: error: You need a C++ compiler for C++ support.还需要安装gcc –c++yum install -y gcc gcc-c++4.安装apr/apr-util有两种方式:a:各自编译,然后http编译时参数适用wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.5.2.tar.gztar xvzf apr-1.5.2.tar.gzcd apr-1.5.2./configure –prefix=/usr/local/apr报错:rm: cannot remove 'libtoolT': No such file or directoryvim configure文件,查找30206行, $RM "$cfgfile" 这个地方,用#注释掉继续./configure –prefix=/usr/localmakemake installwget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.5.4.tar.gztar xzvf apr-util-1.5.4.tar.gzcd apr-util-1.5.4./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-configmake make install对应http编译配置./configure --prefix=/lnamp/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcremakemake installb.将代码拷贝至http源码目录wget http://mirror.bit.edu.cn/apache//apr/apr-1.5.2.tar.gztar xvzf apr-1.5.2.tar.gzmv apr-1.5.2 aprwget http://mirror.bit.edu.cn/apache//apr/apr-util-1.5.4.tar.gztar xzvf apr-util-1.5.4.tar.gzmv apr-util-1.5.4 apr-utilmv apr apr-util /lnamp/src/httpd-2.4.25/srclib/5.编译(使用将apr和apr-util拷至Apache内部方法,–-with-included-apr,是指使用上面b方法)./configure –-prefix=/lnamp/apache2 –-with-pcre=/usr/local/pcre/bin/pcre-config –-with-included-aprmakemake install报错:xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory #include <expat.h> ^compilation terminated.make[3]: *** [xml/apr_xml.lo] Error 1make[3]: Leaving directory `/opt/src/httpd-2.4.27/srclib/apr-util'make[2]: *** [all-recursive] Error 1make[2]: Leaving directory `/opt/src/httpd-2.4.27/srclib/apr-util'make[1]: *** [all-recursive] Error 1make[1]: Leaving directory `/opt/src/httpd-2.4.27/srclib'make: *** [all-recursive] Error 1yum install expat-devel
6.启动apache/lnamp/apache2/bin/apachectl -f /lnamp/apache2/conf/httpd.conf可能需要修改http.conf将里面的 #ServerName localhost:80 注释去掉即可。成功提示 httpd (pid ***) already running停止apache/lnamp/apache2/bin/apachectl –k stop7.配置文件1.支持php http.conf添加 AddType application/x-httpd-php .php
2.添加重写 mod_rewrite去掉注释
3.http.conf最后添加 Include /www/vhosts/*.conf
8.网站conf文件简单编写<VirtualHost *:80>ServerName poetnote.comDocumentRoot "/var/www/poetnote/public"SetEnv APPLICATION_ENV "development"<Directory "/var/www/poetnote/public">DirectoryIndex index.phpAllowOverride AllRequire all granted</Directory></VirtualHost>9.网站conf文件,python,django使用<VirtualHost *:80>ServerName sports.poetnote.com#ServerAlias otherdomain.comServerAdmin ghoiufyia@163.com Alias /media/ /var/www/sports/media/ Alias /static/ /var/www/sports/static/ <Directory /var/www/sports/media/> Require all granted</Directory><Directory /var/www/sports/static/>Require all granted </Directory> WSGIScriptAlias / /var/www/sports/sports/wsgi.py# WSGIDaemonProcess ziqiangxuetang.com python-path=/home/tu/blog:/home/tu/.virtualenvs/blog/lib/python2.7/site-packages# WSGIProcessGroup ziqiangxuetang.com <Directory /var/www/sports/sports/><Files wsgi.py/>Require all granted</Files> </Directory></VirtualHost>
成功提示 httpd (pid ***) already running停止apache/lnamp/apache2/bin/apachectl –k stop
阅读全文
0 0
- linux 服务器部署 lnamp 二apache安装
- linux 服务器部署 lnamp 一nginx安装
- linux 服务器部署 lnamp 三、php安装
- linux 服务器部署 lnamp 四、mysql
- 一键安装LNAMP(Linux+Nginx前端+Apache后端+PHP)
- [LNAMP]Linux+Apache+Nginx+MySQL+PHP纯手动安装编译
- PHP web服务器终极解决方案:CentOS v6.x Minimal 32bit + LNAMP 一键安装包【Linux+Nginx+Apache+MySQL+PHP+phpMyAdmin】
- LNAMP Linux+Apache+Nginx+MySQL+PHP
- svn+apache+linux安装部署
- Linux下安装Apache服务器
- Linux-CentOS安装Apache服务器
- linux手动安装apache服务器
- linux下安装apache服务器
- linux下安装apache服务器
- linux 安装apache静态服务器
- 资源分享-教程:linux下安装lnamp环境
- Linux服务器上安装部署Tomcat服务器
- LNAMP安装CentOS7.0
- android开发工具默认安装路径
- 文件名匹配扩展名,允许后面带数字
- 密码学
- OGNl表达式的总结
- SourceInsight 4.0如何设置相对路径
- linux 服务器部署 lnamp 二apache安装
- 86. Partition List
- banner轮播器
- C# EXCEL 操作
- springboot与redis整合案例(上)
- [知识池]彻底了解设计模式(系列二)
- js 中的 !!什么意思
- C#的输入、输出与运算符、数据类型
- D的小L