(本文出自yangjj ^_^)
前提:
1.没联网,yum挂。
2.至少要有GCC,要不玩个屁。
3.你有充足的咖啡并且有几个小时时间不想打dota。
4.你要做集群。
以上条件不满足其一,看到这里就谢谢了。
占位符:

======关于APACHE安装和配置======
--离线包解压并进入解压后文件夹
tar -zvxf httpd-2.2.25.tar
cd httpd-2.2.25
./configure \
--enable-mods-shared=max \
--enable-module=most \
--with-mpm=prefork \
--enable-ext-filter \
--enable-file-cache \
--enable-suexec \
--enable-cache \
--enable-disk-cache \
--enable-mem-cache \
--enable-file-cache \
--enable-suexec \
--enable-ext-filter \
--enable-so \
--enable-headers \
--enable-rewrite \
--enable-proxy \
--enable-proxy-connect \
--enable-proxy-http \
--enable-proxy-balancer
--这里配置apache代理和反向代理不用这个也成
--enable-deflate \
--报错 error: mod_deflate has been requested but can not be built due to prerequisite failures,那是没有安装zlib包
yum install zlib-deve
--不指定路径默认在/usr/local/apache2
--指定路径加参数 --prefix=/usr/local/^$&#你特立独行的路径/
--如果configure失败又手贱make,可能导致make失败,最好
make clean
ldconfig
--重新configure成功后再make
make
make install
--完成之后在/usr/local/apache2/bin下
./httpd -l
--查看httpd的模块
Compiled in modules:
core.c
mod_authn_file.c
mod_authn_default.c
mod_authz_host.c
mod_authz_groupfile.c
mod_authz_user.c
mod_authz_default.c
mod_auth_basic.c
mod_file_cache.c
mod_cache.c
mod_disk_cache.c
mod_mem_cache.c
mod_ext_filter.c
mod_include.c
mod_filter.c
mod_log_config.c
mod_env.c
mod_headers.c
mod_setenvif.c
mod_version.c
mod_proxy.c
mod_proxy_connect.c
mod_proxy_ftp.c
mod_proxy_http.c
mod_proxy_scgi.c
mod_proxy_ajp.c
mod_proxy_balancer.c
prefork.c
http_core.c
mod_mime.c
mod_status.c
mod_autoindex.c
mod_asis.c
mod_suexec.c
mod_cgi.c
mod_negotiation.c
mod_dir.c
mod_actions.c
mod_userdir.c
mod_alias.c
mod_rewrite.c
mod_so.c
--这几个没有就fuck up了!
service httpd status
--如果报错并且通过
chkconfig --list httpd
--检查不是系统服务
--则添加httpd为系统服务
chkconfig --add httpd
chkconfig httpd on
--如果添加系统服务报错:service httpd does not support chkconfig
--直接用安装的httpd配置覆盖rd.d/init.d的httpd
cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd
--之后
vi /etc/rc.d/init.d/httpd
--#!/bin/sh后加上
# chkconfig: 2345 10 90
# description: Activates/Deactivates Apache Web Server
--如果apache启动报错(98)Address already in use: make_sock: could not bind to address [::]:80
ps -ef|grep httpd
--或者(前提是你没改过httpd端口)
lsof -i:80
--kill掉
--如果报如下错误
--httpd: apr_sockaddr_info_get() failed for ckstmis-app2
--httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
vi /usr/local/apache2/conf/httpd.conf
--屁股加上
ServerName localhost:
--最后通过curl访问it works(没有GUI,没有内网可视化远程桌面的苦逼)
======关于APACHE代理和反向代理云云======
--简单的配置修改,针对httpd.conf(/usr/local/apache2,即安装目录下的)
--将apache监听端口改成nat的内网端口
Listen 8080
--屁股增加反向虚拟主机include文件
# Virtual hosts
Include conf/httpd-vhosts.conf
--原配置及说明按需参考
--简单代理配置:
Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED
<Proxy balancer://mycluster>
ProxySet stickysession=ROUTEID
</Proxy>
--稍复杂反向代理配置
Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; " env=BALANCER_ROUTE_CHANGED
<Proxy balancer://cluster名>
Order deny,allow
Allow from all
BalancerMember ajp://ip1:偏移端口 route=节点名称1:工程路径
BalancerMember ajp://ip2:偏移端口 route=节点名称2:工程路径
ProxySet stickysession=ROUTEID
</Proxy>
<VirtualHost *:8080>
Timeout 7200
ProxyRequests Off
ProxyPass /工程路径 balancer://cluster名/工程路径
ProxyPassReverse /工程路径 balancer://cluster名/工程路径/
#反向代理的最后的/ 最好加下,网评不一,加了肯定不会挂
ProxyPreserveHost On
#KeepAliveTimeout 500
#MaxKeepAliveRequests 200
#ProxyPassReverseCookiePath / /
</VirtualHost>
- [转] Ubuntu 12.04下LAMP安装配置 (Linux+Apache+Mysql+PHP)
我是一个Linux新手,想要安装一台Ubuntu 12.04版的Linux服务器,用这台服务器上的LAMP套件来运行我自己的个人网站.LAMP套件就是 “Linux+Apache+Mysql+PHP这 ...
- 在linux下的apache配置https协议,开启ssl连接
环境:linux 配置https协议,需要2大步骤: 一.生成服务器证书 1.安装openssl软件 yum install -y openssl mod_ssl 2.生成服务器私匙,生成server ...
- window下为apache配置ssl证书
转载自 子非鱼 的博客稍作修改 第一步:依赖 配置Apache服务器支持https协议和SSL证书,最基本的要求是Apache包含openssl模块.还好apache/bin目录下有libeay32. ...
- 虚拟机lamp环境下,Apache配置虚拟主机
1.在Apache配置文件中开启虚拟主机功能:即:Include etc//extra/httpd-vhosts.conf把前面的#去掉: 2.在extra目录下找到文件httpd-vhosts.co ...
- windows下的pycharm配置 linux环境
由于最近学习python的需要,为了方便程序的调试,尝试在Windows下的Pycharm远程连接到虚拟机中Centos下的python环境.(这里我采用的是ssh的远程连接)1.准备工作: 固定ce ...
- win10下关于apache配置虚拟主机
apache安装完默认是不开启虚拟服务器的,如果希望在本地apache上面配置虚拟服务器,类似于在网上买的虚拟主机,可以按照以下步骤进行配置: 1,修改本机的hosts文件,如下 示例:127.0.0 ...
- CentOS下的apache配置支持php
修改Apache的配置文件httpd.conf(vi /etc/httpd/conf/httpd.conf) DirectoryIndex index.html index.php #添加index. ...
- Apache配置域名
Apache配置域名 在WIN下安装APACHE配置虚拟目录和UNIN下基本是一样的就是修改httpd.conf1:单个IP对应单个域名例如:www.phpunion.com对应192.168.1.1 ...
- apache 配置防盗
防盗链目的:防止其他网站盗用自己的网站而增加额外的流量损失 SetEnvIfNoCase Referer "^http://.*\.yourdomin\.com" local_re ...
随机推荐
- strtok的基本使用方法
理论知识自己能够百度这里直接上代码 代码的内容是 HDU(杭电)-1106-排序 排序 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 655 ...
- Git 环境设置(安装)
在使用Git之前,必须安装它,并做一些基本配置的变化.下面是步骤在Ubuntu和CentOS Linux安装 Git 客户端. Git客户端安装 如果使用的是GNU/ Linux 发行版Debian基 ...
- 【C】——setvbuf(scanf内存溢出问题)
下面设置了一个长度为20的缓存区,循环对value进行赋值并输出: #include<stdio.h> #define BUFSIZE 20 int main(int argc, char ...
- m2e-wtp error: <path>/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF (No such file or directory)
错误信息: D:\workspace\eclipse\xinfubao\xfb-mgr\target\m2e-wtp\web-resources\META-INF\MANIFEST.MF (系统找不到 ...
- 安卓程序代写 网上程序代写[原]BluetoothDevice详解
一. BluetoothDevice简介 1. 继承关系 public static Class BluetoothDevice extends Object implement Parcelable ...
- android 向服务器上传
采用数据流的格式向服务器上传. 代码如下: private void upload(String requestURL) { //参数requestU ...
- android学习中遇到的错误
1.运行项目的时候报错: [2013-12-16 17:59:22 - Dex Loader] Unable to execute dex: java.nio.BufferOverflowExcept ...
- CI框架 -- 创建类库
当我们使用 “类库” 这个词的时候,通常我们指的是位于 libraries 这个目录下的那些类. 接下来我们将介绍 如何在 application/libraries 目录下创建你自己的类库,和全局的 ...
- java Object类源代码详解 及native (转自 http://blog.csdn.net/sjw890821sjw/article/details/8058843)
package java.lang; public class Object { /* 一个本地方法,具体是用C(C++)在DLL中实现的,然后通过JNI调用.*/ private static na ...
- 创建自己的PKI公/私密钥对和公钥证书
1. 创建certificate request configuration file cert_req.conf******************************************* ...