- 1. Enable php
find #LoadModule php5_module libexec/apache2/libphp5.so
remove #
- 2. Enable ssl
find #Include /private/etc/apache2/extra/httpd-ssl.conf
remove #
3. SSL
Create a Folder /etc/apache2/ssl
openssl genrsa -des3 -out server.key 1024
cp server.key server-pw.key
openssl rsa -in server-pw.key -out server.key
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csrsignkey server.key -out server.crt
4. Edit httpd-ssl.conf
sudo vi /etc/apache2/extra/httpd-ssl.conf
find key and crt setting and edit them.
5. Virtual Host
vi /etc/apache2/httpd.conf
find #Include /private/etc/apache2/extra/httpd-vhosts.conf
remove #
vi /etc/apache2/extra/httpd-vhosts.conf
NameVirtualHost *:80
NameVirtualHost *:443
Include /private/etc/apache2/vhosts/*.conf
mkdir /etc/apache2/vhosts
vi /etc/apache2/vhosts/ci.conf
<VirtualHost *:80>
ServerAdmin dev@namaksin.net
DocumentRoot "/Volumes/WS/website/CI/"
ServerName local.ci.com
ErrorLog "/private/var/log/apache2/local.ci.com-error_log"
CustomLog "/private/var/log/apache2/local.ci.com-access_log" common
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
HostNameLookups off
<Directory "/Volumes/WS/website/CI/">
AllowOverride None
Options -Indexes
Deny from all
Allow from localhost
</Directory>
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
</VirtualHost>
<VirtualHost *:443>
ServerAdmin dev@namaksin.net
DocumentRoot "/Volumes/WS/website/CI/"
ServerName local.ci.com
ErrorLog "/private/var/log/apache2/local.ci.com-error_log"
CustomLog "/private/var/log/apache2/local.ci.com-access_log" common
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
SSLEngine on
SSLCertificateFile /private/etc/apache2/ssl/server.crt
SSLCertificateKeyFile /private/etc/apache2/ssl/server.key
HostNameLookups off
<Directory "/Volumes/WS/website/CI/">
AllowOverride None
Options -Indexes
Deny from all
Allow from localhost
</Directory>
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
</VirtualHost>
6. setup mysql
install mysql-server
/usr/local/mysql/bin/mysql -uroot mysql
update user set Password = password('yourpassword') where user = 'root';
vi /etc/my.cnf
[client] socket = /var/mysql/mysql.sock
[mysqld] socket = /var/mysql/mysql.sock
sudo mkdir /var/mysql;
sudo chown _mysql /var/mysql;
