Start your own website using your own server...Linux
Until now I thought web server(or just server) was a complex computer,with at least 8 GB RAM and a seemingly infinite hard disk.But I found that for small purposes there is no need to invest that heavily on these.For eg,if you need to host a small website that may not be/needn't be accessed by a lot of people,you could actually use your own home system as a web server.The thing is actually very simple than it actually seems.
Here are the steps.
1.Open terminal
2.If you haven't configured the root account in your system please do it by the following command.
sudo su
and enter your password.Then add new password for the root user."root" is the most powerful user of a linux system,with permissions to do anything on anything.So be careful while choosing your password.Make it necessarily strong.
After creating the root user,you get logged in as root.
3.Next install a web server.Apache server is a popular webserver.Install it using the command
apt-get install apache2
Add sudo in front if you are not root.
4.Now the apache2 webserver is running on your system.Install PHP,MySQL etc if you need those in your website.
Also there is a popular server called the LAMP(Linux Apache Mysql PHP) which contains both PHP and Mysql.
5.To install LAMP,run
From the list that appears select LAMP server.
6.Now you are ready to start hosting.Put in your website file onto the
/var/www/
directory and access them using your system IP address which can be obtained by running ifconfig command
Note that the IP you are using will be temporary(if you have not "purchased" a constant IP) and will change every time you restart the connection.You can rely on redirection sites like no-ip.com that provides you with a domain name.The queries to that domain will be redirected to your current IP by means of an application that updates your IP on their server.The steps to configure the no-ip is given in their faq sections.
If you use mobile phones or USB modems for internet,the application wont work as it updates IP at startup.If this is your case please run the python script below to update your IP.(after you are connected ).
AutoUpdate.py
Here are the steps.
1.Open terminal
2.If you haven't configured the root account in your system please do it by the following command.
sudo su
and enter your password.Then add new password for the root user."root" is the most powerful user of a linux system,with permissions to do anything on anything.So be careful while choosing your password.Make it necessarily strong.
After creating the root user,you get logged in as root.
3.Next install a web server.Apache server is a popular webserver.Install it using the command
apt-get install apache2
Add sudo in front if you are not root.
4.Now the apache2 webserver is running on your system.Install PHP,MySQL etc if you need those in your website.
sudo apt-get install mysql-server
sudo apt-get install php5
sudo apt-get install libapache2_mod_php5
sudo /etc/init.d/apache2 restart
Also there is a popular server called the LAMP(Linux Apache Mysql PHP) which contains both PHP and Mysql.
5.To install LAMP,run
sudo apt-get install tasksel
sudo tasksel
From the list that appears select LAMP server.
6.Now you are ready to start hosting.Put in your website file onto the
/var/www/
directory and access them using your system IP address which can be obtained by running ifconfig command
Note that the IP you are using will be temporary(if you have not "purchased" a constant IP) and will change every time you restart the connection.You can rely on redirection sites like no-ip.com that provides you with a domain name.The queries to that domain will be redirected to your current IP by means of an application that updates your IP on their server.The steps to configure the no-ip is given in their faq sections.
If you use mobile phones or USB modems for internet,the application wont work as it updates IP at startup.If this is your case please run the python script below to update your IP.(after you are connected ).
AutoUpdate.py