infinitewhe.blogg.se

Mac os x terminal start apache
Mac os x terminal start apache












mac os x terminal start apache

Sudo chown root:wheel /etc/apache2/users/* If you need these, then they can be installed and enabled separately following the instructions in the guide by Coolest Guy Planet Tech.Īfter the server is running, if you still see errors when accessing Web pages in your home folder (ie, with the url " then be sure the file (and any others you may have configured) are properly accessible by running the following two Terminal commands to alter their ownership and permissions: This procedure will enable the server and allow you to host Web pages, but will not enable any additional Web technologies like SQL or PHP. Sudo defaults write /System/Library/LaunchDaemons/ Disabled -bool falseĪs with the previous command, this one can be reversed by repeating it but changing the "false" text to "true." To enable the server even after subsequent reboots, then you will need to enable the launch daemon for the server, which can be done with the following command: Keep in mind that the steps so far will only keep the server running while the system is booted, so if you restart then the server will be disabled again.

mac os x terminal start apache

If you plan on using the server as a test server for your computer, only then do you not need to allow connections through the firewall however, if you want to host pages for other computers to see, then you will need to allow connections. Therefore when you enable it, you will be asked to allow the Web server process (httpd) to allow incoming connections.

mac os x terminal start apache

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.

    MAC OS X TERMINAL START APACHE FULL

    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.














    Mac os x terminal start apache