Therefore when you enable it, you will be asked to allow the Web server process (httpd) to allow incoming connections. Note that since Web sharing is not in the Sharing system preferences, it is no longer considered an essential system service so the OS will not automatically configure the firewall for it. Sudo apachectl start When you enable the Web server you will see this warning appear, so be sure to allow connections if you plan on serving pages to other computers. The first is to temporarily start it using the following "apachectl" terminal command (to disable the server, repeat the command with "stop" instead of "start"): To enable the Web server you have two options. Save and close the editor by pressing Control-O followed by Control-X.Īfter this action is performed, create a folder called "Sites" in your home directory if it is not already present, and then place your Web pages within it.Copy the following text into the Terminal editor that opens, but be sure to change the "username" text to the short name of your user account:.Sudo pico /etc/apache2/users/`whoami`.conf Create and edit an Apache user configuration file named after your user account by running the following command.Open the OS X Terminal utility (/Applicaitions/Utilities/). While you can use the global Web server folder for your sites, for convenience you can enable your home folder's site by creating an Apache user configuration file like the one created in prior versions of OS X when personal file sharing is enabled: However, if you try to access Web sites in your personal sharing folder by appending "~username" to the end of the URL then you will get "Forbidden" error in the Web browser. The steps for enabling this include optionally configuring the server for hosting Web pages in the "Sites" folder in your home directory, and then enabling the server itself.īy default the Apache Web server will issue Web sites that are stored in your system's global Web server folder (/Library/Web Server/Documents), which are accessed by typing " in a Web browser. While Apple may have removed the configuration settings for the Web server in the system preferences, the Apache server is still included in Mountain Lion and can be enabled for those who need it. The Web Sharing feature in OS X is missing from Mountain Lion's Sharing system preferences. In past versions of OS X, Apple has also included a full Web sharing service using the open-source Apache server that allows you to host Web pages on your computer, but this option has been removed from the system preferences in Mountain Lion.ĭespite its relative lack of popularity, the presence of the full Apache Web server in OS X has been useful for testing Web development projects, or setting up a small workgroup Web server. The Sharing services in OS X allow for a number of connectivity options, including screen sharing, file sharing, printer sharing, and the capability to use your computer as an Internet router.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |