Linux CentOS Installation Apache

Source: Internet
Author: User

First, install Apache

Yum-y Install httpd

/ETC/INIT.D/HTTPD start

Document Directory in/var/www/html


Second, install PHP

Yum-y Install PHP

Modify the Apache configuration file,/etc/httpd/conf/httpd.conf

The corresponding location appends the following:

LoadModule php5_module/usr/lib64/httpd/modules/libphp5.so

Additional

AddType application/x-httpd-php. php. phtml
AddType Application/x-httpd-php-source. Phps


DirectoryIndex additional index.php


Restarting the APACHE,/ETC/INIT.D/HTTPD restart will prompt

"Module Php5_module is already loaded, skipping", does not matter does not affect

However, if the PHP page can not be parsed, the browser displays the source code, it is added in the httpd.conf:

<ifmodule mod_php5.c>
AddType application/x-httpd-php. php
AddType Application/x-httpd-php-source. Phps

</IfModule>

It should be good to restart Apache.

This article is from the "zl1030 Records" blog, so be sure to keep this source http://zl1030.blog.51cto.com/274507/1561977

Linux CentOS Installation Apache

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.