Tag Archives: web server

nginx

How to Install Nginx web server on Ubuntu 12.04/12.10

Nginx is a lightweight web server (HTTP, SMTP, IMAP, POP3 ..). It has very low memory footprints with higher degree of concurrency. It’s a free and open source software, runs on all major OS (Unix, Linux, BSD, Mac OS X, Microsoft Windows and more).

nginx

Setup Nginx on Ubuntu (12.04) LTS Server

Nginx is already available in Ubuntu repository, but it’s very outdated (it may be ok for development or testing but not for deployment) so for production environment you should install the newer version – either from the source or PPA.

1. Update

sudo apt-get -y update
sudo apt-get -y upgrade

2. Dependencies

For adding ppa you need to install the python-software-properties package.

sudo apt-get -y install python-software-properties

3. Install nginx

sudo apt-add-repository -y ppa:nginx/stable
sudo apt-get -y update
sudo apt-get -y install nginx

4. Start the server!

sudo service nginx start

Now, move on to the address (IP address of your VPS or the domain name or the localhost(in case of development environment)). You should see the default page served by nginx.

5. setup server configs

For editing file over the ssh, you can use a command line editor such as Vi or Nano. I recommend nano if you want a text editor without any learning curve.

Install Nano, a lightweight text editor

sudo apt-get -y install nano

Then create a server configuration file for your app/site. (you could also just edit the global config(/etc/nginx/nginx.conf), it’s fine if you’ve only one app/site running on a virtual private server but if you plan to deploy multiple apps/websites to a single VPS – then you should create seperate configs for each website)

sudo nano /etc/nginx/sites-available/example.com

After creating the config file (if you don’t know how – then read the official tutorials), create a symlink

sudo ln -nfs /etc/nginx/sites-available/example.com  /etc/nginx/sites-enabled/example.com

Now, restart the server!

sudo service nginx restart
Apache on Ubuntu

how to install LAMP – Apache, MySQL & PHP on Ubuntu 11.10

Ubuntu has become popular not only among desktop users but also among the web developers who uses Linux distribution to deploy their web application (on a VPS or dedicated host), although they preferred to use LTS (Long Term Support – typically of five years for Server Edition) version rather than a regular stable release because of obvious advantages – increased stability (Although, from the next release i.e Ubuntu 12.04 LTS, Desktop version will also get 5 years of support).

Despite of that fact, a lot of users/developers also use Apache server on their localhost for testing/development (e.g wordpress developers use it) and this post is written for those who want to get started with Apache, PHP, MySQL, phpMyAdmin etc with Ubuntu 11.10. Apache is the most popular web server on this planet (total share is above 65%). It is an open source and cross-platform web server. Apache supports a lot of server side language and the features is extensible using modules. PHP dominates the web scripting world and MySQL is the most popular open source database. Most of the websites (including the blog – you’re reading right now) are based on the great combination of Linux, Apache, MySQL and PHP (Commonly called as LAMP).

Setup LAMP in Ubuntu 11.10

step 1. Installing Apache

Apache on UbuntuOpen terminal (press Ctrl+Alt+t) and execute the command –

sudo apt-get install apache2

The above command will install some default modules, packages and libraries but you later install the ones you need. When installation is completed, type the address http://localhost in the browser address bar and you will get a default apache page like this –

 

apache-default-page

MySQLstep 2. Installing MySQL

Execute the command –

sudo apt-get install mysql-server

and enter the root password during installation procedure. I’ve already covered a post in detail about how to install MySQL on Ubuntu 11.10.

step 3. Installing PHP

Execute the command –

sudo apt-get install php5 libapache2-mod-php5 php5-mysql

Then restart the Apache server to load php modules –

sudo /etc/init.d/apache2 restart

To test whether the PHP 5 has been successfully installed or not, create a file phpinfo.php and copy the following content (to the file) –

<?php
print_r (phpinfo());
?>

and put the file in root web directory (/var/www). Then open the address http://localhost/phpinfo.php, then it should display the php configuration details like this –

testing php on Ubuntu

That’s All.. Linux (Ubuntu is itself a Linux based OS), Apache, MySQL and PHP i.e all the components of LAMP has been installed successfully.

