Archive | April, 2014

Configure HTTPs on Localhost for testing purposes on MAC OS

11 Apr

Step 1: Generate a Private Key

 openssl genrsa -des3 -out ssl.key 1024

Step 2: Generate a CSR 

openssl req -new -key ssl.key -out ssl.csr

Step 3: Remove Passphrase from key

cp ssl.key ssl.key.org
openssl rsa -in ssl.key.org -out ssl.key

Step 4: Generating a Self-Signed Certificate

openssl x509 -req -days 365 -in ssl.csr -signkey ssl.key -out ssl.crt

Step 5: 

   OPEN /private/etc/apache2/httpd.conf

   UNCOMMENT the line LoadModule ssl_module libexec/apache2/mod_ssl.so by removing # in front of it

   UNCOMMENT the line Include /private/etc/apache2/extra/httpd-ssl.conf

   OPEN  /private/etc/apache2/extra/httpd-ssl.conf

   UPDATE  DocumentRoot to your website path

   UPDATE ServerName to Localhost

   COMMENT SSLCACertificatePath‘ and ‘SSLCARevocationPath’ if there,

   MAKE A FOLDER in /private/etc/apache2/ with name ssl

   COPY ssl.crt and ssl.key in ssl folder

   UPDATE SSLCertificateFile with  /private/etc/apache2/ssl/ssl.crt

   UPDATE SSLCertificateKeyFile with  “/private/etc/apache2/ssl/ssl.key”

   THEN sudo apachectl restart

 

Enjoy

Changing Document Root of Apache on mac OS (10.8)

11 Apr
  1. Go to /etc/private/httpd.conf
  2. sudo vim httpd.conf (Cannot edit in Readonly mode)
  3. Type /DocumentRoot to find Document Root in the file
  4. Change the file path to what you need
  5. save the file by :wq if you have vim
  6. sudo apachectl restart
  7. Go to localhost/index.html or any file on the given path

Announcing Portia, the open source visual web scraper!

2 Apr

awesomeness