Working on multiple Web Projects on the same system might become a headache to manage. You must use Virtual Hosts if you are using Apache as pointed out by David Kiss. Following are the steps required to create a Virtual Host called magento in your system such that when you type http://magento the site is displayed, as per Mac OS X Lion using MAMP:
Backup your files.
Open a terminal window.
Backup your hosts file:
sudo cp /private/etc/hosts /private/etc/hosts.bak
Backup your Apache configuration file:
cp /Applications/MAMP/conf/apache/httpd.conf /Applications/MAMP/conf/apache/httpd.conf.bak
Backup your Virtual Hosts configuration file:
cp /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf.bak
Update the hosts file.
Edit the hosts file:
sudo nano /private/etc/hosts
Add the name of the Virtual Host you want on your system:
127.0.0.1 magento
Save and exit:
Press Ctrl+X then Y.
Update the Apache configuration file.
Edit the Apache configuration file:
nano /Applications/MAMP/conf/apache/httpd.conf
Un-comment the line where httpd-vhosts.conf is found such that it looks like this:
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
Save and exit:
Press Ctrl-W then Y
Update the Virtual Hosts configuration file.
Edit the configuration file:
nano /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
At the end add the following:
<VirtualHost *:80>
ServerName magento
DocumentRoot /Users/fraki/Sites/magento
</VirtualHost>
After self-signing an SSL certificate for development purposes the Web server needs to be configured appropriately. I found the posting by Dave Kiss to be the best one. Following are the required steps if you used the default MAMP settings:
Backup your configuration files:
Open a terminal window.
Go to the Apache configuration folder:
cd /Applications/MAMP/conf/apache
Backup the Apache configuration file:
cp httpd.conf httpd.conf.bak
Backup the SSL configuration file:
cp extra/httpd-ssl.conf extra/httpd-ssl.conf.bak
Update the Apache configuration file:
Open the configuration file using an editor of your choice:
nano httpd.conf
Search for the line containing httpd-ssl.conf:
Press Ctrl-W then type httpd-ssl.conf
Uncomment the line by removing the # from the beginning such that it reads:
Include /Applications/MAMP/conf/apache/extra/httpd-ssl.conf
Save and exit:
Press Ctrl-X the Y
Copy the server.key and server.crt file to your Apache configuration folder.
Start the servers through the MAMP interface.
Navigate to your site through a browser using https:
https://localhost
N.B. If the apache server fails to start then you have an error in your configuration, make sure you replace the DocumentRoot in your SSL configuration file to match your actual root folder.
N.B. Dave’s post also contains steps to configure Virtual Hosts which I left out for a different posting to be less confusing.
N.B. Dave’s post using git to backup the files, in this post I simply make a copy of the configuration file, if you want to restore the backup simply type: cp httpd.conf.bak httpd.conf or any other file you want to restore.
Installing MAMP on Mac OS X Lion is surely an easy way of getting Apache, PHP and MySQL working on your system. If you plan on using MySQL Workbench you will need to do some additional steps.
Create the missing my.cnf file.
Open a terminal window.
Create the file by typing:
sudo touch /etc/my.cnf
Change the owner of the file to your username:
sudo chown fraki /etc/my.cnf
If you are planning on developing or customizing some web systems such as WordPress or Magento, then at one point you will need some security. You might want to sign the SSL certificate yourself. A number of guides exists for this, for Windows Systems I found the one by Shivprasad Koirala to be very intuitive and for Unix systems the one by Heroku and Scott Baker are best. Here are the steps required:
Check that openssl is installed by running the following command in a terminal:
which openssl
If no such file is found then you need to install. Here are the possible installation methods
Linux (Debian/Ubuntu Variants) – Guide – sudo apt-get install openssl
Linux (RedHat Variants) – Guide – yum install openssl
Generate the keys for the Certificate Authority
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 3650 -key ca.key -out ca.crt
Generate the private key for your server
openssl genrsa -des3 -out server.key 4096
Create the certificate signing request to be signed (leave challenge password and organization name empty)
openssl req -new -key server.key -out server.csr
Another task that I needed to do after buying my Mac was to get my Web toolkit working. Apache, MySQL and PHP are very conveniently managed by MAMP, WordPress is as straight forward as always. MySQL Workbench required some fine tuning but managed to fix it properly.
Decided to document everything as I went along and prepared a well documented guide with some of my personal recommendations. Hope you will find it useful and as always all feedback is welcome.
One of my first tasks I wanted to be able to do after getting my Mac was to be able to remotely connect to my servers and a number of other trusted systems for support. I wanted to try a number of options and my first serious attempt was with TeamViewer.
My Laptop is a Mac, my Home-PC is Ubuntu Linux and my wife uses Windows XP. I installed version 7.0 of TeamViewer on each OS and got remote access in no time. Thought of creating a short guide on the subject even though the application is very self intuitive.
So here is the guide to getting remote access across different Operating Systems using TeamViewer: TeamViewer Guide
One of the first problems I encountered on my Mac was how to manage some external drives using NTFS. After reading a number of blogs, postings and articles I found the one by Sergey Vasilyev to be the best. The following is a quick guide to getting NTFS read/write support on OSX Lion.
Tuxera MacFuse 2.2: Download Tuxera MacFuse 2.2 from here and install.
fuse_wait: Update the fuse_wait script by downloading and installing the setup from here.
Next time you connect a storage device with NTFS you should be able to read/write from/to it.
Do note that there are a number of paid alternatives and a more detailed explanation can be found in the original blog of Sergey Vasilyev at http://blog.nolar.info/ntfs-3g-in-mac-os-x-lion-10-7-with-read-write-support/
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.