Rookie OPS Note: Install and configure Apache server

Source: Internet
Author: User
Tags apache download

A few days ago in Ali spent 49.5 bought a one-month host. Try to use the renewal fee.

    • Region: Qingdao
    • Availability Zone: Qingdao Availability Zone A
    • Cpu:1 Nuclear
    • Memory: 512MB
    • Bandwidth: 1Mbps
    • Operating system: CentOS 6.5 64-bit
    • Solutions: Yes

Installing the Apache server

2014/10/27

Apache Download Compression Pack

http://mirrors.hust.edu.cn/apache/httpd/

Download the latest version of it, with *.gz and *.bz2. The BZ2 algorithm compresses the file a little bit smaller, but this file is not very, much the same.

Upload two downloaded files to the server via FTP
    • httpd-2.4.10.tar.bz2
    • HTTPD-2.4.10-DEPS.TAR.BZ2//Required Dependency Packages

If this dependency is already on the host, it can not be downloaded.

Unzip to the same directory

My directory is document.

tar xvf httpd-2.4.10.tar.bz2 -C document/tar xvf httpd-2.4.10-deps.tar.bz2 -C document/
Start compiling
./configure --prefix=/usr/local/apache2 --with-included-aprmake make install

Note that the directory behind the prefix= is my installation directory and can be arbitrarily specified
When I executed the first line, I was prompted for a lack of pcre (a Perl library), and I made a copy of the pcre, which I compiled and installed myself.

I go to pcre official website download, very small thing, unexpectedly very long is under not good, helpless Baidu has a domestic resources, soon under good, then compiles installs.

Launch Apache
/usr/local/apache2/bin/apachectl start

At this point AH0058 , the solution: Enter the APACHE2 installation directory under the Conf directory, open httpd.conf the inside of the ServerName that line of the comment # (I was 189 lines), the following URI changed to its own domain name or IP address , you can do it. Like what:

ServerName localhost:80

Change localhost to your public IP or domain name. Bought Ali host will give you a public network IP.

It is also important to note that the open service is to be executed as root, otherwise it will be reported incorrectly AH00072 .

Test

Use your local browser to access it! The browser enters the IP address of the host and the 80 port does not need to be specified.
Then, the screen shows:

It works! This HTML file is in the Htdocs directory under the Apache installation directory. The root directory of your site.

Rookie OPS Note: Install and configure Apache server

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.