[Deployment] install apache on CentOS

Source: Internet
Author: User

[Deployment] install apache on CentOS
Environment Virtual Machine: VMWare10.0.1 build-1379776 Operating System: CentOS7 64-bit Step 1. Use yum install httpd httpd-devel2, start apachectl start startup service installation 1. in/etc/init. the d directory first creates the httpd file vi/etc/rc. d/init. d/httpdhttpd 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" instart)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 restartecho;;*)echo "Usage: $0 {start|stop|restart|reload|status}"exit 1esacexit 0

 

2. Modify/etc/rc. d/init. d/httpd execution permission chmod 755/etc/rc. d/init. d/httpd3. add the system service chkconfig -- add httpdchkconfig -- levels 2345 httpd on

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.