Linux——搭建PHP开发环境第一步:apache
原文链接:http://www.2cto.com/os/201511/450258.html
##### Apache 编译安装[root@localhost ~]# yum install gcc gcc-c++ make wget
- [root@localhost ~]# yum install zlib-devel openssl-devel
- [root@localhost ~]# yum install -y perl perl-devel
- 1) apr
- [root@localhost src]# wget http://mirror.bit.edu.cn/apache//apr/apr-1.5.2.tar.gz
- [root@localhost src]# tar zxvf apr-1.5.2.tar.gz
- [root@localhost src]# cd apr-1.5.2
- [root@localhost apr-1.5.2]# ./configure --prefix=/usr/local/apache/apr
- [root@localhost apr-1.5.2]# make && make install
- 2) apr-util
- [root@localhost src]# wget http://mirror.bit.edu.cn/apache//apr/apr-util-1.5.4.tar.gz
- [root@localhost src]# tar zxvf apr-util-1.5.4.tar.gz
- [root@localhost src]# cd apr-util-1.5.4
- [root@localhost apr-util-1.5.4]# ./configure --prefix=/usr/local/apache/apr-util --with-apr=/usr/local/apache/apr
- [root@localhost apr-util-1.5.4]# make && make install
- 3) pcre
- [root@localhost src]# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.gz
- [root@localhost src]# tar zxvf pcre-8.37.tar.gz
- [root@localhost src]# cd pcre-8.37
- [root@localhost pcre-8.37]# ./configure
- [root@localhost pcre-8.37]# make && make install
- 4) apache
- [root@localhost ~]# cd /usr/local/src/
- [root@localhost ~]# wget http://mirrors.cnnic.cn/apache//httpd/httpd-2.4.17.tar.gz
- [root@localhost src]# tar zxvf httpd-2.4.17.tar.gz
- [root@localhost src]# cd httpd-2.4.17
- [root@localhost httpd-2.4.17]# ./configure --prefix=/usr/local/apache \
- --with-apr=/usr/local/apache/apr/bin/apr-1-config \
- --with-apr-util=/usr/local/apache/apr-util/bin/apu-1-config \
- --enable-module=so \
- --enable-mods-shared=all \
- --enable-deflate \
- --enable-expires \
- --enable-headers \
- --enable-cache \
- --enable-file-cache \
- --enable-mem-cache \
- --enable-disk-cache \
- --enable-mime-magic \
- --enable-authn-dbm \
- --enable-vhost-alias \
- --enable-so \
- --enable-rewrite \
- --enable-ssl \
- --with-mpm=prefork
- [root@localhost httpd-2.4.17]# make && make install
- #index.php
- #AddHandler php5-script .php
- #AddType text/html .php
- ###### httpd end ###########
- [root@localhost ~]# ln -s /usr/local/apache/conf /etc/httpd
- [root@localhost ~]# ln -s /usr/local/apache/bin/* /usr/sbin/
- [root@localhost ~]# touch /etc/init.d/httpd
- [root@localhost ~]# chmod 755 /etc/init.d/httpd
- [root@localhost ~]# vi /etc/init.d/httpd
- #!/bin/bash
- #
- # httpd Startup script for the Apache HTTP Server
- #
- # chkconfig: - 85 15
- # description: The Apache HTTP Server is an efficient and extensible \
- # server implementing the current HTTP standards.
- # processname: httpd
- # config: /etc/httpd/conf/httpd.conf
- # config: /etc/sysconfig/httpd
- # pidfile: /var/run/httpd/httpd.pid
- #
- ### BEGIN INIT INFO
- # Provides: httpd
- # Required-Start: $local_fs $remote_fs $network $named
- # Required-Stop: $local_fs $remote_fs $network
- # Should-Start: distcache
- # Short-Description: start and stop Apache HTTP Server
- # Description: The Apache HTTP Server is an extensible server
- # implementing the current HTTP standards.
- ### END INIT INFO
- # Source function library.
- . /etc/rc.d/init.d/functions
- if [ -f /etc/sysconfig/httpd ]; then
- . /etc/sysconfig/httpd
- fi
- HTTPD_LANG=${HTTPD_LANG-"C"}
- INITLOG_ARGS=""
- apachectl=/usr/sbin/apachectl
- httpd=${HTTPD-/usr/sbin/httpd}
- prog=httpd
- pidfile=${PIDFILE-/usr/local/apache/logs/httpd.pid}
- lockfile=${LOCKFILE-/var/lock/subsys/httpd}
- RETVAL=0
- STOP_TIMEOUT=${STOP_TIMEOUT-10}
- start() {
- echo -n $"Starting $prog: "
- LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONS
- RETVAL=$?
- echo
- [ $RETVAL = 0 ] && touch ${lockfile}
- return $RETVAL
- }
- stop() {
- echo -n $"Stopping $prog: "
- killproc -p ${pidfile} -d ${STOP_TIMEOUT} $httpd
- RETVAL=$?
- echo
- [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
- }
- reload() {
- echo -n $"Reloading $prog: "
- if ! LANG=$HTTPD_LANG $httpd $OPTIONS -t >&/dev/null; then
- RETVAL=6
- echo $"not reloading due to configuration syntax error"
- failure $"not reloading $httpd due to configuration syntax error"
- else
- # Force LSB behaviour from killproc
- LSB=1 killproc -p ${pidfile} $httpd -HUP
- RETVAL=$?
- if [ $RETVAL -eq 7 ]; then
- failure $"httpd shutdown"
- fi
- fi
- echo
- }
- case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- status)
- status -p ${pidfile} $httpd
- RETVAL=$?
- ;;
- restart)
- stop
- start
- ;;
- condrestart|try-restart)
- if status -p ${pidfile} $httpd >&/dev/null; then
- stop
- start
- fi
- ;;
- force-reload|reload)
- reload
- ;;
- graceful|help|configtest|fullstatus)
- $apachectl $@
- RETVAL=$?
- ;;
- *)
- echo $"Usage: $prog {start|stop|restart|condrestart|try-restart|force-reload|reload|status|fullstatus|graceful|help|configtest}"
- RETVAL=2
- esac
- exit $RETVAL
- [root@localhost ~]# chkconfig --add httpd
- [root@localhost ~]# chkconfig httpd on
//重启
service httpd -k restart
不行的话可以 httpd -k stop/start
Linux——搭建PHP开发环境第一步:apache的更多相关文章
- linux搭建C开发环境
目前决大多 数的Linux用户对Linux的了解还处于比较低级的层次,他们可能会几条命令.会配几种服务.会用rpm来安装软件.会操作KDE/Gnome界机等等,但是当他们遇到一些需要编译安装的软件时, ...
- Linux——搭建PHP开发环境第三步:mysql
原文链接:http://www.jb51.net/article/83647.htm 1.第一步就是看linu是否安装了mysql,经过rpm -qa|grep mysql查看到centos下安装了m ...
- Linux——搭建PHP开发环境第四步:composer
原文链接:https://my.oschina.net/jiangbianwanghai/blog/473249 1.下载composer.phar [root#localhost opt]# cur ...
- linux搭建PHP开发环境
因为PHP是一门易于上手的开发语言,所以现在越来越多的初创公司选择PHP作为前期项目的主要开发语言. 工欲善其事,必先利其器! 现在我们就从最基本的环境搭建开始,PHP环境的搭建是非常简单的: 环境: ...
- 从零开始搭建Java开发环境第一篇:Java工程师必备软件大合集
1.JDK https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 目前主流的JDK版 ...
- Linux搭建JavaEE开发环境与Tomcat——(十)
服务器通过ip地址访问是不需要备案的,如果通过域名访问的话才需要备案. 1.安装Mysql 在CentOS7上安装MySQL时,出现了以下的提示: 原因是: CentOS7带有MariaDB而不是my ...
- Linux——搭建PHP开发环境第二步:PHP
原文链接:http://www.2cto.com/os/201511/450258.html ##### PHP 编译安装 #### [root@localhost ~]# yum install l ...
- linux搭建stm32开发环境
下载stm32固件库 创建目录 libs目录放stm32固件库,src放用户源码,inc放用户头文件 # mkdir libs src inc 复制文件 将STM32F10x_StdPeriph_Li ...
- 在Eclipse下搭建Android开发环境教程
我们昨天向各位介绍了<在NetBeans上搭建Android SDK环境>,前不久也介绍过<在MyEclipse 8.6上搭建Android开发环境>, 都受到了读者的欢迎.但 ...
随机推荐
- POJ 2376 贪心
题意:FJ希望它的牛做一些清洁工作.有N只牛和T个时间段,每只牛可以承担一段时间内的工作.FJ希望让最小数量的牛覆盖整个T,求出其数量.若无法覆盖整个T,则输出-1. 分析:首先要注意T表示T个时间段 ...
- zoj 2836 容斥原理
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2836 #include <cstdio> #incl ...
- 网络协议- HTTP
http:是用于www浏览的一个协议.tcp:是机器之间建立连接用的到的一个协议.
- [连载]JavaScript讲义(03)--- JavaScript面向对象编程
- vim note(4)
:new 文件名.词尾 新文件. :e 文件名 打开文件. :w 文件名.txt 保存文件. :wq 保存并退出. :x 辍学.假设文件更改被保存 版权声明:本文博主原创文章,博客,未经同意不得转载.
- android shape的使用详解以及常用效果(渐变色、分割线、边框、半透明阴影效果等)
shape使用.渐变色.分割线.边框.半透明.半透明阴影效果. 首先简单了解一下shape中常见的属性.(详细介绍参看 api文档 ) 转载请注明:Rflyee_大飞: http://blog.cs ...
- Preloading an Image with jQuery--reference
Preloading images will make your application a bit faster by making it lightweight. It is very simpl ...
- xcode6制作IOS .a静态库小记
xcode6制作IOS .a静态库小记 创建iOS静态库 简单写个打印的代码 编码完成之后,直接Run就能成功生成.a文件了,选择 xCode->Window->Organizer-> ...
- 笔试之Linux命令的使用
1. awk文本处理工具,显示ps的最后两列 ps -ef|awk '{print $1,$2}' 打印第一和第二域 $0是全域 2. Linux下查看内存使用情况 free
- 有向图的欧拉路径POJ2337
每个单词可以看做一条边,每个字母就是顶点. 有向图欧拉回路的判定,首先判断入度和出度,其实这个题判定的是欧拉通路,不一定非得构成环,所以可以有一个点的顶点入度比出度大1,另外一个点的出度比入度大1,或 ...