The latest versions of macOS come with pre-installed Apache 2.4. But it’s hard to manage it via homebrew due to Apple has removed some of the required scrips from latest macOS releases. This tutorial will help you to remove default installed Apache from the system and install Homebrew version Apache on your system.
Mac users interested in Os x apache gui generally download: Apache Protect 0.7 Free Apache Protect is a GUI utility that lets you configure and set up the built-in basic authentication and access control capabilites of your local Apache web server that comes pre-installed with all versions of Mac OS X.
Prerequisites
Before starting the installation of Apache (HTTPD) server using this tutorial you must have the following prerequisites.
Step 1 – Install Apache on macOS
Remove built-in Apache server (if any) from your system. Open a terminal and execute commands to stop running Apache server and remove it.
Now install the new version Apache server provided by Homebrew:
After completing the installation process, configure httpd service to be auto-started on system boot. https://esbrown722.weebly.com/blog/how-to-download-iphoto-on-old-mac.
You have successfully installed Apache web server via Homebrew, and configured it to auto-start with a privileged account.
You can try to reach your server in a browser by pointing it at http://localhost:8080, you should see a simple header that says “It works!”
Step 2 – Configure Apache
The Apache web server is running now on your macOS system. Now you will want to make some configuration changes according to your local development environment. A configuration file /usr/local/etc/httpd/httpd.conf is generated by the installer which you need to edit in a text editor and make following changes.
Set Apache Port
The Homebrew’s version of httpd uses port 8080. You have to manually change the listen port from the default of 8080 to standard port 80.
Change Document Root
Now, configure the document root for Apache. The default document root is set to “/usr/local/var/www”. You can keep the document root unchanged and put your website files to this document root. But I assume you want to change the document root to set to your home directory.
Change this to point to your user directory where your_user is the name of your user account:
You also need to change the <Directory> tag configured just right below the DocumentRoot line. This should also be changed to point to your new document root as well:
In that same <Directory> block you will find an AllowOverride option, Set this to all to enable the uses of the .htaccess file in Apache.
Enable Rewrite Module
Also, you should enable the mod_rewrite module by removing leading # symbol from the following line. Search the line and update it. this will enable URL rewrite on Apache.
Setup User & Group for Apache
As you have configured the Apache document root to your home directory. You will face issue for the permissions because, by default, Apache runs as the user daemon and group daemon (Maybe username and group are to _www). For the personal systems, You can change these to match your user account (replace user_name with your real username), with a group of staff.
Step 3 – Configure Application on Apache
Star wars clone wars adventures download mac. Let’s create a Sites folder in your home directory and create a sample index.html file for the testing.
Restart apache to ensure your configuration changes have taken effect:
Now, Point your browser to http://localhost, This should display your newly created index.html. All done.
Step 4 – Manage Apache Service
You now have installed Apache server, also configured it accordingly to your setup. The below command is used to stop, start, and restart Apache service
Mac Os Web Server
macOS Update: While these instructions still work, there are new posts for recent versions of macOS, the latest being Install Apache, PHP, and MySQL on macOS Mojave.
PHP Update: Mac OS X Yosemite comes pre-installed with PHP version 5.5 which has reached its end of life. After you complete this post, you should upgrade PHP on Mac OS X.
I recently upgraded to Mac OS X Yosemite. It seems Mac OS X Yosemite makes my original post on installing Apache, PHP, and MySQL on Mac OS X obsolete. Specifically, Yosemite includes Apache 2.4. This post is a complete update for installing Apache, PHP, and MySQL on Mac OS X Yosemite.
![]()
A reminder that Mac OS X runs atop UNIX. So most UNIX software installs easily on Mac OS X. Furthermore, Apache and PHP come packaged with Mac OS X. To create a local web server, all you need to do is enable them and install MySQL.
Wow patch 1.12.1 download mac. I am aware of the web server software available for Mac OS X, notably MAMP. These get you started quickly. But they forego the learning experience and, as most developers report, can become difficult to manage.
Getting Started
First, open the Terminal app and switch to the
root user to avoid permission issues while running these commands.
Enable Apache on Mac OS X
Verify It works! by accessing http://localhost
Enable PHP for Apache
First, make a backup of the default Apache configuration. This is good practice and serves as a comparison against future versions of Mac OS X.
Now edit the Apache configuration. Feel free to use TextEdit if you are not familiar with vi.
Download Apache Mac
Uncomment the following line (remove
# ):
Restart Apache:
You can verify PHP is enabled by creating a
phpinfo() page in your DocumentRoot .
The default
DocumentRoot for Mac OS X Yosemite is /Library/WebServer/Documents . You can verify this from your Apache configuration.
Apache Mac Os
Now create the
phpinfo() page in your DocumentRoot :
Verify PHP by accessing http://localhost/phpinfo.php
Apache Web Server Download For Mac Os XInstall MySQL on Mac OS X
Note: If you are upgrading MySQL you should skip this section and instead read this.
The README suggests creating aliases for
mysql and mysqladmin . However there are other commands that are helpful such as mysqldump . Instead, I updated my path to include /usr/local/mysql/bin .
Note: You will need to open a new Terminal window or run the command above for your path to update.
I also run
mysql_secure_installation . While this isn't necessary, it's good practice.
Connect PHP and MySQL
You need to ensure PHP and MySQL can communicate with one another. There are several options to do so. I do the following:
Apache Web Server Mac Os X Download Windows 10Additional Configuration (optional)
The default configuration for Apache 2.4 on Mac OS X seemed pretty lean. For example, common modules like
mod_rewrite were disabled. You may consider enabling this now to avoid forgetting they are disabled in the future.
I edited my Apache Configuration:
I uncommented the following lines (remove
# ):
Note: Previous version of Mac OS X ran Apache 2.2. If you upgraded OS X and previously configured Apache, you may want to read more about upgrading to to Apache 2.4 from Apache 2.2.
Apache Web Server Mac Os X Download Torrent
If you develop multiple projects and would like each to have a unique url, you can configure Apache VirtualHosts for Mac OS X.
If you would like to install PHPMyAdmin, return to my original post on installing Apache, PHP, and MySQL on Mac OS X.
Find this interesting? Let's continue the conversation on Twitter.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2020
Categories |