centos7 php开发环境安装-Apache
2021-05-03 02:28
标签:ati yml tar 文件 httpd bsp etc list lib 1.安装apr 注意: cannot remove ‘libtoolT‘: No such file or directory 直接打开 configure,把 $RM “$cfgfile” 那行删除掉,重新再运行 ./configure 就可以了 2.安装 Apr-util 3.安装pcre 4.安装apache 5.配置ServerName 进入apache 配置文件 ServerName localhost:80 6.修改家目录 进入httpd.conf配置文件 DocumentRoot "/home/www" 7.开机启动 将自己安装目录下的apachect1复制到该目录下并改为httpd cp /usr/local/apache/bin/apachect1 /etc/init.d/httpd 注:复制时注意安装目录 编辑 vi /etc/init.d/httpd 在 #!/bin/sh 下添加这两句 #chkconfig:345 85 15 #description:Start and stop the Apache HTTP Server 添加启动: chkconfig --add httpd 启动: chkconfig httpd on 查看是否成功: chkconfig --list httpd 8.启动与关闭常用操作 启动: /usr/local/apache/bin/apachectl start 重启: /usr/local/apache/bin/apachectl restart 停止: /usr/local/apache/bin/apachectl stop 不中断: /usr/local/apache/bin/apachectl graceful 9.Apache解析php 首先http.conf中配置 LoadModule php7_module modules/libphp7.so 开启注释 其次在配置文件httpd.conf的 AddType application/x-httpd-php .php ServerName 127.0.0.1:80 然后搜索 DirectoryIndex index.html index.php 重启apache 10.Apache 禁止目录浏览 打开apache配置文件httpd.conf 找到Options Indexes Options Indexes AllowOverride None Order allow,deny Allow from all 修改 Options Indexes 修改为Options None Options Indexes FollowSymLinks,修改为Options None centos7 php开发环境安装-Apache 标签:ati yml tar 文件 httpd bsp etc list lib 原文地址:https://www.cnblogs.com/ddf128/p/12123869.html tar -zxvf apr-1.6.3.tar.gz
cd apr-1.6.3
./configure --prefix=/usr/local/apr
make
make install
tar -zxvf apr-util-1.6.1.tar.gz
cd apr-util-1.6.1
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make
make install
tar -zxvf pcre-8.39.tar.gz
cd pcre-8.39
./configure --prefix=/usr/local/pcrel
make
make install
tar -zxvf httpd-2.4.34.tar.gz
cd httpd-2.4.34
./configure --prefix=/usr/local/apache --enable-ssl --enable-rewrite --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
make
make install