To manage MySQL database from a GUI, You may like to install phpMyAdmin – The MySQL web administration tool, a great application for managing – creating and maintaining MySQL database.

How to install phpMyAdmin on Ubuntu 11.10 ?

just execute the command –

sudo apt-get install phpmyadmin

When the installation is complete, move on to http://localhost/phpmyadmin and login (using the MySQL login username(default is ‘root’) and the password (you entered during installation)) to start using it.

Want to learn web server administration (with LAMP) on Ubuntu Server ?

Having apache, MySQL, PHP installed locally on your system is good for learning about the server administration and other cool/great stuffs related to Linux but VPS is very cheap these days so you may want to try Ubuntu (with Apache or other web server) on a VPS for much better (and real) experience – I’ve been using Linode VPS @ $19.95/month (512 MB RAM, 20 GB space and 200GB bandwidth) for a while, and I am loving it.

install webmin on ubuntu 10.04

how to install webmin on ubuntu 10.04 server

Webmin is a web based interface to administrate unix/linux system locally or remotely.You can use any modern web browser e.g firefox to configure and set up user accounts,Apache server,DNS(Domain Name System) like BIND DNS Server,File Sharing permissions,Firewalls,backup configuration,cluster copy files &packages,HTTP Tunnel,VPN,Jabber IM,Linux RAID,MIME Type,Log File Rotation,Scheduled Cron Jobs,bandwidth monitoring …and many other things.So you don’t need to manually edit the unix/linux configuration files e.g /etc/passwd ..and lets you to manage remotely or from console.

install webmin on ubuntu 10.04

Installing Webmin in Ubuntu 10.04 Lucid Lynx

#1. First install these dependencies either from command line(terminal) or package manager.
libapt-pkg-perl
apt-show-versions
libauthen-pam-perl
libio-pty-perl
libnet-ssleay-perl

Type the following command : sudo apt-get install package_name
OR in synaptic package manager search for the package name;mark it and click on apply to install it.

#2. Now,download webmin from the link given below.

Download Webmin

#3. Install it by rightclick->open with Gdebi package Installer(OR just double click on it);then a new window will appear click on Install Package.

OR install it manually by using the command given below-

dpkg  -i   webmin_1.510-2_all.deb
Apache on Ubuntu

install apache in ubuntu 10.04

What is Apache??

Apache HTTP Server i.e apache is a cross-platform open source(Under Apache License) web server software.Apache is written in C language.Apache is the most popular web server used(share on the web is more than 66%) for serving both static and dynamic web pages;as well as the features and functions that is required for most of the web applications.Apache supports a lot of features out of which some implemented in the form of compiled modules for extending the core functionality.A lot of server side programming languages is used with apache – Perl,PHP,Python,Tcl.Other security related features includes SSL(Secure Socket Layer),TLS(Transport Layer  Security).The aim of this post is to explain you about installing apache web server on ubuntu 10.04 lucid lynx.

install apache ubuntu

Installing Apache on Ubuntu 10.04 Lucid Lynx

Open Terminal(hit CTRL+ALT+T) and type the following command(s) ..followed by your ubuntu login password.

$ sudo apt-get install apache2

[sudo] password for user:

Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
python-docky libmono-getoptions2.0-cil
Use ‘apt-get autoremove’ to remove them.
The following extra packages will be installed:
apache2-mpm-worker apache2.2-bin apache2.2-common libaprutil1-dbd-sqlite3
libaprutil1-ldap
………………………………………………..
………………………………………………..

and the installation procedure will complete within a minute.
After installing Apache on Ubuntu 10.04 lucid Lynx,you can verify whether it is installed properly or not.The files that is in the directory File System->var->www can be accessed as server.If you will type following address in your browser address bar –

http://localhost/

Then you will see –

It works!

This is the default web page for this server.

The web server software is running but no content has been added, yet.

That’s All…

NOTE : You can also install apache from Synaptic Package Manager(SPM).Just search for ‘apache’ and select the package from result,then click on apply to install.Another and more common way to install apache is to install it together with PHP and Mysql ..in LAMP.