the combination of Apache and php :
[Email protected] ~]# vim/usr/local/apache2/conf/httpd.conf
Usr/local/apache2/conf/httpd.conf is the Apache configuration file
Locate AddType application/x-gzip. gz. tgz Add the following:
AddType application/x-httpd-php. php
Found it:
<ifmodule dir_module>
DirectoryIndex index.html
</IfModule>
Modified to:
<ifmodule dir_module>
DirectoryIndex index.html index.htm index.php
</IfModule>
Found it:
#ServerName www.example.com:80
Modified to:
ServerName localhost:80
:Wq
Detects if Apache configuration file is correct and displays correctly Syntax OK
[Email protected] ~]#/usr/local/apache2/bin/apachectl-t
Syntax OK
Launch Apache
[[email protected] ~]#/usr/local/apache2/bin/apachectl start
To see if Apache starts:
[Email protected] ~]# NETSTAT-LNP |grep httpd
TCP 0 0::: +:::* LISTEN 11660/httpd
The above indicates that Apache has been started.
Test whether PHP can parse properly:
[Email protected] ~]# vim/usr/local/apache2/htdocs/1.php
<?php
echo "PHP parsing normal ";
?>
:Wq
[Email protected] ~]# Curl localhost/1.php
PHP parsing normal [[email protected] ~]#
Enter IPin the browserand cannot display it works.
Need to close selinux,iptables-f Clear the fence rules.
Apache and PHP combined test