Showing posts with label Apache. Show all posts
Showing posts with label Apache. Show all posts

Friday, October 5, 2012

How to create Virtual Hosts in Ubuntu

Virtual Hosting is a method for hosting multiple sites/domains in a single server. It helps to reduce the cost and can share the memory and processor cycle. In local host also we can create Virtual host and we can call original domain name(production/live domain) from our development environment(localhost). Here I am providing the steps for creating Virtual host in Linux/Ubuntu workstation. i.  Assume your code resides at /var/www/yoursite ii.  You can access your site using http://localhost/yoursite. iii.  Edit vhosts file in sites-enabled. sudo gedit /etc/apache2/sites-enabled/vhosts.conf. iv. Add below code in vhosts file <VirtualHost *:80> ServerName local.yoursite.com ServerAlias www.local.yoursite.com DocumentRoot...

Friday, July 13, 2012

Redirect all users to access the site with 'www' prefix using htaccess file

We can redirect the site url to "www" prefix, whether the user is accessing the site without "www" prefix by adding rewrite url in .htaccess file in root folder. add following lines in .htaccess file to add www prefix.  RewriteEngine on  RewriteCond %{HTTP_HOST} ^yoursitename\.com$ [NC]  RewriteRule ^(.*)$ http://www.yoursitename.com/$1 [L,R=301] Similarly we can remove "www" prefix from the url and redirect to without "www" by adding following lines in .htaccess file  RewriteEngine on  RewriteCond %{HTTP_HOST} ^www\.yoursitename\.com$ [NC] RewriteRule ^(.*)$ http://yoursitename .com/$1 [L,R=301] ...

Sunday, February 20, 2011

Installing Apache, MySQL and PHP in Linux-Ubuntu

Apache is the most commonly used web server. It is a free open source web server. PHP is an open source server scripting language. It has a lot of advantages. MySQL is also an open source database used for small and medium data storage. It can also used for large data storage also. We can install apache, PHP and MySQL in two ways. 1. Download source code from their site and install. 2 the easiest way install it from synaptic package manager. If you use this method apt-get automatically manage all dependencies. So I explain the second method here. 1. Open the Terminal from Applications -> Accessories -> Terminal 2. Install apache2 copy paste command to terminal sudo apt-get install apache2 3. Install PHP5 sudo apt-get install php5 libapache2-mod-php5 4....

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Maintained by Web Themes