sudo add-apt-repository ppa:ondrej/phpsudo apt-get updatesudo apt-get install php5.6 php7.0sudo a2dismod php5.6sudo a2enmod php7.0sudo service apache2 restart
Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts
Jan 31, 2018
Both php 7.0 and 5.6 on Ubuntu
Jul 3, 2015
Setup SVN server on ubuntu 14.04
Start the installation .
Step 1 : Update the repositories.
sudo apt-get update
Step 2 : Install SVN and apache webserver (To access SVN through http ) .
sudo apt-get install subversion apache2 libapache2-svn apache2-utils
Step 3 » Create a directory and create a new repository in that directory ( testrepo is the repository name ).
sudo mkdir -p /svn/repos/
sudo svnadmin create /svn/repos/testrepo
Step 4 » Change ownership for the repository.
sudo chown -R www-data:www-data /svn/repos/testrepo
Step 5 » Create a file testrepo.conf in /etc/apache2/sites-available/ and add the below lines for creating apache virtual host.
<Location /svn>
DAV svn
SVNParentPath /svn/repos/
AuthType Basic
AuthName "Test Repo"
AuthUserFile /etc/svnpasswd
Require valid-user
</Location>
SVNParentPath /svn/repos/ : Parent Directory without repository name.
AuthUserFile /etc/svnpasswd : File need to be created ( Step 8) for user details.
Step 6 »Enable the Site ( testrepo in the below command should match the file name created in the previous step )
sudo a2ensite testrepo
Step 7 » Restart or reload apache service.
sudo service apache2 reload
Step 8 » Create user for accessing repository and add the user details to /etc/svnpasswd file.
Use this command to create first user.
sudo htpasswd -cm /etc/svnpasswd user1
Use the same command without c option to create additional users.
sudo htpasswd -m /etc/svnpasswd user2
Step 9 » Access http://yourip/svn/testrepo in your browser ( Eg http://10.0.1.15/svn/testrepo ) and you can see the page like below after successful authentication.
Step 1 : Update the repositories.
sudo apt-get update
Step 2 : Install SVN and apache webserver (To access SVN through http ) .
sudo apt-get install subversion apache2 libapache2-svn apache2-utils
Step 3 » Create a directory and create a new repository in that directory ( testrepo is the repository name ).
sudo mkdir -p /svn/repos/
sudo svnadmin create /svn/repos/testrepo
Step 4 » Change ownership for the repository.
sudo chown -R www-data:www-data /svn/repos/testrepo
Step 5 » Create a file testrepo.conf in /etc/apache2/sites-available/ and add the below lines for creating apache virtual host.
<Location /svn>
DAV svn
SVNParentPath /svn/repos/
AuthType Basic
AuthName "Test Repo"
AuthUserFile /etc/svnpasswd
Require valid-user
</Location>
SVNParentPath /svn/repos/ : Parent Directory without repository name.
AuthUserFile /etc/svnpasswd : File need to be created ( Step 8) for user details.
Step 6 »Enable the Site ( testrepo in the below command should match the file name created in the previous step )
sudo a2ensite testrepo
Step 7 » Restart or reload apache service.
sudo service apache2 reload
Step 8 » Create user for accessing repository and add the user details to /etc/svnpasswd file.
Use this command to create first user.
sudo htpasswd -cm /etc/svnpasswd user1
Use the same command without c option to create additional users.
sudo htpasswd -m /etc/svnpasswd user2
Step 9 » Access http://yourip/svn/testrepo in your browser ( Eg http://10.0.1.15/svn/testrepo ) and you can see the page like below after successful authentication.
Jun 29, 2015
Setting up a cron in AWS Linux/Ubuntu
- Login to server using SSH (Windows users PuTTY)
- sudo crontab -l
- sudo crontab -e
- Linux : Open vim editor and allow to enter commands
- Ubuntu : For the first time it asks which editor to use (nano is easy)
- Enter following commands and save the file
MAILTO=yyy@gmail.com
*/5 * * * * /usr/bin/wget http://yyy.com/mail201506/index.php >/dev/null
>/dev/null
Send all the normal output to a place called "/dev/null" which is basically like a black hole. It accepts anything you dump there, but you will never see it again.
Jun 2, 2015
Install Git on Ubuntu
sudo apt-get update
sudo apt-get install build-essential libssl-dev libcurl4-gnutls-dev libexpat1-dev gettext unzip
wget https://github.com/git/git/archive/v1.9.2.zip -O git.zip (You can get latest version from git)
unzip git.zip
cd git-*
make prefix=/usr/local all
sudo make prefix=/usr/local install
if you want to upgrade to a later version, you can simply clone the repository and then build and install:
git clone https://github.com/git/git.git
Following commands will rebuild and reinstall the package
make prefix=/usr/local all
sudo make prefix=/usr/local install
git config --global user.name "Your Name"
git config --global user.email "youremail@domain.com"
sudo apt-get install build-essential libssl-dev libcurl4-gnutls-dev libexpat1-dev gettext unzip
wget https://github.com/git/git/archive/v1.9.2.zip -O git.zip (You can get latest version from git)
unzip git.zip
cd git-*
make prefix=/usr/local all
sudo make prefix=/usr/local install
if you want to upgrade to a later version, you can simply clone the repository and then build and install:
git clone https://github.com/git/git.git
Following commands will rebuild and reinstall the package
make prefix=/usr/local all
sudo make prefix=/usr/local install
git config --global user.name "Your Name"
git config --global user.email "youremail@domain.com"
May 31, 2015
Install Node.js on Ubuntu AND Linux
Ubuntu
sudo apt-get update
Then use apt-get to install Node.js build dependencies:
sudo apt-get install -y build-essential openssl libssl-dev pkg-config
Move to /usr/src directory - the usual place to hold software sources.
cd /usr/src
pick the latest compressed source archive from Node.js website at http://nodejs.org/download/.
sudo wget http://nodejs.org/dist/v0.12.4/node-v0.12.4.tar.gz
Uncompress the source files and move into that directory.
sudo tar zxf node-v0.12.4.tar.gz
cd node-v0.12.4
Prepare compiler commands, by executing the configure script:
sudo ./configure
It will read the properties of the system to prepare compiler flags. Ie. it could be a system architecture (32/64bit, CPU specific flags etc). With it, Now ready to actually compile the source now. To do that, just type:
sudo make
To make this available system-wide:
sudo make install
Linux
Update software repository to the latest versions:
sudo yum -y update
Install "Development Tools". It's a group of tools for compiling software from sources.
sudo yum -y groupinstall "Development Tools"
Move to /usr/src directory - the usual place to hold software sources.
cd /usr/src
pick the latest compressed source archive from Node.js website at http://nodejs.org/download/.
sudo wget http://nodejs.org/dist/v0.12.4/node-v0.12.4.tar.gz
Uncompress the source files and move into that directory.
sudo tar zxf node-v0.12.4.tar.gz
cd node-v0.12.4
Prepare compiler commands, by executing the configure script:
sudo ./configure
It will read the properties of the system to prepare compiler flags. Ie. it could be a system architecture (32/64bit, CPU specific flags etc). With it, Now ready to actually compile the source now. To do that, just type:
sudo make
To make this available system-wide:
sudo make install
sudo apt-get update
Then use apt-get to install Node.js build dependencies:
sudo apt-get install -y build-essential openssl libssl-dev pkg-config
Move to /usr/src directory - the usual place to hold software sources.
cd /usr/src
pick the latest compressed source archive from Node.js website at http://nodejs.org/download/.
sudo wget http://nodejs.org/dist/v0.12.4/node-v0.12.4.tar.gz
Uncompress the source files and move into that directory.
sudo tar zxf node-v0.12.4.tar.gz
cd node-v0.12.4
Prepare compiler commands, by executing the configure script:
sudo ./configure
It will read the properties of the system to prepare compiler flags. Ie. it could be a system architecture (32/64bit, CPU specific flags etc). With it, Now ready to actually compile the source now. To do that, just type:
sudo make
To make this available system-wide:
sudo make install
Linux
Update software repository to the latest versions:
sudo yum -y update
Install "Development Tools". It's a group of tools for compiling software from sources.
sudo yum -y groupinstall "Development Tools"
Move to /usr/src directory - the usual place to hold software sources.
cd /usr/src
pick the latest compressed source archive from Node.js website at http://nodejs.org/download/.
sudo wget http://nodejs.org/dist/v0.12.4/node-v0.12.4.tar.gz
Uncompress the source files and move into that directory.
sudo tar zxf node-v0.12.4.tar.gz
cd node-v0.12.4
Prepare compiler commands, by executing the configure script:
sudo ./configure
It will read the properties of the system to prepare compiler flags. Ie. it could be a system architecture (32/64bit, CPU specific flags etc). With it, Now ready to actually compile the source now. To do that, just type:
sudo make
To make this available system-wide:
sudo make install
Install and start the LAMP web server on Amazon Linux And Ubuntu
Linux
Install updates
[ec2-user ~]$ sudo yum update -y
you can install the Apache web server, MySQL, and PHP software packages. Use the yum install command to install multiple software packages and all related dependencies at the same time.
[ec2-user ~]$ sudo yum install -y httpd24 php56 mysql55-server php56-mysqlnd
Start Apache
[ec2-user ~]$ sudo service httpd start
Start apache at each system boot
[ec2-user ~]$ sudo chkconfig httpd on
Check httpd is on
[ec2-user ~]$ chkconfig --list httpd
Modify ownership and permissions for document root
Add a www group to your instance, and you give that group ownership of the /var/www directory and add write permissions for the group. Any members of that group will then be able to add, delete, and modify files for the web server.
[ec2-user ~]$ sudo groupadd www
[ec2-user ~]$ sudo usermod -a -G www ec2-user (Add user to www group)
[ec2-user ~]$ exit (logout)
[ec2-user ~]$ groups (Verify membership in www group)
[ec2-user ~]$ sudo chown -R root:www /var/www (Change the group ownership of /var/www and its contents to the www group.)
Change the directory permissions of /var/www and its subdirectories to add group write permissions and to set the group ID on future subdirectories.
[ec2-user ~]$ sudo chmod 2775 /var/www
[ec2-user ~]$ find /var/www -type d -exec sudo chmod 2775 {} +
Recursively change the file permissions of /var/www and its subdirectories to add group write permissions.
[ec2-user ~]$ find /var/www -type f -exec sudo chmod 0664 {} +
[ec2-user ~]$ sudo service mysqld start (Start mysql server)
[ec2-user ~]$ sudo mysql_secure_installation (Run mysql_secure_installation, here u can set password for mysql etc...)
[ec2-user ~]$ sudo chkconfig mysqld on (Start mysql at every boot)
Ubuntu
Install updates
$ sudo apt-get update
Install the LAMP stack:
$ sudo apt-get install lamp-server^
During installation this asks for mysql root password. Type it and press enter button. Then retype password will be asked. Type and hit enter.
Install updates
[ec2-user ~]$ sudo yum update -y
you can install the Apache web server, MySQL, and PHP software packages. Use the yum install command to install multiple software packages and all related dependencies at the same time.
[ec2-user ~]$ sudo yum install -y httpd24 php56 mysql55-server php56-mysqlnd
Start Apache
[ec2-user ~]$ sudo service httpd start
Start apache at each system boot
[ec2-user ~]$ sudo chkconfig httpd on
Check httpd is on
[ec2-user ~]$ chkconfig --list httpd
Modify ownership and permissions for document root
Add a www group to your instance, and you give that group ownership of the /var/www directory and add write permissions for the group. Any members of that group will then be able to add, delete, and modify files for the web server.
[ec2-user ~]$ sudo groupadd www
[ec2-user ~]$ sudo usermod -a -G www ec2-user (Add user to www group)
[ec2-user ~]$ exit (logout)
[ec2-user ~]$ groups (Verify membership in www group)
[ec2-user ~]$ sudo chown -R root:www /var/www (Change the group ownership of /var/www and its contents to the www group.)
Change the directory permissions of /var/www and its subdirectories to add group write permissions and to set the group ID on future subdirectories.
[ec2-user ~]$ sudo chmod 2775 /var/www
[ec2-user ~]$ find /var/www -type d -exec sudo chmod 2775 {} +
Recursively change the file permissions of /var/www and its subdirectories to add group write permissions.
[ec2-user ~]$ find /var/www -type f -exec sudo chmod 0664 {} +
[ec2-user ~]$ sudo service mysqld start (Start mysql server)
[ec2-user ~]$ sudo mysql_secure_installation (Run mysql_secure_installation, here u can set password for mysql etc...)
[ec2-user ~]$ sudo chkconfig mysqld on (Start mysql at every boot)
Ubuntu
Install updates
$ sudo apt-get update
Install the LAMP stack:
$ sudo apt-get install lamp-server^
During installation this asks for mysql root password. Type it and press enter button. Then retype password will be asked. Type and hit enter.
Start Apache server
$ sudo service apache2 start
Go to your Domain name for your instance. You will see Apache2 Ubuntu default page.
Modify ownership and permissions for document root (Same steps should apply as linux)
Modify ownership and permissions for document root (Same steps should apply as linux)
That's all.
Connect to your EC2 instance with Putty.
Open puttygen (PuTTy Key Gen)
Go to conversions->Import key->Select the key pair .pem file you downloaded while launching instance.
Go to conversions->Import key->Select the key pair .pem file you downloaded while launching instance.
Click on Save private key. It will save a .ppk file
Then open pageant click on Add key and select saved .ppk file It will ask for passphrase. Enter it and click OK.
Then close it.
Then open Putty
Add your instance's EIP, Port 22,
Go To Data. For Ubuntu username is ubuntu. For Linux username is ec2-user
Go to auth under SSH and browse your .ppk file for key pair
Finally Go to session and click Save. And Click Open to connect to the ubuntu instance with SSH.
That's All. Now you have connected to your instance with SSH.
Amazon Web Services EC2 Set Up for Ubuntu Server
Go to AWS Console, Select EC2, On EC2 Dashboard click on Launch Instance
Choose AMI(Amazon Machine Image)
Here I'm selecting Ubuntu. After click on select button you will get following screen.
Then click on Right bottom Next Configuration... Button. You will get following screen.
Click on Next: Add Storage Button. You will get following screen.
Click on Next: Tag Instance Button. You will get following
Click on Configure security group button
Then click on review and launch button. You will see all the details regarding your instance. Then click on launch button.
It will ask you to create or select key pair.
After giving key pair name, Download your key pair clicking on Download key pair button. It will download bainstance002.pem file.
Save it somewhere you can access it again in future. Then click on launch instance button.
In instance tab you will see your new instance is being created.
Then you can create EIP (An Elastic IP address (EIP) is a static IP address designed for dynamic cloud computing. With an EIP, you can mask the failure of an instance or software by rapidly remapping the address to another instance in your account. Your EIP is associated with your AWS account, not a particular instance, and it remains associated with your account until you choose to explicitly release it.)
Click on Allocate new address to create new EIP. Then Click on Associate Address to associate it with your instance.
You will get following screen
Here I'm selecting Ubuntu. After click on select button you will get following screen.
Then click on Right bottom Next Configuration... Button. You will get following screen.
Click on Next: Add Storage Button. You will get following screen.
Click on Next: Tag Instance Button. You will get following
Click on Configure security group button
Then click on review and launch button. You will see all the details regarding your instance. Then click on launch button.
It will ask you to create or select key pair.
After giving key pair name, Download your key pair clicking on Download key pair button. It will download bainstance002.pem file.
Save it somewhere you can access it again in future. Then click on launch instance button.
In instance tab you will see your new instance is being created.
Then you can create EIP (An Elastic IP address (EIP) is a static IP address designed for dynamic cloud computing. With an EIP, you can mask the failure of an instance or software by rapidly remapping the address to another instance in your account. Your EIP is associated with your AWS account, not a particular instance, and it remains associated with your account until you choose to explicitly release it.)
Click on Allocate new address to create new EIP. Then Click on Associate Address to associate it with your instance.
Then click on Associate button. That's All. Now your instance is ready to use.
Subscribe to:
Posts (Atom)


















