MacOS

来自开放百科 - 灰狐
2014年12月6日 (六) 06:36Allen (讨论 | 贡献)的版本

跳转到: 导航, 搜索
Wikipedia-35x35.png 您可以在Wikipedia上了解到此条目的英文信息 MacOS Thanks, Wikipedia.

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

雪豹

目录

安全

Security

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 共享文件

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 "

Hello, World!

\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

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

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

Java

vi /etc/profile

JAVA_HOME=/Library/Java/JavaVirtualMachines/JDK 1.7.0 Developer Preview.jdk/Contents/Home
export JAVA_HOME
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,安装 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>

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

变换
操作
导航
工具箱