phpinfo in the shell

php -i

bitnami LAMP – why is mod_rewrite not working

Yes it is enabled by default but make sure your framework or app httpd-app.conf has AllowOverride set to All.

<directory "..."> 
 ... 
 AllowOverride All 
 ... 
</directory>

For Codeigniter, make sure your .htaccess is in the same dir as your root index.php.

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

git clone on remote server (bitnami)

1. Find the .ssh directory
-make sure always use absolute

$ cd /home/bitnami/.ssh

 

2. Generate public and private keys on the server

ssh-keygen

 

3. Copy the public key to your repo settings (bitbucket/github)

$ cat id_rsa.pub

 

4. Try and clone the repo into the server!

$ git clone git@bitbucket.org:username/project-name.git

self assigned SSL

How to create a ssl certificate on apache for ubuntu.

sudo openssl req -x509 -nodes -days 999 -newkey rsa:2048 -keyout server.key -out server.crt

httpd-vhosts.conf

<VirtualHost *:80>
  ServerName prs-api0.cloudapp.net
  ServerAlias www.prs-api0.cloudapp.net
  DocumentRoot "/opt/bitnami/apps/{myapp}/htdocs/"
  Include "/opt/bitnami/frameworks/photo/conf/httpd-app.conf"
</VirtualHost>

<VirtualHost *:443>
  ServerName codeigniter.example.com
  ServerAlias www.codeigniter.example.com
  DocumentRoot "/opt/bitnami/apps/{myapp}/htdocs/"

  SSLEngine on
  SSLCertificateFile "/opt/bitnami/frameworks/codeigniter/conf/certs/server.crt"
  SSLCertificateKeyFile "/opt/bitnami/frameworks/codeigniter/conf/certs/server.key"
  Include "/opt/bitnami/frameworks/codeigniter/conf/httpd-app.conf"
</VirtualHost>

new relic – php agent

Why isn’t the PHP agent for monitoring my Apps working?

We need to manually start it!

 

1. Install the agent.

apt-get install newrelic-php5

 

2. Start newrelic PHP daemon.

If you get this error, then go to step 3.

INFO: newrelic.cfg not found - daemon must be launched by the agent.

 

3. newrelic daemon failed to start because it could not find $ /etc/newrelic/newrelic.cfg. Make a copy of newrelic.cfg.template and rename it.

 

4. try start newrelic-daemon again:

/etc/init.d/newrelic-daemon start

 

5. Restart your web server or FastCGI Process Manager (FPM) as you normally would.


nano

search

ctrl + w

deleting mail in terminal

Get rid of the “You have new mail” in terminal!

$ mail
$ delete 1-30
$ q

Make sure do to the q after the delete 1-* command, that saves the changes to disk.


converting .VMDK to .VHD

Download the LAMP VM image from bitnami. This will be a zip file with vmdk(s).

Extract and convert .vmdk to .vhd for azure upload.


azure mysql

restart mysql

sudo /opt/bitnami/ctlscript.sh start
sudo /opt/bitnami/ctlscript.sh start mysql
sudo /opt/bitnami/ctlscript.sh restart mysql

list sql connections?

ps aux | grep mysql

status

sudo /opt/bitnami/ctlscript.sh status