Install and deploy Apache on CentOS

Source: Internet
Author: User

Install and deploy Apache on CentOS

Environment

Virtual Machine: VMWare10.0.1 build-1379776

Operating System: 64-bit CentOS7

Procedure

1. Install using yum

Yum install httpd-devel

2. Start

Apachectl start

Start Service Installation

1. Create an httpd file in the/etc/init. d directory.

Vi/etc/rc. d/init. d/httpd
Httpd File Content

#! /Bin/sh
#
# Startup script for the Apache Web Server
#
# Chkconfig: 345 85 15
# Description: Apache is a World Wide Web server. It is used to serve \
# HTML files and CGI.
# Processname: httpd
# Source function library.

./Etc/rc. d/init. d/functions

# See how we were called.
Case "$1" in
Start)
Echo-n "Starting httpd :"
/Usr/sbin/apachectl start
;;
Stop)
Echo-n "Shutting down httpd :";
/Usr/sbin/apachectl stop
;;
Status)
/Usr/sbin/apachectl status
;;
Restart)
Echo-n "Restarting httpd :";
/Usr/sbin/apachectl restart
;;
Reload)
Echo-n "Reloading httpd :"
/Usr/sbin/apachectl restart
Echo
;;
*)
Echo "Usage: $0 {start | stop | restart | reload | status }"
Exit 1
Esac

Exit 0

2. Modify the execution permission of/etc/rc. d/init. d/httpd.

Chmod 755/etc/rc. d/init. d/httpd

3. Add to System Service

Chkconfig -- add httpd
Chkconfig -- levels 2345 httpd on

Install a Web Server on Ubuntu Server 14.04 (Linux + Apache + MySQL + PHP)

Install and configure the PHP environment in Linux (Apache2)

Install the LAMP \ Vsftpd \ Webmin \ phpMyAdmin service and settings in Ubuntu 13.04

Compile and install LAMP in CentOS 5.9 (Apache 2.2.44 + MySQL 5.6.10 + PHP 5.4.12)

Source code for Web server architecture in RedHat 5.4 build the LAMP environment and application PHPWind

Apache details: click here
Apache: click here

This article permanently updates the link address:

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.