sudo pico /etc/hosts

127.0.0.1       localhost
127.0.0.1       albatros.project.aripd.com

sudo pico /etc/apache2/httpd.conf

Include /private/etc/apache2/extra/httpd-vhosts.conf
Include /private/etc/apache2/extra/httpd-ssl.conf

sudo pico /etc/apache2/extra/httpd-vhosts.conf

NameVirtualHost *:80
<VirtualHost *:80>
    #DocumentRoot "/Library/WebServer/Documents"
    DocumentRoot "/Users/cem/NetBeansProjects"
    ServerName localhost

    # Custom log file
    Loglevel warn
    ErrorLog /Users/cem/Documents/wwwlogs/localhost/error.log
    CustomLog /Users/cem/Documents/wwwlogs/localhost/access.log combined

    <Directory /Users/cem/NetBeansProjects>
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot "/Users/cem/NetBeansProjects/albatros/web"
    ServerName albatros.project.aripd.com

    # Custom log file
    Loglevel warn
    ErrorLog /Users/cem/Documents/wwwlogs/albatros/error.log
    CustomLog /Users/cem/Documents/wwwlogs/albatros/access.log combined

    <Directory /Users/cem/NetBeansProjects/albatros/web>
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all

        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.*)$ app.php [QSA,L]
    </Directory>
</VirtualHost>

sudo pico /etc/apache2/extra/httpd-ssl.conf

Listen 443
NameVirtualHost *:443
<VirtualHost *:443>
    #DocumentRoot "/Library/WebServer/Documents"
    DocumentRoot "/Users/cem/NetBeansProjects"
    ServerName localhost

    # Custom log file
    Loglevel warn
    ErrorLog /Users/cem/Documents/wwwlogs/localhost/error.log
    CustomLog /Users/cem/Documents/wwwlogs/localhost/access.log combined

    <Directory /Users/cem/NetBeansProjects>
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

    # SSL Configuration
    SSLEngine on
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SSLCertificateFile /etc/apache2/ssl/localhost.crt
    SSLCertificateKeyFile /etc/apache2/ssl/localhost.key
</VirtualHost>
<VirtualHost *:443>
    DocumentRoot "/Users/cem/NetBeansProjects/albatros/web"
    ServerName albatros.project.aripd.com

    # Custom log file
    Loglevel warn
    ErrorLog /Users/cem/Documents/wwwlogs/albatros/error.log
    CustomLog /Users/cem/Documents/wwwlogs/albatros/access.log combined

    <Directory /Users/cem/NetBeansProjects/albatros/web>
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all

        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.*)$ app.php [QSA,L]
    </Directory>

    # SSL Configuration
    SSLEngine on
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SSLCertificateFile /etc/apache2/ssl/localhost.crt
    SSLCertificateKeyFile /etc/apache2/ssl/localhost.key
</VirtualHost>

Apache SSL on Mac OSX

Generating a host key

sudo mkdir /private/etc/apache2/ssl
cd /private/etc/apache2/ssl
sudo ssh-keygen -f localhost.key

Generating a certificate request file (Please note that you shouldn’t set a pass phrase on the certificate, just leave this blank when it asks for a pass phrase)

sudo openssl req -new -key localhost.key -out request.csr

Create a self signed SSL certificate using the request file

sudo openssl x509 -req -days 365 -in request.csr -signkey localhost.key -out localhost.crt
sudo apachectl configtest
sudo apachectl restart