How To Host Your Website On Linux


Web Hosting – Alright here is the method, on how to host your website on Linux server (vps). Since now days you can see that hosting a website is not cheap so for this you can host your website on Linux server at low cost and with better brand width where it can hold a lot of traffic than shared hosting
Here is a video that we have made for you on hosting a website on Linux server without cPanel

I have used Debain (wheezy 7.0), nginx, php5 and mysql. Now follow the instructions as given on your Linux server if you have any doubts then play the above video if still your have doubts then comment below :)
Enter the following commands in the give order
  • apt-get update
  • apt-get upgrade
  • apt-get install nginx php5-fpm mysql-server
  • cd /var/www/
  • mkdir 8bits.tv(replace 8bits.tv with your website name)
  • cd 8bits.tv
  • wget http://www.wordpress.org/latest.tar.gz
  • tar vxzf latest.tar.gz
  • rm latest.tar.gz
  • cd
  • mysql -u root -p (press enter and then it will ask you to enter the password for mysql which you used when you install mysql-server)
  • create database 8bit; (replace 8bit with your own name)
  • grant select, delete, create, alter, update, drop, insert, index on 8bit.* to ‘bit’@’localhost’ identified by ‘Enteranypasswordwhichyouwanthere’; (Once done press enter and then ctrl + c to exit)
  • cd /var/www/8bits.tv/wordpress
  • cp wp-config-smaple.php wp-config.php
  • vim wp-config.php (after opening the file change your database details and save it)
  • cd /etc/nginx/sites-available/
  • vim 8bits.tv.vhost (rename 8bits.tv with your website name)
NOW ENTER THIS CODE IN 8bits.tv.vhost AND YOU NEED TO REPLACE 8bits.tv FOLDER WITH YOUR FOLDER AND sevrer_name
server {
listen 80;
root /var/www/8bits.tv/wordpress;
index index.php index.html index.htm;

server_name 8bits.tv www.8bits.tv;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
ONCE DONE SAVE IT AND ENTER THIS FOLLOWING CODE
  • cd ..
  • cd sites-enabled/
  • ln -s /etc/nginx/sites-available/8bits.tv.vhost
  • service nginx restart
So once you have done all the above step your website will be done :) If you have any problems then comment below. Sorry for bad English :D If you want to buy a Linux server at very low cost then click here

Comments