共计 1405 个字符,预计需要花费 4 分钟才能阅读完成。
环境
虚拟机:VMWare10.0.1 build-1379776
操作系统:CentOS7 64 位
步骤
1、使用 yum 安装
yum install httpd httpd-devel
2、启动
apachectl start
开机启动服务安装
1、在 /etc/init.d 目录先建立 httpd 文件
vi /etc/rc.d/init.d/httpd
httpd 文件内容
#!/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、修改 /etc/rc.d/init.d/httpd 的执行权限
chmod 755 /etc/rc.d/init.d/httpd
3、加入系统服务
chkconfig –add httpd
chkconfig –levels 2345 httpd on
Ubuntu Server 14.04 安装 Web 服务器 (Linux+Apache+MySQL+PHP) http://www.linuxidc.com/Linux/2015-06/119061.htm
Linux 下安装配置 PHP 环境 (Apache2) http://www.linuxidc.com/Linux/2015-05/118062.htm
Ubuntu 13.04 安装 LAMP\Vsftpd\Webmin\phpMyAdmin 服务及设置 http://www.linuxidc.com/Linux/2013-06/86250.htm
CentOS 5.9 下编译安装 LAMP(Apache 2.2.44+MySQL 5.6.10+PHP 5.4.12) http://www.linuxidc.com/Linux/2013-03/80333p3.htm
RedHat 5.4 下 Web 服务器架构之源码构建 LAMP 环境及应用 PHPWind http://www.linuxidc.com/Linux/2012-10/72484p2.htm
Apache 的详细介绍 :请点这里
Apache 的下载地址 :请点这里
本文永久更新链接地址 :http://www.linuxidc.com/Linux/2015-09/122922.htm