Changes between Version 81 and Version 82 of howto/MAMP


Ignore:
Timestamp:
Dec 28, 2014, 9:20:54 PM (9 years ago)
Author:
magill@…
Comment:

cosmetics

Legend:

Unmodified
Added
Removed
Modified
  • howto/MAMP

    v81 v82  
    3232A sample configuration file is provided in `/opt/local/apache2/conf/original/httpd.conf`. Don't edit this file; leave it as is so you can refer to the defaults later. The first time you install apache2, the sample configuration file will be copied to `/opt/local/apache2/conf/httpd.conf` for you. You can edit this file as desired. When you later upgrade apache2 to a newer version, MacPorts will upgrade the sample configuration file but will not modify your `httpd.conf`, so be sure to manually compare your `httpd.conf` with the new sample configuration file and bring over any relevant changes. You should also keep backup copies of your `httpd.conf` in a safe place.
    3333
    34 === Verify your config file ===
     34== 2A:  Verify your config file ==
    3535Verify any changes you have made to the config file: /opt/local/apache2/conf/httpd.conf
    3636{{{
     
    3939This will return either "Syntax OK" or a specific line by line error listing.
    4040
    41 === Activate Apache2 ===
     41==  2B: Activate Apache2 ==
    4242Activate your Apache installation so that it starts now and every time you boot your machine:
    4343
     
    6262to start it again.
    6363
    64 The default log file location is: /opt/local/apache2/logs/. The startup will be logged in "error_log"
    65 
    66 === Initial changes to the config file ===
     64The default log file location is: '''/opt/local/apache2/logs/'''. The startup will be logged in "'''error_log'''"
     65
     66== 2C: Initial changes to the config file ==
     67Once you have determined that your basic installation is working, you need to consider making some initial changes to your config file.
     68
     69After each change to the config file, you should again verify the file syntax, and then you need to stop and restart Apache for the changes to take effect.
     70
     71{{{
     72/opt/local/apache2/bin/apachectl -t
     73sudo port unload apache2
     74sudo port load apache2
     75}}}
     76In Apache documentation (including this page), you will see the use of "apachectl -k restart" described as the method to cause the config file to be re-read.
     77
     78However, the purpose of launchd is to notice processes that stop without its knowledge, and to restart them. So if you use apachectl -k restart, launchd may notice apache "crashing" and restart it itself, confusing apachectl. Instead, you shoulduse "port" to tell launchctl to unload apache2, then load it again. This will result in a short interruption of service.
    6779
    6880If the sever name is not set properly in the configuration file, `/opt/local/apache2/conf/httpd.conf`, you will encounter the warning below.
     
    8395
    8496'''NOTE:''' If you have set "ServerName" to be anything other than "localhost" the links above to "localhost" will fail with Safari complaining "''Failed to open page. Safari can't open the page "localhost" because Safari can't connect to the server "localhost".''
    85 == User directories == #userdir
     97=== User directories === #userdir
    8698
    8799If you would like to be able to access web pages in the Sites directory of your home directory, edit `/opt/local/apache2/conf/httpd.conf` and locate the following line:
     
    132144to start it again.
    133145
    134 == Local Apache manual == #manual
     146=== Local Apache manual === #manual
    135147
    136148The [http://httpd.apache.org/docs/2.2/ Apache manual] is available on the Apache web site. If you would like to be able to access a copy of this manual on your web server, edit `/opt/local/apache2/conf/httpd.conf` and uncomment the following line:
     
    148160Restart Apache using `sudo /opt/local/apache2/bin/apachectl -k restart` to make this change take effect. You can then view the manual by accessing http://localhost/manual/.
    149161
    150 == Secure Sockets (https) == #ssl
     162=== Secure Sockets (https) === #ssl
    151163
    152164This works for a development system (not recommended for production!).