apache for mac?
苹果可以当服务器吗

解决方案 »

  1.   

    找到一个文章,但是不太明白,那位好心人翻译一下重要的部分。Unix/Mac OS X installs
    This section contains notes and hints specific to installing PHP on Mac OS X Server. Using Packages
    There are a few pre-packaged and pre-compiled versions of PHP for Mac OS X. This can help in setting up a standard configuration, but if you need to have a different set of features (such as a secure server, or a different database driver), you may need to build PHP and/or your web server yourself. If you are unfamiliar with building and compiling your own software, it's worth checking whether somebody has already built a packaged version of PHP with the features you need. Compiling for OS X server
    There are two slightly different versions of Mac OS X, client and server. The following is for OS X Server. 例子 3-2. Mac OS X server install1. Get the latest distributions of Apache and PHP
    2. Untar them, and run the configure program on Apache like so.
        ./configure --exec-prefix=/usr \ 
        --localstatedir=/var \ 
        --mandir=/usr/share/man \ 
        --libexecdir=/System/Library/Apache/Modules \ 
        --iconsdir=/System/Library/Apache/Icons \ 
        --includedir=/System/Library/Frameworks/Apache.framework/Versions/1.3/Headers \ 
        --enable-shared=max \ 
        --enable-module=most \ 
        --target=apache 4. You may also want to add this line: 
        setenv OPTIM=-O2 
        If you want the compiler to do some optimization. 
        
    5. Next, go to the PHP 4 source directory and configure it. 
        ./configure --prefix=/usr \ 
        --sysconfdir=/etc \ 
        --localstatedir=/var \ 
        --mandir=/usr/share/man \ 
        --with-xml \ 
        --with-apache=/src/apache_1.3.12     If you have any other additions (MySQL, GD, etc.), be sure to add
        them here. For the --with-apache string, put in the path to your 
        apache source directory, for example "/src/apache_1.3.12". 
    6. make
    7. make install    
        This will add a directory to your Apache source directory under
        src/modules/php4.
        
    8. Now, reconfigure Apache to build in PHP 4.
        ./configure --exec-prefix=/usr \ 
        --localstatedir=/var \ 
        --mandir=/usr/share/man \ 
        --libexecdir=/System/Library/Apache/Modules \ 
        --iconsdir=/System/Library/Apache/Icons \ 
        --includedir=/System/Library/Frameworks/Apache.framework/Versions/1.3/Headers \ 
        --enable-shared=max \ 
        --enable-module=most \ 
        --target=apache \ 
        --activate-module=src/modules/php4/libphp4.a     You may get a message telling you that libmodphp4.a is out of date.
        If so, go to the src/modules/php4 directory inside your apache
        source directory and run this command:     ranlib libmodphp4.a     Then go back to the root of the apache source directory and run the
        above configure command again. That'll bring the link table up to
        date. 9. make10. make install11. copy and rename the php.ini-dist file to your "bin" directory from your
        PHP 4 source directory:
        cp php.ini-dist /usr/local/bin/php.ini     or (if your don't have a local directory)     cp php.ini-dist /usr/bin/php.ini
     
     Other examples for Mac OS X client and Mac OS X server are available at Stepwise. Compiling for MacOS X client
    Those tips are graciously provided by Marc Liyanage. The PHP module for the Apache web server included in Mac OS X. This version includes support for the MySQL and PostgreSQL databases. NOTE: Be careful when you do this, you could screw up your Apache web server! Do this to install: 
    1. Open a terminal window 2. Type "wget http://www.diax.ch/users/liyanage/software/macosx/libphp4.so.gz", wait for download to finish 3. Type "gunzip libphp4.so.gz" 4. Type "sudo apxs -i -a -n php4 libphp4.so" Now type "sudo open -a TextEdit /etc/httpd/httpd.conf" TextEdit will open with the web server configuration file. Locate these two lines towards the end of the file: (Use the Find command) #AddType application/x-httpd-php .php 
       #AddType application/x-httpd-php-source .phps
     
    Remove the two hash s (#), then save the file and quit TextEdit. Finally, type "sudo apachectl graceful" to restart the web server. PHP should now be up and running. You can test it by dropping a file into your "Sites" folder which is called "test.php". Into that file, write this line: "<?php phpinfo() ?>". Now open up 127.0.0.1/~your_username/test.php in your web browser. You should see a status table with information about the PHP module.
      

  2.   

    晕,当年被学校逼着交600块去摸Mac.结果什么都摸不到。
    到现在都还不熟悉用它的单键。
      

  3.   

    单击单键就相当于普通鼠标的左键,按Control点单键相当于右键阿。我现在看得一头雾水,救救我吧。
      

  4.   

    上面的英文不难呀。
    说如果你弄一个简单server就可以,如果要特殊点的,就要自己去改写php
    下面就是步骤了。
    先装服端服务端再装客户端。
    看着英文我也烦。
      

  5.   

    mac的核心似乎是solaris?
    那因该和其他unix差不多的啊
      

  6.   

    呼呼,我在的这公司用的就是MAC OS X SERVER..基于FREEBSD的,不过好多命令都不支持,但是APACHE\PHP\MYSQL都有MAC的版本的~安装很简单的..配置也大多和LINUX,UNIX下面一样,最烦的是好多命令不支持...
      

  7.   

    MAC OS 自带了apache啊,你去控制台有一个网络设置,有apache网络服务设置选项的,我太长时间不摸AP了,你找找看吧有自带的.
      

  8.   

    现在出来了,只是中文乱马?
    不知道mysql的字符集是怎么 更该的?