Using is also fine, and by editing the hosts file you can set a local domain to whatever you want to create a local test environment with an otherwise live domain. You can now also visit to see the contents of whatever is stored in the user ~/Sites/ directory – if anything is there per user – and you can add an index.html file or whatever else you’d like to the directory to serve it to the outside world or even just your LAN. Note, if you just want to use and modify ‘localhost’ root and not the user level Sites at localhost/~user, you can find the apache webserver files and ‘It Works!’ html in the following location: Apache Web Server Documents Location & User Sites Folders Now that you’ve started a successful Apache server in OS X, you can either modify the core ‘localhost’ files, or go further with the user files. Launch Safari, Chrome, or Firefox and navigate to “” to verify the server is running, you will see an “It Works!” message.Next, you will start the Apache web server with the following command:.Now hit Control+O to save the changes to nf, then hit Control+X to quit out of nano.Edit the Directory path USERNAME to the appropriate username.Enter the admin password when requested, then paste the following into the nano text editor:.Type the following command, replacing USERNAME with the user account short name:.Launch Terminal, located in /Applications/Utilities/.Versions of OS X prior to El Capitan, Yosemite, Mavericks, Mountain Lion and Mavericks can simply turn on “Web Sharing”, but from 10.8, 10.9, 10.10, and 10.11 onward you’ll need to do the following to use a local web server: Setting Up and Starting the Apache Web Server in OS X
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |