Verify that the configuration file is correct before starting Apache:
/usr/local/apache2/bin/apachectl-t
If there is an error, please continue to modify httpd.conf, if it is correct, then display as "Syntax OK", the command to start Apache is:
/usr/local/apache2/bin/apachectl start
To see if it starts:
[[email protected] ~]# NETSTAT-LNP |grep httpdtcp 0 0::: +:::* LISTEN 7667/htt Pd
If this line is displayed, it is started. You can also use the Curl command to simply test:
[Email protected] ~]# Curl Localhost
This is only true if it is displayed.
Test if PHP is parsed correctly:
vim/usr/local/apache2/htdocs/1.php
Write:
<?php echo "PHP parse normal";? >
After saving, continue testing:
Curl localhost/1.php
See if you can see the following information:
[[email protected] ~]# Curl localhost/1.phpphp parse normal [[email protected] ~]#
This is only true if it is displayed.
You may not be able to access the Web service when you first use it for your browser, because of the firewall. Please run the following command:
[email protected] ~]# iptables-f
This allows the system to clear the default firewall rules and release port 80.
This article from "12350027" blog, declined reprint!
Test PHP parsing