OS X 10.10 Apache Configuration

Source: Internet
Author: User

Configuration content to: http://www.linuxidc.com/Linux/2015-04/116347.htm one, Apache configuration

Apache has its own, only the following three commands are available.
Open Apache service sudo apachectl start
stop Apache service sudo apachectl stop
Restart service sudo apachectl restart
View version httpd-v

1. After manually opening the Apache service, enter localhost in the browser and you will see the following:

The root directory of the program under/library/webserver/documents/, this it works is the inside of the info.php print out. Here's how to change this default directory of Apache to the user directory.
1, create a new sites folder in your user directory, my user directory is LINUXIDC

2, into the cd/etc/apache2/users/directory, sudo vim username.conf, the content is:

<Directory "/Users/linuxidc/Sites/">AllowOverride AllOptions Indexes MultiViews FollowSymLinksRequire all granted</Directory>
    • The LINUXIDC in the first line above is the user directory. Then change the file permissions to 644: sudo chmod 644 username.conf

3, into the/etc/apache2/directory, sudo vim httpd.conf the following three sentences to remove the comments:
LoadModule Authz_core_module libexec/apache2/mod_authz_core.so
LoadModule Authz_host_module libexec/apache2/mod_authz_host.so
LoadModule Userdir_module libexec/apache2/mod_userdir.so
The first two sentences should have been without comments, the third sentence to release the comments.
Then find the include/private/etc/apache2/extra/httpd-userdir.conf comment release.
PS: Just switch to command mode under VIM and then enter/"Words you need find" to quickly find the words you need to find.

4, into the/etc/apache2/extra/directory, will include/private/etc/apache2/users/*.conf this sentence release comments.

Then terminal input: sudo apachectl restart restart Apache, browser input: loacal/~linuxidc/will be able to see the effect. (LINUXIDC is the name of my user directory, not add/sites)
Apache will do well after the above steps.

Problems encountered:

1. Access the Web project file under the User Directory Sites folder, which appears

You don't have the permission to access/(Web project file name)/index.html on this server.

Workaround: The possible reason is that there is no permission to modify permissions:

cd/users/User/sites/Project file

chmod 775 index.html

OS X 10.10 Apache Configuration

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.