MacOS

来自开放百科 - 灰狐
跳转到: 导航, 搜索

Mac OS X 是苹果公司(原苹果电脑公司)为麦金塔电脑开发的专属操作系统Mac OS的最新版本。Mac OS X于2001年首次在市场上推出,并从2002年起随麦金塔电脑发售。它是一套Unix基础的操作系统,包含两个主要的部份:核心名为Darwin,是以FreeBSD源代码和Mach微核心为基础,由苹果公司和独立开发者社区协力开发;及一个由苹果电脑开发,名为Aqua之专有版权的图形用户界面。

目录

版本

  • macOS 10.12 Sierra
  • OS X 10.11 El Capitan
  • OS X 10.10 Yosemite
  • OS X 10.9 (Mavericks)巨浪
  • OS X 10.8(Mountain Lion)美洲狮
  • OS X 10.7(Lion)狮子
  • Mac OS X 10.6(Snow Leopard)雪豹
  • Mac OS X 10.5(Leopard)豹
  • Mac OS X 10.4(Tiger)老虎
  • Mac OS X 10.3(Panther)黑豹
  • Mac OS X 10.2(Jaguar)美洲虎
  • Mac OS X 10.1(Puma)美洲豹
  • Mac OS X 10.0(Cheetah)猎豹

安全

Wikipedia-35x35.png 您可以在Wikipedia上了解到此条目的英文信息 MacOS Thanks, Wikipedia.

Security

Brew

通过 Homebrew 安装软件包。

Port

安装 MacPorts

cd MacPorts-2.0.3
./configure && make && sudo make install
add /opt/local/bin to your PATH
vim /etc/profile
export PATH=/opt/local/bin:$PATH
sudo port selfupdate
sudo port upgrade outdated
port list
port search php5
port info php5
port deps php5
port variants php5
sudo port install nmap
sudo port clean --all nmap
sudo port uninstall nmap
port installed
port -v installed nmap
port outdated
sudo port upgrade nmap
port dependents openssl
port livecheck rrdtool 
...

Windows

Mac OS X 与 Windows 的集成

让MAC OS X 访问 Windows 共享文件

Visual Studio

Visual Studio for Mac

Web Server

Nginx

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.21.zip
./config --prefix=/usr/local
make 
sudo make install
wget http://nginx.org/download/nginx-1.0.10.tar.gz
./config --prefix=/usr/local --with-http_ssl_module
make 
sudo make install
cd /usr/local/nginx/sbin
sudo ./nginx

Apache

sudo port install apache2
sudo vim /etc/apache2/httpd.conf
LoadModule php5_module libexec/apache2/libphp5.so
#PHP Settings
<IfModule php5_module>
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
</IfModule>
sudo httpd -k start
sudo apachectl restart

first.cgi

#!/usr/bin/perl -wT
 print "Content-type: text/html\n\n";
 print "<h2>Hello, World!</h2>\n";

[Sat Dec 06 14:37:43 2014] [notice] Apache/2.2.26 (Unix) PHP/5.4.30 DAV/2 mod_ssl/2.2.26 OpenSSL/0.9.8za mod_perl/2.0.7 Perl/v5.16.2 configured -- resuming normal operations [Sat Dec 06 14:37:52 2014] [error] [client ::1] Options ExecCGI is off in this directory: /Library/WebServer/Documents/first.cgi

Database

PostgreSQL

Homebrew维护着最新版本PostgreSQL的安装 或者通过 MacPorts 方式安装。

port search postgresql // 选择要安装的版本
sudo port install postgresql91
sudo port install postgresql91-server
sudo mkdir -p /opt/local/var/db/postgresql91/defaultdb
sudo chown postgres:postgres /opt/local/var/db/postgresql91/defaultdb
sudo su postgres -c '/opt/local/lib/postgresql91/bin/initdb -D /opt/local/var/db/postgresql91/defaultdb'
sudo su postgres
/opt/local/lib/postgresql91/bin/postgres -D /opt/local/var/db/postgresql91/defaultdb &
or 
/opt/local/lib/postgresql91/bin/pg_ctl -D /opt/local/var/db/postgresql91/defaultdb -l logfile start

MySQL

安装 MariaDB

NoSQL

LLVM

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
ls *llvm-gcc*
arm-apple-darwin10-llvm-gcc-4.2		llvm-gcc
i686-apple-darwin10-llvm-gcc-4.2	llvm-gcc-4.2
port info llvm
llvm @2.9, Revision 2 (lang)
Replaced by:          llvm-2.9
Variants:             universal
wget http://llvm.org/releases/3.1/clang+llvm-3.1-x86_64-apple-darwin11.tar.gz
 ./llc --version
 LLVM (http://llvm.org/):
 LLVM version 3.1
 ...
sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2
sudo ln -s /usr/bin/llvm-g++-4.2 /usr/bin/g++-4.2

PHP

https://php-osx.liip.ch/

curl -s https://php-osx.liip.ch/install.sh | bash -s 7.3
curl -s https://php-osx.liip.ch/install.sh | bash -s 7.2

创建符号链接 /usr/local/php5/entropy-php.conf /etc/apache2/other/+php-osx.conf

vim ~/.profile file and add the following

export PATH=/usr/local/php5/bin:$PATH

php.ini

php -i | grep php.ini
/usr/local/php5/lib/php.ini

Java

vi /etc/profile

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home
export JAVA_HOME
export PATH=/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/bin:$PATH
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/
export USER_MEM_ARGS="-Xmx1024m -XX:MaxPermSize=256m"
export MW_HOME=/Users/huihoo/Software/weblogic // WebLogic
export WL_HOME=/Users/huihoo/Software/weblogic/wlserver


No Java runtime present, requesting install. 的解决方法

Java for OS X Lion Update 1 updating Java SE 6 to 1.6.0_29.

xcode-select

不用安装Xcode,只需要安装下载安装类似工具包:Command_Line_Tools_macOS_10.14_for_Xcode_10.1.dmg 就能完成一些源代码编译工作。

sudo xcode-select -switch /Library/Developer/CommandLineTools

技巧

macOS 版本

$> sw_vers -productVersion

修改主机名:sudo scutil --set HostName 主机名

我在设备中运行Xcode,安装 iOS 5.0 Simulator 出现以下错误,需要将Xcode安装到应用程序里,就OK了。

chmod: Unable to change file mode on Xcode: Read-only file system

安装postgresql-9.1.5-1-osx出现以下错误:

Your system seems to be configured with a setting for SHMALL which is less than SHMMAX/4096. Please see the installer README file for more information on how to configure shared memory settings.

设置共享内存

sysctl -A | grep shm
kern.sysv.shmmax: 4194304
kern.sysv.shmmin: 1
kern.sysv.shmmni: 32
kern.sysv.shmseg: 8
kern.sysv.shmall: 1024
sudo vim /etc/sysctl.conf

DNS屏蔽开启

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

X11

X11 不包含在 OS X,但 X11 服务端和客户端软件包可通过 XQuartz 项目获得。

图集

链接

Mac OS X Leopard 10.5.5 VMware Image

Comment-32x32.png

<discussion>characters_max=300</discussion>

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