阿里云Ubuntu12服务器安装apache2.44

apache 2.44

http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.4.tar.gz


apr

http://apache.fayea.com/apache-mirror//apr/apr-1.4.8.tar.gz

apr-util

http://apache.fayea.com/apache-mirror//apr/apr-util-1.5.2.tar.gz

pcre 8.3.3

http://sourceforge.net/projects/pcre/files/pcre/8.33/pcre-8.33.tar.gz/download

libiconv

http://ftp.gnu.org/pub/gnu/libiconv/

./configure --prefix=/usr/local

curl

http://curl.haxx.se/download/

http://curl.haxx.se/download/curl-7.31.0.tar.gz

./configure --prefix=/usr/local


apt-getinstall libxml2-dev libmhash-dev libmcrypt-dev mcrypt libldap2-dev libsasl2-dev libssh2-1-dev

ZLIB

http://downloads.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz

gd-2.0.35

http://google-desktop-for-linux-mirror.googlecode.com/files/gd-2.0.35.tar.gz

https://bitbucket.org/libgd/gd-libgd/downloads

https://bitbucket.org/libgd/gd-libgd/downloads/libgd-2.1.0.tar.gz

apache官方网址:

http://httpd.apache.org/docs/2.4/install.html


先从APACHE官网 http://httpd.apache.org/download.cgi 找到合适你下载的Apache 2.44镜像网址,然后下载到本地。

我是下载到/usr/local/src/下:


#cd /usr/local/src

#wget http://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.4.tar.gz


配置并安装

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

make

make install

配置一下

vi /usr/local/apache2.4/conf

感觉2.44的配置文件比2.2要清晰明了的多。



尝试启动apache2.44

/usr/local/apache2.4/apache2ctl -k start

提示错误:

The program 'apachectl' is currently not installed.  You can install it by typing:
apt-get install apache2.2-common

再次尝试启动apache2.44

执行/usr/local/apache2.4/apache2ctl -k start提示"No apache MPM package installed"

安装MPM

apt-get install apache2-mpm-itk

cd /etc/init.d
sudo ln -s /usr/local/development/http-2.4.2/bin/apachectl


/etc/init.d/apachectl start


安装后自动启动apache2.44


"It works"

成功了。



自定义httpd.conf位置:

apachectl -f /usr/local/apache/httpd.conf


看过了XXX网上资料都是失败,最终从阅读了apache官网资料才成功安装。 呵呵...

Apache 2.44的官方文件地址为:http://httpd.apache.org/docs/2.4/


安装后尚不支持php


apt-get install php5 libapache2-mod-php5


sudo apt-get update 
sudo apt-get install libpcre3 libpcre3-dev 

你可能还需要安装
sudo apt-get install openssl libssl-dev


apt-get install libcurl3-openssl-dev
  apt-get install openssl-dev


sudo apt-get install libxml2(按Tab键)

将会看到如下信息:

libxml2 libxml2-dev libxml2-headers libxml2-utils

这里需要安装的是libxml2-dev软件包(该软件为Ubuntu-Server自带的,需要使用Ubuntu-Server光盘安装),操作如下:

sudo apt-get install libxml2-dev


./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-apxs2=/usr/local/apache/bin/apxs --with-gd --with-iconv --with-zlib   --enable-sysvsem --enable-inline-optimization --enable-mbregex   --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-sockets --enable-zip --enable-soap --without-pear --with-gettext  --enable-session --with-mcrypt




./configure --prefix=/usr/local/apache --with-apr-util=/usr/local/apr-util/ --with-apr=/usr/local/apr  --with-mpm=worker  --enable-rewrite --enable-status    


./configure --prefix=/usr/local/apache --with-apr-util=/usr/local/apr-util/   --with-mpm=worker  --enable-rewrite --enable-status    


./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-apxs2=/usr/local/apache/bin/apxs --with-mysql




./configure --prefix=/usr/local/apache --with-apr-util=/usr/local/apr-util/ --with-apr=/usr/local/apr  --with-mpm=worker  --enable-rewrite --enable-status    --enable-gzip --enable-deflate




./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-apxs2=/usr/local/apache/bin/apxs 
--with-curl



php 5.5安装:


./configure  \
  --with-config-file-path=/etc \
  --prefix=/usr \
  --enable-zip \
  --enable-mbstring \
  --with-apxs2=/usr/local/apache/bin/apxs \
  --with-zlib-dir=/usr/include \
  --with-libxml-dir=/usr/lib64 \
  --with-mysql \
  --with-gd \
  --with-jpeg-dir=/usr \
  --with-png-dir=/usr \
  --enable-calendar \
  --enable-gd-native-ttf \
  --enable-sockets \
  --with-freetype-dir \
  --with-jpeg-dir \
  --with-png-dir \
  --with-iconv=/usr/local/libiconv \

你可能感兴趣的:(LINUX-UBUNTU)