Search

Пользовательский поиск

Thursday, 8 September 2011

Install a self-signed certificate for testing HTTPS/SSL

U should create  three files:
  •  a self-signed certificate file (ssl-cert.crt), which  is used by Browser.
  •  a public key file(ssl-cert.pfx) with proof of identity for signed and/or encrypted message, which  is used by Browser. The public key can be derived from its corresponding private key.
  • a privet key file(ssl-cert-private.key),  which is used by Apache.
How to Create the SSL X.509 Certificates? 


 Import certificate into Google Chrome (other browsers - try to figure it out on your own):
  • Go to Preferences, click "Under the hood".
  • Under HTTPS/SSL, click on "Manage Certificates".
  • Click "Import..." and import your ssl-cert.pfx file. Your certificate should appear now in the list of "Your Certificates".
  • Go to "Authorities", click "Import.." and import your ssl-cert.crt file. The name should now appear under the list of Authorities.
Configure Apache to work with SSL
  • Execute: 
           sudo cp ssl-cert.crt /etc/ssl/certs; 
           sudo cp ssl-cert-private.key /etc/ssl/private/ 
           sudo a2enmod ssl
           cd /etc/apache2/sites-enabled/; 
           sudo ln -s ../sites-available/default-ssl 000-default-ssl
  • Edit /etc/apache2/sites-available/
default-ssl, and replace the following lines:         SSLCertificateFile    /etc/ssl/certs/ssl-cert-



snakeoil.pem
        SSLCertificateKeyFile /etc/ssl/private/ssl-cert-



snakeoil.key
  • With the following lines:
       #SSLCertificateFile    /etc/ssl/certs/ssl-cert-



snakeoil.pem
         SSLCertificateFile /etc/ssl/certs/ssl-cert.crt
      #SSLCertificateKeyFile /etc/ssl/private/ssl-cert-



snakeoil.key
        SSLCertificateKeyFile /etc/ssl/private/ssl-cert-



private.key 
  • Restart Apache by executing the following command: 
        sudo service apache2 restart 


Now when you access the website your certificate should be valid.

Friday, 29 July 2011

Installing Zend Framework

You have many ways to start up the Zend Framework ,
I will describe in detail a few of them 



1. One way of them:

  sudo apt-get install zend-framework-bin



 2 Second way "Do it yourself":

First of all you'll need download the package:

   ZF 1.11.9 Minimal( zip , tar.gz )

Create a zend directory:

   mkdir zend

Extracting the files from a tar file:


   tar -xvf /home/umitay/Downloads/ZendFramework-1.11.9.tar.gz

Begin install the Zend_Tool:
 
    sudo cp bin/*  /usr/bin 

    ln -s /usr/bin/zf.sh  /usr/bin/zf

To run Zend_tool use the zf command



Additional notes

I would like that  all your projects  would have used one source.
For this purpose you need to copy "Zend" folder from library into php include path.

Get include path:
 php -i | grep include_path
 sudo cp -r Zend   /usr/share/php/

zf show version

cd /var/www

zf create project your_pr_name 

Including modules
sudo a2enmod rewrite

Including site

sudo nano /sites-available/your_pr_name

Paste
<VirtualHost *:80>
        ServerNameyour_pr_name
        DocumentRoot /var/www/yuor_pr_name/public
        SetEnv APPLICATION_ENV "development"
        AccessFileName /var/www/your_pr_name /public/.htaccess
        <Directory /var/www/links/your_pr_name/public>
            DirectoryIndex index.php
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
 </VirtualHost>




sudo a2ensite  your_pr_name
sudo nano /etc/hosts/ 
sudo apache2ctl restart



Monday, 25 July 2011

Amazon MP3

Wednesday, 6 July 2011

Steps To Transfer a Website


1 Create a TAR archive:
tar -czvf website.co.il.tar.gz  website.co.il


2 Securely Transferring file between a local and a remote host:
scp website.co.il.tar.gzroot@00.000.000.000:~/tmp

3 Connect to a server:
ssh root@00.000.000.000


4 Extracting the files from a tar file:
tar -xvf ~/tmp/website.co.il.tar.gz /home/domains/

Tuesday, 5 July 2011

Steps for Transferring a database



1 A database dump :
mysqldump -u username  --password=*****  --databases db_name  --add-drop-database --set-charset --default-character-set=UTF8 > ~/dbdump.sql

2 Create a TAR archive
tar -czvf db_name.tar.gz dbdump.sql

3 Securely Transferring dbdump.sql between a local and a remote host
scp ./db_name.tar.gz root@00.000.000.000:~/tmp

4 Connect to a server
ssh root@00.000.000.000
cd /tmp

5 Extracting the file from a tar file:
tar -xvf db_name.tar.gz ./

6 Import database from sql dump file
mysql  -u db_name  -p  < ~/tmp/dbdump.sql



Wednesday, 11 May 2011

Find & Delete files

Here is the command to clean this .svn files.

rm -rf `find . -type d -name .svn`   or  find ./ -name ".svn" | xargs rm -Rf

Wednesday, 20 April 2011

Install Curl in PHP5 and Apache on UBUNTU 10.10

1. Open your terminal (ctrl+t) and type: 
 sudo apt-get install curl libcurl3 libcurl3-dev php5-curl php5-mcrypt
 
2. Open the php.ini file (/etc/php5/apache2/php.ini ) and add: 
extension=curl.so 
 
3. Restart apache: 
service apache2 restart


Wednesday, 5 January 2011

Installing LAMP On Ubuntu

1. Install Apache

sudo apt-get install apache2
enter your password
 1.1. Testing Apache
1.1.2 Open up any web browser and then enter the following into the web address:
http://localhost/

2. Install PHP

    sudo apt-get install php5 libapache2-mod-php5
    enter your password
  2.1 In order for PHP to work and be compatible with Apache we must restart it:
    sudo /etc/init.d/apache2 restart
  2.2  Testing  PHP
    sudo gedit /var/www/test.php
    http://localhost/test.php

3. Install MySQL   

    sudo apt-get install mysql-server
   
3.1 In order for other computers on your network to view the server you have created,
you must first edit the "Bind Address".
Begin by opening up Terminal to edit the my.cnf file:
gksudo gedit /etc/mysql/my.cnf

3.1.1  Change the line
    bind-address = 127.0.0.1 to your IP address
   
3.2  Testing  Mysql
    mysql -u root --password='yourpassword'
     or
mysql -u root
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');

3.3 We are now going to install a program called phpMyAdmin which is an easy tool to edit your databases. Copy/paste the following line into Terminal:
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
or
Download MySQL Workbench
Download MySQL Administrator & MySQL Query Browser