swsrl 发表于 2015-12-30 14:04:48

Mac OS X

  Mac has his own server, you can start or stop it like this:



sudo apachectl start/stop
  
  Its locations :



serve files location : Library/WebServer/
software files location : /usr/libexec/apache2/

  
  You can set you own serve location/directory :

1 cd /etc/apache2/users/
2 vim ./{username}.conf


<Directory "/Users/{username}/Sites">
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
4 chmod 755 ./{username}.conf
5 sudo mkdir ~/Sites
6 browser


http://localhost/~{username}
Then it works . But do not forget the character '~'
'~/Sites'directory will be the user level tomcat server directory , while '/Library/WebServer/Documents' is the directory of system level.

  
There is a good Reference here : Install and configure Apache, MySQL, PHP and phpMyAdmin on OSX 10.8 Mountain Lion
  
  
页: [1]
查看完整版本: Mac OS X