Changes between Version 81 and Version 82 of howto/MAMP
- Timestamp:
- Dec 28, 2014, 9:20:54 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
howto/MAMP
v81 v82 32 32 A 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. 33 33 34 == = Verify your config file ===34 == 2A: Verify your config file == 35 35 Verify any changes you have made to the config file: /opt/local/apache2/conf/httpd.conf 36 36 {{{ … … 39 39 This will return either "Syntax OK" or a specific line by line error listing. 40 40 41 == = Activate Apache2 ===41 == 2B: Activate Apache2 == 42 42 Activate your Apache installation so that it starts now and every time you boot your machine: 43 43 … … 62 62 to start it again. 63 63 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 === 64 The 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 == 67 Once you have determined that your basic installation is working, you need to consider making some initial changes to your config file. 68 69 After 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 73 sudo port unload apache2 74 sudo port load apache2 75 }}} 76 In 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 78 However, 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. 67 79 68 80 If the sever name is not set properly in the configuration file, `/opt/local/apache2/conf/httpd.conf`, you will encounter the warning below. … … 83 95 84 96 '''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== #userdir97 === User directories === #userdir 86 98 87 99 If 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: … … 132 144 to start it again. 133 145 134 == Local Apache manual== #manual146 === Local Apache manual === #manual 135 147 136 148 The [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: … … 148 160 Restart 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/. 149 161 150 == Secure Sockets (https)== #ssl162 === Secure Sockets (https) === #ssl 151 163 152 164 This works for a development system (not recommended for production!).