Using your Mac for development of web applications or websites, is very easy as it already comes with Apache pre-installed, the problem is that .htaccess file does not work by default.
But it is easy to enable it.
First some changes in the main configuration file of Apache.
![Download Download](/uploads/1/3/3/9/133911061/223481870.png)
The first thing I will do is to change the Document root from the default /Library/WebServer/Documents to my Sites folder under my home directory.
The Apache web server remains bundled with Mac OS X though, but you’ll need to turn to the command line to enable the web server. Additionally, you’ll want edit a user configuration file for each user account on the Mac to have the personal web sharing feature active. MacOS Server, formerly Mac OS X Server and OS X Server, is a separately sold operating system add-on which provides additional server programs along with management and administration tools for macOS. XAMPP is a very easy to install Apache Distribution for Linux, Solaris, Windows, and Mac OS X. The package includes the Apache web server, MySQL, PHP, Perl, a FTP server and phpMyAdmin. Apache FtpServer for Mac OS X 10.13 High Sierra official version DL via p2p. Apache Software Foundation. Click on URL below Apache FtpServer Apache Download Mirrors Learn how to configure httpd or apache server and ftp or vsftp server on rhel 7. Rhel 7 apache install install apache on rhel To Learn or Teach Linux visit. Installing Apache, PHP, and MySQL on Mac OS X El Capitan This is an update for Mac OS X El Capitan of a previous post on installing Apache, PHP, and MySQL for Mac OS X.
So, look for these lines:
DocumentRoot '/Library/WebServer/Documents'
<Directory '/Library/WebServer/Documents'>
And change them to:
DocumentRoot '/Users/your-username/Sites'
<Directory '/Users/your-username/Sites'>
Of course instead of your-username insert there your real username.
I prefer to have it there, as I do not need root permissions to add content to that folder.
Enable .htaccess file in Mac OS X
In the same file, under the section
<Directory '/Users/your-username/Sites'>
look for:- AllowOverride None
And change it to:
- AllowOverride All
Also edit this file:
And look for the same line AllowOverride None** and change it to *AllowOverride All
Then restart apache:
You are now ready to put files to ~/Sites/ folder and when you go to: http://localhost/ you will see those files appear, and if you add a .htaccess file, that is going to work.