Changes between Initial Version and Version 1 of howto/MAMP


Ignore:
Timestamp:
May 31, 2008, 9:50:58 PM (16 years ago)
Author:
jaguarcy+macports@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • howto/MAMP

    v1 v1  
     1[wiki:howto <- Back to the HOWTO section]
     2
     3= Getting Apache, MySQL, and PHP Running under MacPorts =
     4
     5 * Audience: Users who don't like the default OS X installation
     6 * Requires: MacPorts
     7
     8== Introduction ==
     9
     10Some networks and proxies prevent or break the use of rsync or svn via http. For people on these networks, getting an updated port tree can be difficult. The rsync server makes a tarball daily and stores it on www.macports.org.
     11
     12These instructions are written for the following versions:
     13
     14 * Apache 2.2.*
     15 * MySQL 5.0.*
     16 * PHP 5.2.*
     17
     18== Installation ==
     19
     20=== Step 1: '''Turn off Apple's "Personal Web Sharing"''' ===
     21
     22If you haven't already done so, make sure you turn off Apple's "Personal Web Sharing" in the System Preferences so that the default Apache server is not running. While you can set things up so that both servers run on different ports (e.g., port 80 and port 8080), it's not worth the hassle of maintaining two web server daemons. Just use the latest Apache from MacPorts and be done with it.
     23
     24=== Step 2: Install Apache ===
     25
     26{{{
     27sudo port install apache2
     28}}}
     29
     30Create an initial httpd.conf configuration file:
     31
     32{{{
     33cd /opt/local/apache2/conf
     34sudo cp httpd.conf.sample httpd.conf
     35}}}
     36
     37Activate your Apache installation so that it autostarts when you boot your machine:
     38
     39{{{
     40sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist
     41}}}
     42
     43Start Apache (the previous step only activates the autostart; it didn't start it for the current boot cycle):
     44
     45{{{
     46sudo /opt/local/apache2/bin/apachectl -k start
     47}}}
     48
     49Point your browser to http://localhost/ and verify that Apache is running. (For Apache 2.2.8, you should see a giant "It works!" displayed.)
     50
     51Reboot your machine, point your browser again to http://localhost/, and verify that Apache has started and is running.
     52
     53You may want to enable local access to the "Apache HTTP Server Manual" and to User web pages. In {{{/opt/local/apache2/conf/httpd.conf}}}, uncomment the lines:
     54
     55{{{
     56Include conf/extra/httpd-userdir.conf
     57}}}
     58
     59and
     60
     61{{{
     62Include conf/extra/httpd-manual.conf
     63}}}
     64
     65In {{{/opt/local/apache2/conf/extra/httpd-userdir.conf}}}, change the line
     66
     67{{{
     68UserDir public_html
     69}}}
     70
     71to
     72
     73{{{
     74UserDir Sites
     75}}}
     76
     77(this may already be done for you by the MacPorts installation) and add the following lines to the end of the file:
     78
     79{{{
     80#
     81# Include user configurations
     82#
     83Include /private/etc/httpd/users/*.conf
     84}}}
     85
     86Restart Apache ({{{sudo /opt/local/apache2/bin/apachectl -k restart}}}) and verify that everything's running. You should now be able to go to http://localhost/manual/ to access the manual, and you should be able to access your personal user web site at http://localhost/~username/, where "username" is your login id.
     87
     88[wiki:howto <- Back to the HOWTO section]