Apache one-click installation script and apache one-click script

Source: Internet
Author: User
Tags fully qualified domain name

Apache one-click installation script and apache one-click script

To install apace in apache recently, you must configure apr, apr-util, and pcre. The so-called programmer's spirit is to reduce repetitive work. Please refer to the apache installation script I wrote below:
I also put this script on my github.

#! /Bin/bash # sudo is required to execute dir = 'pwd' # To install pcre, install g ++ if [['ls/etc | grep redhat-release' first '! = ""] Then yum-y install gcc-c ++ elif [['ls/etc | grep debian_version '! = ""] Then apt-get-y install gcc-c ++ fiif [['ls | grep apr' = ""] then wget http://mirrors.cnnic.cn/apache//apr/apr-1.5.2.tar.gzfitar-zxvf apr-1.5.2.tar.gzmkdir/ usr/local/lib/apr-1.5.2cd $ dir/apr-1.5.2. /configure -- prefix =/usr/local/lib/apr-1.5.2 makemake installcd $ dirif [['ls | grep apr-util '= ""] then wget http://mirrors.cnnic.cn/apache//apr/apr-util-1.5.4.tar.gzfitar-zxvf apr-util-1. 5.4.tar.gzmkdir/usr/local/lib/apr-util-1.5.4.tar.gzcd $ dir/apr-util-1.5.4. /configure -- prefix =/usr/local/lib/apr-util-1.5.4 -- with-apr =/usr/local/lib/apr-1.5.2make make installcd $ dirif [['ls | grep pcre' = ""] then wget http://ncu.dl.sourceforge.net/project/pcre/pcre/8.37/pcre-8.37.tar.gzfitar-zxvf pcre-8.37.tar.gzmkdir/usr/local/lib/pcre-8.37cd $ dir/pcre-8.37. /configure -- prefix =/usr/local/l Ib/pcre-8.37make make installcd $ dirif [['ls | grep httpd '= ""] then wget http://www.apache.org/dist/httpd/httpd-2.4.12.tar.gzfitar-zxvf httpd-2.4.12.tar.gzmkdir/usr/local/lib/httpd-2.4.12cd $ dir/httpd-2.4.12. /configure -- prefix =/usr/local/lib/httpd-2.4.12 -- with-apr =/usr/local/lib/apr-1.5.2 -- with-apr-util =/usr/local/lib/ apr-util-1.5.4 -- with-pcre =/usr/local/lib/pcre-8.37 -- enable-somakemake Install # solve httpd: cocould not reliably determine the server's fully qualified domain name, using 127.0.1.1. set the 'servername' directive globally to suppress this messagesed-I's/^ # ServerName www.example.com: 80/ServerName localhost/G'/usr/local/lib/httpd-2.4.12/conf/httpd. conf/usr/local/lib/httpd-2.4.12/bin/apachectl start # start apacheif [['curl-s localhost: 80 | grep "It works "'! = ""] Then echo "------------------------ successful installation -----------------------------------" cd $ dir rm-rf apr-1.5.2/apr-util-1.5.4/pcre-8.37/httpd-2.4.12/fi

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.