sxinboss
资深老生
资深老生
  • UID315
  • 粉丝2
  • 关注1
  • 发帖数16
阅读:1117回复:0

Centos72下PHP71+Httpd24的 环境搭建[二]

楼主#
更多 发布于:2017-05-21 15:00
4.配置HTTP
$vim /usr/local/soft/httpd24/conf/httpd.conf


整合PHP+HTTPD
定位到 LoadModule 附近[随便] (其实第一行 libphp7.so 已经有了)


LoadModule php7_module modules/libphp7.so
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps 监听端口 (本人没用80端口,80端口留给ngigx转发. 因为如果服务器有tomcat和httpd共存的话就只能其中一个用80端口)
Listen 1024 配置虚拟主机

打开 Include conf/extra/httpd-vhosts.conf (最前面的#去掉)
$vim /usr/local/soft/httpd24/conf/extra/httpd-vhosts.conf
$mkdir -p /usr/local/soft/web/lesson1
<VirtualHost *:1024>
ServerName localhost:1024
DocumentRoot /usr/local/soft/web/lesson1
DirectoryIndex index.html index.php
<Directory "/usr/local/soft/web/lesson1">
Options FollowSymLinks
Require all granted
</Directory>
</VirtualHost>

运行用户[xxx 当前登录用户] User xxx
Group xxx  
5.启动HTTPD  
$/usr/local/soft/httpd24/bin/apachectl start
如果出现 "AH00558: httpd: Could not reliably determine the server"s fully qualified domain name, using 127.0.0.1. Set the "ServerName" directive globally to suppress this message"
等提示信息 可以直接忽略或者去配置文件 把ServerName写上

通过 "ps -ef|grep httpd" 可以看服务是否启动成功

$vim /usr/local/soft/web/lesson1/index.php
<?php echo "hello jtthink";

访问 localhost:1024/index.php 即可看到结果.

最新喜欢:

Lenny8691Lenny8... lzh900926lzh900...
游客

返回顶部