Making your own mini-hosting: Working with LAMP

   And so, this article may be proposed continuation of record: and so let's create a mini hosting: Installing LAMP. The problem is, what I wanted to post this article in your home directory, not the system partition, in this case, my files are always safe and secure. And also, you need to rename the folder from the folder to the database the new database MySQL.

    First, we need to create a folder for our beduyuschih sites. For example, you can extract this us www folder and send it to the address / home / user / www / and here is mainly to store my data sites.

Activate Mod Rewrite.
In order to set the ground under normal SEO CNC on wordpress will need to put in a performance mod rewrite.

sudo a2enmod rewrite

Then, after this work is necessary to restart Apache for the activation of the necessary configurations, it is necessary by running the familiar command us:

/etc/init.d/apache2 restart

   Then, you need to immediately add a line to make a website to use mod rewrite, it is necessary for that to every time you create a project configuration is not set again, and turn it into an already similar ranyuyu us normal recording on shared hosting. Write the following: 
sudo gedit / etc / apache2 / sites-available / default
It is necessary to find the right text us:
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow, deny
allow from all
and make the change AllowOverride None to AllowOverride All. Let's save the document before us and leave:
Let's now create your first website site.lan:
   Firstly, you need to create a new entry for the virtual host for this folder write: 
/ etc / apache2 / sites-available /, we just copied the standard default configuration and renamed it site.lan
sudo cp / etc / apache2 / sites-available / default /etc/apache2/sites-available/site.lan

   Second open files created by us and we will do site.lan few easy steps: 
sudo gedit /etc/apache2/sites-available/site.lan
In this case you need to change it all over again / var / www / on /home/user/www/site.lan (that would transfer the file to my folder will need to create a new folder named for the transfer site.lan). Then it is necessary to stitch «DocumentRoot /home/user/www/site/site.lan/» add another line «ServerName site.lan»

   After the work performed, we get this: 
ServerName site.lan
DocumentRoot /home/user/www/site.lan/
Thirdly it will be necessary to make our website all dostuponoy:
sudo a2ensite site.lan
sudo gedit / etc / hosts
Fourth add: site.lan
Fifth restart Apache, whatever our configuration started to work:
sudo /etc/init.d/apache2 reload
Finally we did it! All blo very easy and not difficult.

   What would you add other sites, you need to use the first and the third step, you need to bear in mind that the names would have existed :, tobish site.lan in our case, and write IP in / etc / hosts to create a superior, the address for the previous project, for example,, for the third, etc.