Saturday, October 3, 2009

osx leopard install apache mysql memcache php memcache

1] install ports (similar to fedora's yum)
http://www.macports.org/

Memcached


2] #sudo port install memcached libmemcached

PHP


3] #sudo port install php5-memcache
4] #sudo port install php5-mysql
5] #vi /opt/local/etc/php5/php.ini
make sure socket location is /tmp/mysql.sock

Apache


6] #cd /opt/local/apache2/modules
#sudo /opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so
[activating module 'php5' in /opt/local/apache2/conf/httpd.conf]
7] #vi /opt/local/apache2/conf/httpd.conf
add these lines:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

find line: DirectoryIndex and append index.php to line

8] #vi ~/.profile
Add this line:
alias httpdstart='sudo /opt/local/apache2/bin/apachectl start'
alias httpdstop='sudo /opt/local/apache2/bin/apachectl stop'

8b] autostart
#sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist

9] #source ~/.profile
10] apachectl start

11] check your http://localhost

MYSQL


12] #sudo port install mysql5-server

follow directions to setup new database
if server is not starting move /etc/my.cnf to /etc/my.cnf.old
13] autostart mysql
#sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
14] edit /etc/my.cnf change socket location to /tmp/mysql.sock

PHPMyadmin


15] #sudo port install phpmyadmin
Update Apache’s httpd.conf file to find phpmyadmin. First add the following lines to the end of the file:

# Local access to phpmyadmin installation
Include conf/extra/httpd-phpmyadmin.conf

and then create a file /opt/local/apache2/conf/extra/httpd-phpmyadmin.conf containing this text:

AliasMatch ^/phpmyadmin(?:/)?(/.*)?$ "/opt/local/www/phpmyadmin$1"


Options -Indexes
AllowOverride None
Order allow,deny
Allow from all

LanguagePriority en de es fr ja ko pt-br ru
ForceLanguagePriority Prefer Fallback






other:
http://trac.macports.org/wiki/howto/MAMP
http://2tbsp.com/content/install_apache_2_and_php_5_macports

No comments: