MacBook Apache Service

Source: Internet
Author: User
Tags apache log macbook

Thinking about how to deploy a static Web page under Mac OS (pure Html,css,js), used by IIS under Windows, but probably only through the use of Tomcat or Apache as a deployment container under Mac OS. I heard that the Mac OS comes with Apache, so it will toss up.
Environment: MacBook Air OS X 10.9.5

Find Apache hiding Place

The system hides the Apache installation directory by default, but we can find it by "command line" or "Folder Go". It is installed in the system's private directory, that is, under/PRIVATE/ETC, because it is hidden, so we can not find it through the interface.
The Ps:/ect directory is where the Mac OS system stores system configuration information, all of which are xxx.conf configuration files.
command Line
Enter the OPEN/ETC command at the terminal to open its "home". Please see:

folder to
Open Finder > Go to > go to folder. Please see:

Deploying Web Resources under Apache

Unlike Windows, its deployment package is not placed in Htdocs (the directory under Windows), but in "/Repository/webserver/documents/":

English: "/library/webserver/documents"


Then our static resources can be dropped to this directory.
This directory is the default directory of Apache, sometimes to facilitate operation, you may need to point to a specific folder, how to modify the configuration of Apache?

Modify the default deployment path

Locate the following httpd.conf file, configure forwarding, and the module start and stop operations are in the file.

Find this documentroot and change it to the address you want.

Start disabling Apache

command to enable Apache: sudo apachectl start/restart
If you need to password, enter, if the boot fails, you can go to the Apache log, to find the cause of the error (provided that the path of the log is configured in httpd.conf)

Enter localhost or 127.0.0.1 in the browser to see "It works!" The prompt. Congratulations, Apache started successfully. The command to stop Apache is: sudo apachectl stop

Modify Apache Default port

Access via localhost or 127.0.0.1 means that the default port is 80, and sometimes if the 80 port is occupied, you have to try it on a different port. Also under Httpd.conf, find the Listen 80 line, modify it to the port you want.


In fact, there are many uses of Apache, such as forwarding configuration, SSL configuration, log configuration, and so on, slowly supplemented, in case of a rainy future.

Original link: http://blog.csdn.net/seafishyls/article/details/44546809

MacBook Apache Service

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.