Virtual Hosting Using apache2
What is Virtual Hosting and where and why it is used?
Vitual Hosting is a method that servers such as web servers use to host more than one domain
name on the same computer.
Virtual hosting allows a website owner to have a site hosted on a web server that is shared with
other websites. In other words, virtual hosting services and bandwidht to more than one website.
Virtual web hosting is one of the most popular hosting options available at the moment -
probably because of cost effective because you won’t have to pay for a dedicated server to host just
your website.
Virtual web hosting is good solution for SME’s even for MNC’s also websites that aren’t constantly being visited
There are two basic methods of accomplishing virtual hosting: name-based, and IP address or ip-based.
Lets move to the Practical Session
Check are you have Apache2, mysql5, php5 in your PC or Laptop or NoteBook what ever you calls otherwise follow below steps
1. Install LAMP
2. Control Apache2
3. Control MySql
4. Virtual Hosting
5. Virtual Hosting with multiple names
1. Install LAMP – Linux Apache2 Mysql Php
I preasume you have Ubuntu Linux installed. Let’s install everything else (Apache 2, PHP5 and MySQL 5)
sudo aptitude install apache2 mysql-server php5 php5-mysql libapache2-mod-php5
Open your favourite web browser and enter http://localhost (or http://127.0.0.1)
Check if Apache 2 and PHP 5 work fine
Create a file called test.php and enter this text in it
<?php phpinfo(); ?>
Save the file and copy it to your web site folder, e.g. /var/www
Open your web browser and run
http://localhost/test.php
2. Control Apache2
To start Apache2
sudo /etc/init.d/apache2 start
To stop Apache2
sudo /etc/init.d/apache2 stop
To restart Apache2
sudo /etc/init.d/apache2 restart
After first install I always get this error:
apache2: Could not determine the server’s domain name, using 127.0.0.1 for ServerName
It is easily fixed – add ServerName localhost into apache2.conf
gksudo gedit /etc/apache2/apache2.conf
3. Control MySQL
To start MySQL
sudo /etc/init.d/mysql start
To restart MySQL
sudo /etc/init.d/mysql restart
To stop MySQL
sudo /etc/init.d/mysql stop
Creating Database using MySql
First Login into MySql Using Following Command here it will ask password then enter the root password of My Sql. MySql Password has given when it was Installing
mysql -u root -p
Create Database
Create Database virtual;
Use Database
Use virtual;
4. Virtual Hosting
(a) Allow user to web directory
(b) Create Folder and link to web directory
(c) Using Virtual Hosts
(d) Adding Virtual Hosts
(e) Apache Configuaration
localhost is the default host, but if you add virtal hosts, you may want to change it to, say, somechow
However, the address http://localhost/ by default points to /var/www. That folder is basically empty that is why you do not see much in your web browser.
To show proper web site, you need to put some web pages in that folder.
(a) allow yourselft to have access to the folder /var/www
sudo chown -R USERNAME /var/www
Now, you can copy your great web site to the folder /var/www.
Start Firefox again and type http://localhost/. Do you see you web site?
If you hate to always navigate to /var/www, you can press Control-D in Nautilus to add a new bookmark in Places menu. You can create a link to it in your home folder for easy access, alternatively.
(b) Create a folder in your desired location and link to the web direcotry
ln -s /var/www ~/WebSite
Now you can place all your web content inside the folder WebSite in your home folder and you will see your web site by going to
http://localhost/
(c) Using virtual hosts
If I put a folder called somechow inside /var/www, I can run my local web site by entering http://localhost/somechow.
However, I prefer more human-readable web addresses. For example, when I enter http://somechow, my local WordPress copy of somechow.Ws (located in /home/some/WebSites/somechow) runs in Firefox.
To use virtual hosts, you need to change hosts file and add some information for Apache.
(d) I add my virtual host address to Hosts file
sudo nano /etc/hosts
127.0.0.1 somechow
In above quote instead of 127.0.0.1 I used my desktop IP.
Then I reboot the computer or networking for changes to take effect
sudo /etc/init.d/networking restart
(e) Apache Configuration
Open the window in super user mode uisng following command prompt
sudo nautilus
I create a copy of file default which is located in /etc/apache2/sites-available and rename it to somechow.
I created a link to this file by right-clicking and selected MakeLink option
I copy this link to /etc/apache2/sites-enabled
I change link file into somechow:
NameVirtualHost * is changed to NameVirtualHost somechow
ServerName@somechow is added under ServerAdmin
DocumentRoot /var/www/ is changed to DocumentRoot /home/some/WebSites/somechow
5. Virtual Hosting with multiple names
(a) Allow user to web directory
(b) Create Folder and link to web directory
(c) Using Virtual Hosts
(d) Adding Virtual Hosts
(e) Apache Configuaration
localhost is the default host, but if you add virtal hosts, you may want to change it to, say, somechow and somedary
However, the address http://localhost/ by default points to /var/www. That folder is basically empty that is why you do not see much in your web browser.
To show proper web site, you need to put some web pages in that folder.
(a) allow yourselft to have access to the folder /var/www
sudo chown -R USERNAME /var/www
Now, you can copy your great web site to the folder /var/www.
Start Firefox again and type http://localhost/. Do you see you web site?
If you hate to always navigate to /var/www, you can press Control-D in Nautilus to add a new bookmark in Places menu. You can create a link to it in your home folder for easy access, alternatively.
(b) Create a folder in your desired location and link to the web direcotry
ln -s /var/www ~/WebSite
Now you can place all your web content inside the folder WebSite in your home folder and you will see your web site by going to
http://localhost/
(c) Using virtual hosts
If I put a folder called somechow and somedary inside /var/www, I can run my local web site by entering http://localhost/somechow or http://localhost/somedary
However, I prefer more human-readable web addresses. For example, when I enter http://somechow and http://somedary , my local WordPress copy of somechow.Ws or somedary.ws(located in /home/some/WebSites/somechow and /home/some/WebSites/somedary ) runs in Firefox.
To use virtual hosts, you need to change hosts file and add some information for Apache.
(d) I add my virtual host address to Hosts file
sudo nano /etc/hosts
127.0.0.1 somechow
127.0.0.1 somedary
In above quote instead of 127.0.0.1 I used my desktop IP.
Then I reboot the computer or networking for changes to take effect
sudo /etc/init.d/networking restart
(e) Apache Configuration
(i) For somechow
Open the window in super user mode uisng following command prompt
sudo nautilus
I create a copy of file default which is located in /etc/apache2/sites-available and rename it to somechow.
I created a link to this file by right-clicking the somechow and selected MakeLink option
I copy this link to /etc/apache2/sites-enabled
I change link file into somechow:
NameVirtualHost * is changed to NameVirtualHost somechow
ServerName@somechow is added under ServerAdmin
DocumentRoot /var/www/ is changed to DocumentRoot /home/some/WebSites/somechow
(ii) For somedary
Open the window in super user mode uisng following command prompt
sudo nautilus
I create a copy of file default which is located in /etc/apache2/sites-available and rename it to somedary.
I created a link to this file by right-clicking the somechow and selected MakeLink option
I copy this link to /etc/apache2/sites-enabled
I change link file into somedary:
NameVirtualHost * is changed to NameVirtualHost somedary
ServerName@somedary is added under ServerAdmin
DocumentRoot /var/www/ is changed to DocumentRoot /home/some/WebSites/somedary
Installing SVN and TRAC in Ubuntu 9.04 with Apache2 SSL
This tutorial will guide you through installation of Apache, HTTPS, Subversion and Trac, in order to have an (almost) complete development environment for your team.
This article is divided in following steps
1. Installing Subversion
2. Installing Apache
3. Configuring Apache with SSL
4. Configuring Subversion with Apache (and SSL)
5. Installing Trac
You may choose for example to see how to install Apache and SSL, or having Apache plus subversion without Trac.
Steps are voluntary isolated, and will require more operations than, for instance, issuing an “apt-get install trac” that will download and install all the packages in one step; but this will hopefully allow the readers to choose picking one section and forget about unneeded components.
I’ll not explain what Subversion is, or what SSL is, etc. Ask google, for this info: I just say that for your software project you may need a server with those tools ready for your team.
Requirements
You need Ubuntu 9.04, in my case I used the “desktop edition” 32bit. But possibly this tutorial should be valid for Debian and previous Ubuntu version; but I have not verified that: if you do, post a comment to report your experience.
Preparation
After installing your server you have to ensure that apt system is up to date with available software on the repositories. Type the following command:
$ sudo apt-get update
upgrading installed packages may be a good idea to do now:
$ sudo apt-get upgrade
Answer Yes if asked to download and install the upgrades.
1. Installing Subversion
From the command line type the command:
$ sudo apt-get install subversion
If everything went fine you should able to verify the Subversion version installed with following command:
$ svn –version
svn, version 1.5.4 (r33841)
compiled Aug 7 2009, 01:44:11Copyright (C) 2000-2008 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).The following repository access (RA) modules are available:
* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
- handles ‘http’ scheme
- handles ‘https’ scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
- with Cyrus SASL authentication
- handles ’svn’ scheme
* ra_local : Module for accessing a repository on local disk.
- handles ‘file’ schemeFor now, let’s stop here: how to create the Subversion repository, configure the users etc. Will be explained later in conjunction with Apache2 configuration. Maybe I’ll write something on how to deal with svnserve, svnadmin, and user access control, in another article.
Later we will see how to create a repository, configure it with apache and HTTP basic authentication.
2. Installing Apache
To install apache 2 type the command:
$ sudo apt-get install apache
When finished you should be able to connect with the browser at http://localhost and see the message “It works!”. Or you may verify that at the command line installing and using curl:
$ sudo apt-get install curl
$ curl http://localhost
<html><body><h1>It works!</h1></body></html>
3. Configuring Apache with SSL
Now we want to configure apache to run HTTPs.
Following command will enable ssl Apache2 module with a2enmod (cryptic name for “Apache2 enable module”:
$ sudo a2enmod ssl
The previous command will suggest you to restart apache to let it to reload the configuration; ignore that message for now.
We need to enable the HTTPS port (443). Edit /etc/apache2/ports.conf and ensure that port 443 is defined as follows:
$ sudo gedit /etc/apache2/ports.conf
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gzNameVirtualHost *:80
Listen 80<IfModule mod_ssl.c>
# SSL name based virtual hosts are not yet supported, therefore no
# NameVirtualHost statement here
NameVirtualHost *:443
Listen 443
</IfModule>
I added the clause NameVirtualHost *:443 in the for SSL; this is not strictly necessary but it will be useful later if you want to have a VirtualHost for trac and other development services.
Now we need to configure the SSL site. Fortunately we have already the configuration file for that, we just need to enable it with a2ensite (cryptic name for “apache2 enable site”)
$ sudo a2ensite default-ssl
Again, the above command will suggest to reload apache configuration to activate the changes. This time the suggestion is almost right. As we made several changes I prefer to restart apache with following command:
sudo /etc/init.d/apache2 restart
* Restarting web server apache2apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
… waiting apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
If everything went fine you should see the above warning. You can ignore it, unless you want to configure the ServerName for your server. But this is out of scope, so do a search on Google, or consult an Apache expert.
So, if everything went fine, now we should be able to connect to our server through SSL.
You can use firefox or curl, as before, but this time the URL will be https://localhost
$ curl -k https://localhost
<html><body><h1>It works!</h1></body></html>
the -k option is to ignore certification validation. Also firefox will complain that our certificate is invalid, but you can add it to exceptions and it will nomore bug you with those messages.
If everything went fine, now we should have Apache2, HTTP and HTTPs ready.
4. Configuring Subversion with Apache (and SSL)
First of all, we need to install the Subversion modules for Apache2.
$ sudo apt-get install libapache2-svn
They will be enabled by default. So you don’t need to run a2enmod.
We only need to configure a repository. Let’ say our project is called ‘myproject’.
First of all, let’s decide where our svn repositories will be created. I like /var/local/svn :
$ sudo mkdir /var/local/svn/
Then let’s create the repository using following procedure:
$ sudo mkdir /var/local/svn/myproject
$ sudo chown www-data:www-data /var/local/svn/myproject
$ sudo -u www-data svnadmin create /var/local/svn/myproject
Above commands will ensure that the user www-data (which is the apache user) can fully access the repository for reading and updating it.
We need to configure the repository in Apache. Edit /etc/apache2/mods-available/dav_svn.conf using:
$ sudo gedit /etc/apache2/mods-available/dav_svn.conf
And add a section like the following one:
<Location /svn/myproject>
DAV svn
SVNPath /var/local/svn/myproject
AuthType Basic
AuthName “My Project Subversion Repository”
AuthUserFile /etc/subversion/myproject.passwd
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>
In the above file we indicated that, at the location svn our repository should respond. And for updating the repository we want a valid user. As per above configuration anonymous consultation is allowed; but you can disable it commenting with a leading ‘#’ the lines <LimitExcept … and </LimitExcept> or just removing them as in following example:
<Location /svn/myproject>
DAV svn
SVNPath /var/local/svn/myproject
AuthType Basic
AuthName “My Project Subversion Repository”
AuthUserFile /etc/subversion/myproject.passwd
#<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
#</LimitExcept>
</Location>
The above configuration indicates to Apache that even for consulting the repository we want a valid user.
But valid users need a password, and in fact we indicated a password file for our repository called /etc/subversion/myproject.passwd. So let’s create a password file with a couple of users:
$ sudo htpasswd -c /etc/subversion/myproject.passwd luigi
$ sudo htpasswd /etc/subversion/myproject.passwd mario
The -c option indicates that the password file should be created as new; and it is only necessary for the first user. Be aware of the fact that -c overwrites the existing password file without asking anything. Personally I think this is a quite stupid behavior, but that’s the way it is.
Now we should be ready.
Let’s reload apache configuration to make the changes effective:
$ sudo /etc/init.d/apache2 reload
and let’s test with the browser that our svn repository is now accessible through HTTP and HTTPs at following urls:
http://localhost/svn/myproject/
https://localhost/svn/myproject/
We can also use curl to verify it is working:
$ curl http://username:password@localhost/svn/myproject/
<html><head><title>myproject – Revision 0: /</title></head>
<body>
<h2>myproject – Revision 0: /</h2>
<ul>
</ul>
<hr noshade><em>Powered by <a href=”http://subversion.tigris.org/”>Subversion</a> version 1.5.4 (r33841).</em>
</body></html>
$ curl -k https://username:password@localhost/svn/myproject/
<html><head><title>myproject – Revision 0: /</title></head>
<body>
<h2>myproject – Revision 0: /</h2>
<ul>
</ul>
<hr noshade><em>Powered by <a href=”http://subversion.tigris.org/”>Subversion</a> version 1.5.4 (r33841).</em>
</body></html>
Now we can also download our project using svn
$ svn co https://localhost/svn/myproject myproject –username luigi
“luigi” is obviously my username, substitute it with yours.
The first time it will prompt for accepting the SSL certificate, answer to accept it permanently (p). Then it will optionally ask you for the password, type it.
We can also test that modifying the remote repository is working with:
$ svn mkdir -m “created the trunk for the project” https://localhost/svn/myproject/trunk –username luigi
It will answer: Committed revision 1. If so, we’ve done.
5. Installing Trac
To install trac files and required dependencies, type the following command:
$ sudo apt-get install trac
$ sudo apt-get install libapache2-mod-pythonLet’s create the directories for trac web folder:
$ sudo mkdir /var/local/trac
$ sudo chown www-data:www-data /var/local/trac
edit Apache configuration file for one of your enabled sites (in this example I modify the default http one, but you can choose to put trac on HTTPS modifying default-ssl)
$ sudo gedit /etc/apache2/sites-enabled/000-default
and add the following lines at the end of the file, before the </VirtualHost> tag:
<Location /projects>
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /var/local/trac
PythonOption TracUriRoot /projects
PythonOption PYTHON_EGG_CACHE /tmp
</Location># use the following for one authorization for all projects
# (names containing “-” are not detected):
<LocationMatch “/projects/[[:alnum:]]+/login”>
AuthType Basic
AuthName “trac”
AuthUserFile /etc/trac/trac.passwd
Require valid-user
</LocationMatch>
Create a password file for trac users (if you want you can reuse or link the passwd file used for subversion repositories)
$ sudo htpasswd -c /etc/trac/trac.passwd luigi
$ sudo htpasswd /etc/trac/trac.passwd mario
… continue this way for all your users.
Create the trac environment for your project:
$ sudo -u www-data trac-admin /var/local/trac/myproject initenv
It will ask you some questions related to your project. Here’s my answers in blue
Project Name [My Project]> My Project
Database connection string [sqlite:db/trac.db]> [Just press Enter to accept the default]
Repository type [svn]> [Just press Enter to accept the default]
Path to repository [/path/to/repos]> /var/local/svn/myproject
Now let’s restart apache:
$ sudo /etc/init.d/apache2 restart
Check that trac works properly connecting the browser to http://localhost/projects or use curl to verify that the url is responding properly as we did before. This url should display a link to “My Project”, click on it and you should see the project home page. Clicking on login the browser should ask you to provide username and password as recently defined with htpasswd command.
Last thing to do: add yourself as administrator for Trac. This will enable the Admin menu and allow to do much of the administration operations from the web, that you could also do at the command line with trac-admin tool.
Execute the following command:
$ sudo -u www-data trac-admin /var/local/trac/myproject permission add luigi TRAC_ADMIN
This will make the username ‘luigi’ administrator for the project.
You can tune additional configuration settings in Trac to enable email notification, change the project logo, etc. Everything you need to know is on Trac website. For the configuration check here: http://trac.edgewall.org/wiki/TracIni
Setup easy web development environment (XAMPP)
This is a how-to for setting up a web development environment easily. This guide will install the XAMPP lampp stack into /opt, setup an easy way to start it up and shut it down, and link a folder in your home directory to the webserver.
WARNING
This guide is aimed at a development environment only and should not be used as a public webserver. To setup a public webserver follow the directions on the Ubuntu wiki https://help.ubuntu.com/community/ApacheMySQLPHP
As this is Ubuntu, all the major parts of a typical web server are included (in the main repo, or on the Ubuntu Server CD) and this is a great way to setup a server. The ubuntu developers have prepared a great web server and have made the process as seemless as possible.
But what if even the official way is still to complicated? What if you just want a quick web server for development?
Fortunately there is the XAMPP project: http://www.apachefriends.org/en/xampp.html. The XAMPP project bundles Apache, PHP4 & 5, Perl, mySQL, and a bunch of other utilities/applications into an simple package for Mac OSX, Windows, Solaris, and Linux. Obviously this HOWTO only deals with the linux version.
For those of you with already existing Apache/mySQL/php installations it installs everything into /opt so it doesn’t conflict with any other installation, and it is completely setup and ready to run.
Install XAMPP
Two easy steps:
- Download the most recent version of XAMPP: (at time of writing 1.5.3a)
http://prdownloads.sourceforge.net/x…ar.gz?download
(Source URL: http://www.apachefriends.org/en/xampp-linux.html#374) - Extract the archive to /opt using sudo: (make sure you are in the directory that you downloaded the archive to)
Code:
sudo tar xvfz xampp-linux-1.5.3a.tar.gz -C /opt
Start XAMPP
To start it up, open a terminal and type this:
sudo /opt/lampp/lampp start
Stop XAMPP
To stop it, open a terminal and type this:
sudo /opt/lampp/lampp stop
Additional XAMPP commands
To see additional commands, open a terminal and type this:
sudo /opt/lampp/lampp
Sweet XAMPP Control Panel

To use the sweet gtk/python control panel:
Run in a terminal:
gedit ~/.local/share/applications/xampp-control-panel.desktop
Paste the following into the open file and save and exit.
[Desktop Entry] Comment=Start/Stop XAMPP Name=XAMPP Control Panel Exec=gksudo "python /opt/lampp/share/xampp-control-panel/xampp-control-panel.py" Icon[en_CA]=/usr/share/icons/Tango/scalable/devices/network-wired.svg Encoding=UTF-8 Terminal=false Name[en_CA]=XAMPP Control Panel Comment[en_CA]=Start/Stop XAMPP Type=Application Icon=/usr/share/icons/Tango/scalable/devices/network-wired.svg
“XAMPP Control Panel” will show up in your applications menu under Internet. Use the Alacarte Menu Editor to move it around.
Test to see if XAMPP is running
Once XAMPP is up and running open firefox and go to: http://localhost/
You should see the XAMPP test page:

Location of files and uploading
XAMPP by default uses /opt/lampp/htdocs as the root web directory. The easiest way to start working on files is to link a folder in your home directory into this directory.
My user name is peter so I have /home/peter/public_html linked to /opt/lampp/htdocs/peter. So if I navigate to http://localhost/peter/ I get a listing of all the files/folders in that directory. (As long is there isn’t a index.php/html/etc file)
To set this up, run in a terminal:
- Make public_html directory in home directory:
Code:
mkdir ~/public_html
- Link to /opt/lampp/htdocs
Code:
sudo ln -s ~/public_html /opt/lampp/htdocs/$USER
Now any files and folders you place in ~/public_html will be published to your personal webserver.
Bookmark http://localhost/username to make this easy to access.
WARNING – SECURITY
http://www.apachefriends.org/en/xampp-linux.html#381
Open holes:
- The MySQL administrator (root) has no password.
- The MySQL daemon is accessible via network.
- ProFTPD uses the password “lampp” for user “nobody”.
- PhpMyAdmin is accessible via network.
- Examples are accessible via network.
- MySQL and Apache running under the same user (nobody).
This doesn’t leave your whole system wide open, but someone could hack your XAMPP installation, so be wary.
To fix most of the security weaknesses open a terminal and run:
sudo /opt/lampp/lampp security
Installing Flash 10 Under Ubuntu 64 bit Edition
This small post will cover flash 10 Ubuntu Linux 64 bit installation.
Alejandro has published a shell script to automate entire process. Open terminal and type the following command to install Flash 10 under 64 bit edition (please exit any browsers you may have running).
$ wget http://queleimporta.com/downloads/flash10_en.sh
$ sudo bash ./flash10_en.sh
A(Apache),M(MySql),P(PHP) Installation Steps
LAMP Installation
The Below Steps Showing the installation of the Apache,MySql and PHP in your ubuntu 7.10 machine.
Installing Apache
Now we can get started installing. This will take a few minutes, so grab a beer (or your favorite beverage,) and off we go. To install Apache, type or paste this into your terminal:
sudo apt-get install apache2
Testing Apache
Once apache2 is done installing, you can go ahead and test it by using:
sudo /etc/init.d/apache2 start
If you get a message that it’s already running, you’re good to go. Now, open up your browser and navigate to:
http://localhost
You should see a page just like this. As long as you do,
we’re ready to install PHP.
Installing PHP
Again, to install PHP, type or paste this into your terminal:
sudo apt-get install php5 libapache2-mod-php5
Once it’s finished installing, restart apache, using:
sudo /etc/init.d/apache2 restart
Testing PHP
Now, let’s make sure that PHP is working properly. To do this, we’re going to run phpinfo(). You can, of course, swap out gedit with your editor of choice.
sudo gedit /var/www/phpinfo.php
Type or paste the following into the document, and save it. (remove the space before the ‘?php’)
< ?php phpinfo(); ?>
Now we can test PHP by browsing to:
http://localhost/phpinfo.php
You should see all of the info about your PHP installation listed on the page, like so. For security reasons, you should remove this page when you’re sure that PHP works.
Installing MySQL
Now we can conquer MySQL
sudo apt-get install mysql-server
As MySQL is installing, it will ask you to configure your root password. Make sure that you type it correctly, as it will only ask you once.
Testing MySQL
After that is finished, you can test MySQL by running this, where zzzz is your password. -p is must needed
mysql -uroot -pzzzz
If it brings you to a MySQL prompt, you’re done! You can type exit to get out of MySQL.
Installing phpMyAdmin
Now, if you want to install phpMyAdmin to have a front end for MySQL, you can use the following.
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
then it shows the window in terminal in that select highlighted option apache
[*]apache2
[ ] apache
[ ] apache-ssl
[ ] apache-perl
It will ask you to choose a webserver to configure automatically, you can use the space bar to select Apache2. And after that’s finished, restart one last time.
sudo /etc/init.d/apache2 restart
Finished!
Now you have your own LAMP (Linux Apache MySQL PHP) server, with phpMyAdmin.
In PhpMyAdmin give username and password
Useful Commands and Default Locations
To Save yourself some time, you can make launchers for Apache or MySQL start, stop, and restart if you feel the need.
Apache
sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 restart
MySQL
sudo /etc/init.d/mysql start
sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysql restart
Locations
/var/www/ — Document Root
http://localhost/phpmyadmin — phpMyAdmin
/usr/share — phpMyAdmin local location
Ten Major Differences in Linux and Windows
- Reduces the risk of carpal tunnel syndrome
- Use the extra cash for rewards
- Formats are free, freedom is preserved
- Zero risk in violating license agreements
- Transparent vs Proprietary
- Better network, processing capabilities
- Customizable
- Flexibility
- Mobility
- Proven Security
When linux is properly installed, there no longer a need to use the mouse. Chances of you using a mouse is close to zero.
Linux is 100% free while Windows Vista Ultimate costs $398.99 at the time of writing. Companies that pay a licensing annually could have used the money for other things like buying an additional server to reduce the load or even give a bigger bonus to its loyal employees.
Linux file formats can be accessed in a variety of ways because they are free. Windows on the other hand makes you lock your own data in secret formats that can only be accessed with tools leased to you at the vendor’s price. “What we will get with Microsoft is a three-year lease on a health record we need to keep for 100 years”
Linux is open source so you are unlikely to violate any license agreement. All the software is happily yours. With MS Windows you likely already violate all kinds of licenses and you could be pronounced a computer pirate if only a smart lawyer was after you. The worldwide PC software piracy rate for 2004 is at 35%. Which means that 3 out of 10 people are likely to get into real trouble.
MS Windows is based on DOS, Linux is based on UNIX. MS Windows Graphical User Interface (GUI) is based on Microsoft-own marketing-driven specifications. Linux GUI is based on industry-standard network-transparent X-Windows.
Linux beats Windows hands down on network features, as a development platform, in data processing capabilities, and as a scientific workstation. MS Windows desktop has a more polished appearance, simple general business applications, and many more games for kids (less intellectual games compared to linux’s).
Linux is customizable in a way that Windows is not. For example, NASlite is a version of Linux that runs off a single floppy disk and converts an old computer into a file server. This ultra small edition of Linux is capable of networking, file sharing and being a web server.
Windows must boot from a primary partition. Linux can boot from either a primary partition or a logical partition inside an extended partition. Windows must boot from the first hard disk. Linux can boot from any hard disk in the computer.
Windows allows programs to store user information (files and settings) anywhere. This makes it impossibly hard to backup user data files and settings and to switch to a new computer. In contrast, Linux stores all user data in the home directory making it much easier to migrate from an old computer to a new one. If home directories are segregated in their own partition, you can even upgrade from one version of Linux to another without having to migrate user data and settings.
Why isn’t Linux affected by viruses? Simply because its code has been open source for more than a decade, tested by people all around the world, and not by a single development team like in the case of Windows. This leads to a lightning fast finding and fixing for exploitable holes in Linux. So that my friends, proves Linux as having an extremely enhanced security and lesser chances of exploits compared to Windows.
What is Linux And what Linux Have?
Linux is the name usually given to any Unix-like computer operating system that uses the Linux Kernel. Linux is one of the most prominent examples of free software and open source development. Source code can be freely modified, used, and redistributed by anyone.
The system’s utilities and libraries usually come from the GNU operating system, announced in 1983 by Richard Stallman.
The name “Linux” comes from the Linux kernel, started in 1991 by Linus Torvalds.
The GNU contribution is the basis for the alternative name GNU/Linux.
Predominantly known for its use in servers, Linux is supported by corporations such as Dell, Hewlett-Packard, IBM, Novell, Oracle Corporation, Red Hat, and Sun Microsystems.
It is used as an operating system for a wide variety of computer hardware, including desktop computers, supercomputers, E-book readers, video game systems such as the PlayStation 2 and PlayStation 3, several arcade games, and embedded devices such as mobile phones and routers.