Mac Configuration apache2.4.25 Server

Source: Internet
Author: User
Tags web hosting

It took a long time today to configure Apache, referring to some of the blog post combined with their actual configuration situation, summarized as follows:

First, enter "Open/etc" under terminal, open Apache2-httpd.conf, modify Apache configuration file httpd.conf

which

(1) The directory in ServerRoot is the system installation directory, also for the httpd run directory, do not modify

    

(2) Listen 80 default Listener 80 port, in case no other application occupies 80 port, can not be modified

    

(3) serveradmin is the administrator mailbox, when a problem occurs, the server will send mail to this mailbox, can not be modified

    

(4) servername is the hostname, you need to ServerName before the "#" removed, www.example.com modified to host DNS domain name localhost, or IP address 127.0.0.1

    

www.example.com is just a sample field ServerName提供用于识别它自己的名字和端口。名字和端口通常由服务器自动定义, 但是建议你明确地指定它以避免启动过程中产生问题。 Note: "#" does not remove, although It does not affect the display of "It works! ", however, AH00557 and AH00558 errors occur when the terminal enters" Apachectl configtest ":  

(5) Deny all access to your server file system, if necessary, can be modified, temporarily do not change

(6) Here is the default directory for Web pages, modify the path

   

(7) The display file of the home page (that is, "It works! "), You can simply move the index.html file under the original path into the new path without making any changes .

    

Note: If you have modified the web hosting directory, you need to move the index.html under the original path to the new path, or you will see a 403 error

  

For this reason, I configured the majority of days, thought is the authority problem, around a large circle after the discovery is this problem, careless .....

Two

The command line that is used

Httpd-v View Apache version

sudo apachectl stop off Apache

sudo apachectl start Apache

sudo apachectl restart restart Apache

APACHECTL configtest Check Apache syntax ( useful to help with configuration troubleshooting )

Late permission settings, should be required, temporarily do not write (considering the version of Apache differences)

Mac Configuration apache2.4.25 Server

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.