How to make a server from your home PC. What is a home server? Simple, but tasteful


As you know, the most reliable, convenient and cheap hosting is http://127.0.0.1.

What can it be useful for? Firstly, directly as hosting. It’s unlikely for private use, but good enough for quality. Secondly, as a test site for the site. Thirdly, it's just interesting.

So what is better to use. There are many shells for web development. They are ported versions of programs for Linux and Unix-like systems. They include PHP, MySQL, Perl, Sendmail, Apache and much more. Only shortcomings are often encountered, including non-working parts of the complex, the inability to restart services, unstable work and security holes. In principle, it can be used as a test site. But nothing more.

Web server on ubuntu for local network

It's best to use native full-featured services by installing Linux - similar system. In this case, everything is customized for a specific situation. And it’s better to do development in an environment that will then be used in work.

So, let's assume that there is a router with Internet access. There is also a test server on Ubuntu Server 16 named webs. It is necessary to install a web server for testing projects and their further migration to hosting.

LAMP installation

We will use a combination of Apache + PHP + MySQL.

Before installation, we will update the system.

sudo apt-get update

sudo apt-get upgrade

Let's install Apache + PHP + MySQL.

sudo apt-get install apache2 php libapache2-mod-php php-mcrypt php-mysql mysql-server mysql-client php-gd

During installation, be sure to specify the user password for MySQL.

In the /etc/apache2/apache2.conf file, add the ServerName variable at the very end. This must be a domain name or .

Eg

ServerName 192.168.0.160

DIY home web server

The main configuration is installed. Let's check the functionality. To do this, go to http://192.168.0.160 and see the apache welcome page.

Checking PHP work. By default, the web server root folder is located in /var/www/html. We remove the index.html file from it and create an index.php file.

rm /var/www/html/index.html|echo ‘’>/var/www/html/index.php

If the browser displays PHP information, then everything is working.

Setting up Samba

Now you need to configure access to web server files and access to web server by name. Without a server configured on the network, it will ping solely by IP address. Therefore, you need to install and configure Samba.

sudo apt-get install samba

Edit the file /etc/samba/smb.conf.


netbios name=webs
security = user
map to guest = bad user

We create a section for accessing files.


comment = html
path = /var/www
browseable = yes
read only = no
guest ok = yes
directory mask = 0777
create mask = 0777

Reboot the service.

sudo service smbd restart

After the restart, the WEB server files will be available via the link \\webs\html

We have a ready-made platform for experiments.

Access to local server from the Internet

Now you need access from the Internet. Register for free Domain name in zone GA (Gabon). To do this, go to the website http://www.freenom.com. Register, search and register a free name. When registering, we indicate our external IP address. This service allows you to use your own DNS, so there is no need to register your name on a free DNS server in advance. After some time, the name will be replicated to the DNS servers and will become available.

In the /etc/apache2/apache2.conf file, you need to change the ServerName variable to the registered name.

In the router settings, you need No. 80 for the local IP address of the server.

It happens that hobbyists and IT professionals create data centers in their homes, placing equipment in makeshift server rooms, garages, basements or home offices. Such people are called server huggers. These are people who want to be closer to the equipment they use.

Home data centers, or “cave data centers” as they are called, play an important role in modern life and the development of IT technologies. These DCs, as opposed to large-scale data centers, are pioneers in testing server equipment. These types of enthusiasts have a passion for IT and, as a rule, are among the first to start using new server systems, testing them under extreme conditions.


The reasons for creating such data centers are varied. For example: small web hosting, launching your own unique projects, or just a passion for electronics and IT. Whatever the motivation, such a project will still require some adaptations, including both tweaking the power and network connections and adapting and updating the cabling throughout the house. We offer you several examples of such projects.

Cloud in the basement

Canadian IT specialist Alain Boudreault has in his arsenal enterprise-class equipment from manufacturers such as Dell, HP, Sun, Juniper, IBM and IBM BladeCenter. He placed racks with this equipment in the basement of his house. His website provides a detailed overview of the installation, including diagrams of all the components. The data center includes an Open Stack MAAS (Metal as a Service) cloud and several data storage systems (ISCSI and Fiber Channel).

“My first step was to install an electrical substation that could provide 40 amperes of current at 240 volts, i.e. capable of handling a load of 9.6 kW/hour if necessary,” says Alan. He teaches application development and uses his DC for testing. “The servers are rarely running all at once, so the average consumption is 1-2 kW per hour,” he says. The cost of electricity in Quebec is about 7 cents per kW. Boudreau writes that this type of DC is not for the faint of heart.

Data Center - YouTube Star

Some home DC owners post videos about them on YouTube. The most popular of these is the Home Center Data Project, another Canadian project that began in 2005 with two computers in a closet and grew to over 60 servers by 2013. The project was documented in a series of videos that have received over 500,000 views on YouTube. The videos and website also document extensive cabling, cooling, and network infrastructure improvements.

“This project was not developed for profit,” writes developer Etienne Vailleux of Hyperweb Technologies. “This installation was built as a hobby, but after a while it quickly grew into a passion.”

In 2013, the project migrated from one house to another. “Part of the foundation was specifically designed to accommodate servers and air conditioners,” Valle said. “The project currently contains 15 servers with a connection capacity of 60 Mbit/s.”

Surprising your provider

Sometimes people install entire data warehouses. For example, in 2012, an IT professional known as houkouonchi posted a video of his rack that received over 220,000 views on YouTube.

“The installation was not actually done in a data center. Not many have a full-size rack capable of storing more than 150TB of data,” he wrote. “The post is anchored through the wood floor into the cement foundation of the house. A fully equipped rack uses only 1 kW of power, but its throughput is a completely different matter.”

In 2013, houkouonchi said he was contacted by Verizon, which was surprised to see the user home internet, generating more than 50 terabytes of traffic per month. Hosting a server with such a large traffic generation violated the terms of service for the home Internet service, and he was forced to switch to a business plan.

Here is a tour of the houkouonchi stand posted on YouTube

Stands from IKEA

Why use standard data center racks in your home when you can store the equipment in a stylish table from IKEA? In one home data center implementation, hobbyists adapted a Swedish LACK side table to comfortably host servers and network equipment, creating LACKRack. It turns out that the space between the legs is 19 inches. The width of a standard slot in specialized server racks is the same. Improvised units were created using corners screwed to the table legs.

The absence of racks stimulated the emergence of many design innovations. Frank Dennemen, technology evangelist at PernixData, adapted LACKRack's initial specification to create a portable 19-inch rack.

“My home office is designed to be an office, not a data center,” Denneman writes. “So I tried to accommodate 19-inch server racks without ruining the aesthetics home office" You can place this rack anywhere in the house.

What a proper mini-server should look like

So, you are the head of a company and have decided to organize a server room in the office, or simply an enthusiast who has decided to try everything in life and build a server room at home, in the basement or in the garage. It is not so important why you need a server room, if you have already decided to create such a miracle, you need to know what it should look like. Ideally, the server room should comply with the TIA-569 standard. The list of requirements for a room allocated for a server room looks something like this:
  • the minimum area should be 12 sq.m, and the ceiling height should be at least 2.44 m;
  • the room should not be decorated with flammable materials;
  • there must be at least one double grounded socket in the room, and if you strictly follow the standard, in a room with an area of ​​12 square meters there should be 4 such sockets;
  • the server room should be located away from strong sources electromagnetic radiation (a server room at a distance of 2 m from the transformer booth is a bad idea);
  • It is recommended to use halogen lamps for lighting in the room; “economical lamps” are also suitable, which will provide minimal heat generation, good lighting and a long service life;
  • The humidity in the room should be 30-55% at a temperature of 18 to 24 degrees Celsius.
Requirements for the rack itself:
  • The rack width must be 19 inches (482.6 mm);
  • the depth is selected depending on the equipment used: 60, 80 or 90 cm;
  • mounting holes are located on vertical elements posts every 1.75 inches (4.4 cm);
  • The height of standard racks is 6.12, 20, 42 U, etc.
The optimal temperature for server operation is 20 degrees Celsius. This does not mean that the entire room should be exactly this temperature; it should at least be in the rack with the servers. And if you cannot afford to buy a server cabinet with cooling or an air conditioner, then you can solve this problem with the help of ordinary home fans, by being smart and assembling a rack from them that will perform the same function as the cooling door in the server cabinet.

To minimize possible power problems, you should use an uninterruptible power supply. A 5-6 kVA UPS is best suited, but if your budget is limited or you do not plan to use powerful equipment in large volumes, but if you want, for example, only 3 or 4 machines, you can use a weaker UPS at your own peril and risk. Sales consultants can offer you UPS with different topologies: Line-Interactive UPS, Passive Standby (Off-Line) UPS and Double-Conversion (On-Line) UPS. Manufacturers claim that Line-Interactive UPS is the best option for home servers, but this is not entirely true. Still, the best option is a UPS with On-Line UPS topology (continuous operation), for example, APC Smart-UPS RT 5000VA.

These tips are the main things you need to know to set up a server room and comfortable work Your equipment.

I would like to add that no matter how tempting the prospect of hosting servers at home may be, it is worth remembering and understanding that it will be quite difficult to achieve acceptable uptime at home. As an example, I’ll give you a few words from the forum.

There will not be uptime even close to 5 minutes per year due to the human factor. This is what happened in my practice and led to such a low uptime:
  • forgot to pay for internet;
  • The screw in the server died, there was no raid;
  • clogged with dust - needs to be cleaned;
  • the fan is dead - it needs to be replaced;
  • touched a wire;
  • the server was used as a file dump, the space ran out because several films were recorded;
  • The Linux kernel was not updated, the computer did not reboot;
  • the provider suddenly changed the DNS settings;
  • the light blinked;
  • parents decided to wash the floors;
  • the sata cable fell out of the connector;
  • The wi-fi card that distributed the Internet suddenly froze and brought the computer into a stupor, etc.

It is also necessary to remember that:

  • this is not a cheap idea;
  • It will be difficult for you to ensure optimal conditions for the servers to operate;
  • in case of fire, etc. You risk not only data and equipment, but also your living space;
  • Constantly monitoring the operation of servers is only possible if you are always within easy reach of your server room;
  • at long trips Your project will be frozen, since leaving the equipment turned on without review is a big risk.
Renting equipment from a DC is much more feasible. There your equipment is always under supervision. In addition, DCs are built exclusively for servers and are maximally optimized for comfortable operation of the equipment. You are freed from the need to buy expensive equipment, and pay for hardware only when you need to use it. Also, rented equipment provides for the presence of a number of specialists for quick solution problems. And the most important advantage: your equipment may be located outside the country of your residence, which in turn can protect you from the visit of unexpected guests.

10 signs that you are a serverophile

  • You prefer large premises with air conditioning and a minimum of upholstered furniture, as well as fluorescent lighting;
  • constant hum and white noise soothe you;
  • using a digital fingerprint or manual biometrics to gain access to rooms is still of interest to you;
  • You can't get past dirty or disorganized cable connections without expressing disapproval or shaking your head;
  • a flashing green or yellow light has a calming, almost hypnotic effect when you look at it;
  • You like the feeling of cold from metal racks, you often want to touch them;
  • You think that the cloud is the same as virtualization, something worth looking into someday, but for now it needs to solve current user problems;
  • You believe that cloud data is not secure, no matter what the provider tells you;
  • You have your own thoughts on how to improve the operation of equipment through direct influence (for example, replacing elements);
  • You have a passion for computer hardware, always trying to improve it and find innovative solutions for optimal performance.
Do you know examples of cave DCs? Perhaps such craftsmen live in your house, or have you installed a small stand yourself? Share your experience.

When the capabilities of the standard router with “openwrt” on board were completely exhausted and the processor load began to affect the stability of the network, it was decided to relieve the hard worker by transferring the functionality to home server. In view of the fact that the hardware will be several orders of magnitude more powerful, it was decided to equip it with a bunch of additional features, which the old man never even dreamed of. It was also decided to make the body ourselves.

List of tasks that a home server performs:

  1. Virtualization server based on virtualbox with WebGUI;
  2. Firewall;
  3. Transmission-based torrent downloader and file server;
  4. Telephony server based on Asterisk;
  5. TFTP server for downloading over the network and configuring various equipment;
  6. Private cloud for storing files based on “owncloud”;
  7. Ace Stream HTTP proxy for watching TorrentTV;
  8. Hosting for a home website with access via https;
Photo to attract attention:

Chapter 1. Case creation, assembly

Basic functionality described, let's proceed to the selection of hardware for this entire economy.

After much thought and a couple of tests, the following components were purchased:

  1. Maternal msi board j1800i Mini-ITX format;
  2. 2 DDR3 memory sticks of 2 GB;
  3. 230 W power supply;
  4. 2 hard drives 2.5’ by 320 GB, were in stock;
  5. The tp-link 1043ND router was in stock (It was a shame to throw it away);

After estimating the dimensions, it's time to make one for them. new house, I didn’t consider buying the case, since I can’t buy what I want in my city, and it’s interesting to make it myself.

Unfortunately, there are no photographs of the process of creating the case, but I will briefly describe the process. After completing the creation of the drawing, it was transferred to 6 mm thick plywood and cut out using a cutter assembled on a knee from an old transformer and nichrome thread. You can see how to make something like this yourself.

The result was the following

Chapter II. Settings

We've sorted out the hardware part, now it's time to start setting up the functionality. 64-bit “Debian 7 netinstall” was selected as the OS; during the installation process, the disks were combined into software RAID0. Anticipating the holivar, on the topic of fault tolerance, all important data lies in the clouds, so if a disk fails, deploy the system from backup copy you can do it pretty quickly.

The system is installed, we begin to implement the above plan.

2.1 Virtualization server based on virtualbox with WebGUI

To make maximum use of hardware resources, you will need to install a virtualization server; in this case, the virtualbox software package is used.

Installing virtualbox + phpvirtualbox

We install the virtualbox virtualization server on our server, first add the repository and keys to it:

Deb http://download.virtualbox.org/virtualbox/debian wheezy contrib non-free wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | apt-key add -

We update the repository and start the virtualbox installation:

Aptitude update aptitude install virtualbox-4.3
Install the extension for virtualbox:

Wget http://download.virtualbox.org/virtualbox/4.3.14/Oracle_VM_VirtualBox_Extension_Pack-4.3.14.vbox-extpack VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.3.12.vbox-extpack
Reboot the vboxweb-service service with the commands:

/etc/init.d/vboxweb-service stop /etc/init.d/vboxweb-service start
For Virtualbox to work, you need to create a user under which the virtual machines will run.

Add user vbox:

Adduser vbox

Installing phpvirtualbox

First, let's install apache and php:

Apt-get install apache php
Download phpvirtualbox:

Wget -c -t0 http://optimate.dl.sourceforge.net/project/phpvirtualbox/phpvirtualbox-4.3-2.zip
Unpack the contents of the phpvirtualbox-4.3-2.zip archive into the web server folder:

Unzip phpvirtualbox-4.3-2.zip
Rebooting the web server:

/etc/init.d/apache2 restart
Go to the phpvirtualbox directory in the web server folder and create a configuration file:

Mv config.php-example config.php
Let's make some changes:

Nano config.php var $username = "vbox"; var $password = "Password when creating a vbox account"; var $location = "http://IP Address of this machine:18083/"; var $consoleHost = ‘IP Address of this machine’;
Editing the virtualbox configuration file:

Echo "VBOXWEB_USER=vbox VBOXWEB_HOST= IP Address of this machine VBOXWEB_PORT=18083 " > /etc/default/virtualbox
Let's restart virtualbox:

/etc/init.d/vboxweb-service restart
Open the address of our server in the browser:

http:// IP Address of this machine/phpvirtualbox/
login: admin
password: admin
The web interface is practically no different from the desktop version of Virtualbox.

2.2 Firewall

Let's start designing a home network; in the general concept, the network looks like this:

You will have to reconfigure the router a little. In the “openwrt” settings, we create the required number of VLANs and distribute ports among them, since there is only one ethernet port on this motherboard, we make it a trunk port and set up all VLANs with tags for it.

Reconfiguring network adapters on our server, before this you need to install the package for vlan support: apt-get install vlan.

Setting up a network on the server

# The loopback network interface auto lo iface lo inet loopback #NATIVE VLAN NETWORK auto eth0.1 iface eth0.1 inet static address 192.168.1.3 netmask 255.255.255.0 gateway 192.168.1.1 vlan_raw_device eth0 up ifconfig eth0.1 up #PROVIDER1 VLAN auto eth0 .2 iface eth0.2 inet manual vlan_raw_device eth0 up ifconfig eth0.2 up #PROVIDER2 VLAN auto eth0.3 iface eth0.3 inet manual vlan_raw_device eth0 up ifconfig eth0.3 up #SIP VLAN auto eth0.4 iface eth0.4 inet manual vlan_raw_device eth0 up ifconfig eth0.4 up # GUEST NETWORK auto eth0.10 iface eth0.10 inet manual vlan_raw_device eth0 up ifconfig eth0.10 up


As firewall I chose to implement "cisco ASA" on a virtual machine. I won’t argue: the solution is strange, incredibly crutch, but is due to the need to connect to the work networks of several companies via “IPsec site to site vpn” with similar hardware, but in a normal version.

I would immediately like to note that it has been working stably for 4 months, there are no problems, the link is stable, the connection speed with this implementation turned out to be ~ 20 Mbit/sec, which is quite good, considering that the volume of transferred data is small. In my implementation, this virtual machine manages all incoming and outgoing connections in all VLANs of the home network, the total system load does not exceed 12%.

We download the image of the virtual machine “Cisco ASA 8.4 for vmware”; I will not give a link in view of the fact that the first link in a search engine will most likely lead you to it. We upload it to our server and import our machine into virtualbox. Along the way, we change all the adapters to “PCnet-PCI II” and after importing, distribute them in bridge mode across the created VLANs. Also in the settings of the serial port we create pipe /tmp/tts0 by means of which we will carry out initial setup our undercisco.

Further configuration is quite specific and depends on your tasks; in my opinion, it is pointless to provide the ASA configuration file, since it is better to read the settings of interfaces, access lists, NAT, VPN and other things separately, since this is the topic of more than one or even a dozen articles . I will describe only the basic things that I use. Firstly, routing, since all networks are connected to it, and it is also the default gateway for the home network and for the guest network. Secondly, “anyconnect” is deployed on it to access home network via VPN. Basic settings“Cisco ASA” can be read in the article “You’ve got your hands on it: let’s continue about ASA” from the Fedia website, the rest can be found on the Internet if necessary.

The first provider is the main one, the configuration implements a mechanism for switching to the second provider if the first one is not available, so that the second one does not get bored at this time, the free open guest access point is configured for it. Based on the congestion of the second channel, the neighbors are very happy about this gift of fate.

2.3 Transmission-based torrent downloader and file server

Quite a few keyboards have been written about the description of setting up this functionality, but I’ll still describe the setup here for the heap, so to speak.

Of course, you will have your own Samba configuration, but I’ll give you mine as an example.

First, let's install the Samba server with the command:

Apt-get install samba
And edit the configuration file /etc/samba/smb.conf:

Workgroup = WORKGROUP netbios name = NAS server string = NAS File Server log level = 1 security = share unix charset = UTF-8 dos charset = cp1251 store dos attributes = yes max log size = 10 comment = NAS SERVER FOLDER path = /home/ NAS create mask = 0777 directory mask = 0777 public = yes writable = yes printable = no guest ok = yes read only = no comment = NAS SHARE FOLDER path = /home/NAS/Share create mask = 0777 directory mask = 0777 public = yes writable = yes printable = no guest ok = yes read only = no comment = OWNCLOUD FOLDER path = /home/NAS/owncloud/ create mask = 0777 directory mask = 0777 public = yes writable = yes printable = no guest ok = yes read only = no comment = TORRENTS FOLDER path = /home/NAS/torrents create mask = 0777 directory mask = 0777 public = yes writable = yes printable = no guest ok = yes read only = no comment = VIRTUAL MACHINES FOLDER path = /home/NAS /VM create mask = 0777 directory mask = 0777 public = yes writable = yes printable = no guest ok = yes read only = no comment = MEDIA FOLDER path = /home/NAS/media create mask = 0777 directory mask = 0777 public = yes writable = yes printable = no guest ok = yes read only = no


After samba settings You can start installing your torrent downloading workhorse.

It's time to tackle Transmission

Install:
apt-get install transmission-daemon
Configure transmission-daemon /etc/transmission-daemon/settings.json:
( "alt-speed-down": 50, "alt-speed-enabled": false, "alt-speed-time-begin": 540, "alt-speed-time-day": 127, "alt-speed- time-enabled": false, "alt-speed-time-end": 1020, "alt-speed-up": 50, "bind-address-ipv4": "0.0.0.0", "bind-address-ipv6" : "::", "blocklist-enabled": true, "blocklist-url": "", "cache-size-mb": 2, "dht-enabled": true, "download-dir": "/home /NAS/torrents/Downloads", "download-limit": 100, "download-limit-enabled": 0, "encryption": 1, "idle-seeding-limit": 30, "idle-seeding-limit-enabled ": false, "incomplete-dir": "/home/NAS/torrents/Downloading", "incomplete-dir-enabled": false, "lazy-bitfield-enabled": true, "lpd-enabled": true, " max-peers-global": 200, "message-level": 2, "open-file-limit": 32, "peer-limit-global": 200, "peer-limit-per-torrent": 60," peer-port": 11523, "peer-port-random-high": 65535, "peer-port-random-low": 49152, "peer-port-random-on-start": false, "peer-socket- tos": 0, "pex-enabled": true, "port-forwarding-enabled": true, "preallocation": 2, "ratio-limit": 1, "ratio-limit-enabled": true, "rename- partial-files": true, "rpc-authentication-required": true, "rpc-bind-address": "0.0.0.0", "rpc-enabled": true, "rpc-password": "**** ******", "rpc-port": 9091, "rpc-username": "transmission", "rpc-whitelist": "127.0.0.1,192.168.0.100", "rpc-whitelist-enabled": false, "script-torrent-done-enabled": false, "script-torrent-done-filename": "", "speed-limit-down": 900, "speed-limit-down-enabled": true, " speed-limit-up": 100, "speed-limit-up-enabled": false, "start-added-torrents": true, "trash-original-torrent-files": true, "umask": 0, " upload-limit": 100, "upload-limit-enabled": 0, "upload-slots-per-torrent": 14 )

2.4 Telephony server based on Asterisk + FreePBX

Calls are not cheap, especially when work is frequent and different countries, despite the fact that there are VPN tunnels to work, not deploying a telephony server would be, to put it mildly, strange. Based on the above diagram, we raise a new virtual machine and start it network interfaces to the VLANs we need. I won’t describe the installation of asterisk + freepbx itself since siv237 handled this task perfectly before me and described everything in the publication Simple installation of Asterisk + FreePBX for beginners.

After installation, we set up the necessary trunks in the FreePBX interface, configure the dial plan, create a user and enjoy life. By a miraculous turn of events, my main provider provides a landline number via SIP, which actually became the main reason for deployment of this server.

When I'm at home, my mobile phone is always connected to Wi-Fi, which is why it became my main SIP phone. If the server is unavailable, it redirects to my mobile phone via a landline. After connecting the Wi-Fi antenna located on the roof of the house, I can easily go buy bread without missing an important call and without having to pay for the Internet or for minutes when forwarding.

In the near future we plan to buy several USB modems that support the voice transmission function and configure the output to mobile networks. Save as much as possible.

2.5 TFTP server for downloading over the network and configuring various equipment;

To be honest I forgot about this one a long time ago convenient function, it used to be redundant for me, but then it just flew out of my head. Somehow, after another viewing of my favorite Habr, I came across the publication “Boot server - like a bootable flash drive, only a server and over the network,” written by Romanenko_Eugene, describing all this. I probably won’t be able to describe it better than him, so I’ll leave this part to him. Based on this article, the distributions I needed were collected and I forgot what they were bootable flash drive.

2.6 Private cloud for storing files based on “owncloud”

After several clients for cloud services have appeared on the phone, thoughts involuntarily begin to arise on how to unite all this business. As a result, it was decided to build our own cloud, add directories to it for synchronization with other clouds and enjoy life.

“owncloud” was chosen as the platform, and as external cloud providers I use box.com, dropbox, google drive, yandex disk,onedrive. The list is extensive, but the idea is simple. To begin with, we install clients on the machine and set them up to synchronize into a directory previously created for each cloud, then we install “owncloud” on top of this entire enterprise.

There is no point in rewriting the client installation guide; they can be found on specialized sites. And everything regarding the installation of “owncloud” is described by BlackIce13 in the publication “Experience of installing ownCloud 6 on Debian 7 wheezy”. All we have to do is think about what and where to synchronize in order to sleep peacefully, having a server with RAID 0.

2.7 HTTP proxy Ace Stream for watching TorrentTV

After another shutdown cable television Due to the delay in payment, a search began for alternatives, which were quickly found - TorrentTV. The only downside is that you need the acestrem client to view it.

Keeping a 750-watt monster on to distribute television directly to the TV is quite wasteful. After a short search, a solution was found - a proxy that converts a torrent stream into http. The problem was solved quite quickly, now for 60 rubles a month you can watch a mountain of channels.

The only negative is the rather slow channel switching.

Installation

First, let's install vlc:

Apt-get install vlc
Download aceproxy and acestream and place them in one directory:

Wget https://github.com/ValdikSS/aceproxy/archive/master.zip wget http://dl.acestream.org/debian/7/acestream_3.0.5.1_debian_7.4_x86_64.tar.gz
Let's create several directories nearby:

Mkdir logs mkdir scripts
In the ./scripts directory we will create several scripts:

Cd ./scripts nano aceproxy.sh #!/bin/sh python ./aceproxy/acehttp.py > ./logs/acehttp.log 2>&1 & nano acestream.sh #!/bin/sh ./acestream/acestreamengine - -lib-path ./acestream --client-console > ./logs/acestream.log 2>&1 & nano vlc.sh #!/bin/sh vlc -I telnet --clock-jitter -1 --network-caching -1 --sout-mux-caching 2000 --telnet-password admin > ./logs/acevlc.log 2>&1 &

Let's go to the directory above and create scripts to start and stop the broadcast:
cd ../ nano start.sh #!/bin/bash /bin/kill -9 `/bin/ps ax |/bin/grep acestream |/usr/bin/awk ("print $1")` ./scripts/ acestream.sh echo "Start acestream" sleep 1 /bin/kill -9 `/bin/ps ax |/bin/grep vlc |/usr/bin/awk ("print $1")` ./scripts/vlc.sh echo "Start VLC" sleep 1 /bin/kill -9 `/bin/ps ax |/bin/grep acehttp |/usr/bin/awk ("print $1")` ./scripts/aceproxy.sh echo "Start aceproxy" nano stop.sh #!/bin/bash /bin/kill -9 `/bin/ps ax |/bin/grep acestream |/usr/bin/awk ("print $1")` echo "Stop acestream" sleep 1 / bin/kill -9 `/bin/ps ax |/bin/grep vlc |/usr/bin/awk ("print $1")` echo "Stop VLC" sleep 1 /bin/kill -9 `/bin/ps ax |/bin/grep acehttp |/usr/bin/awk ("print $1")` echo "Stop aceproxy"

Let's edit the aceproxy configuration according to the wiki

Why, in fact, do you need a subject? What can he give?

If you just want to place home page or a blog, exchange files with friends via ftp, get an e-mail on your domain, probably
It will be easier for you to use the services virtual hosting, as a last resort, order a virtual dedicated server.

Also, it’s more convenient to conduct various experiments at home, since the server is nearby, and if you kill something, you don’t need to wait for a response from the hoster’s technical support, but you can immediately pick up the monitor and fix what’s broken.

Let me make a reservation right away that we are talking about a server that is intended, first of all, for access from external network.
A server that distributes content/provides web (irc, etc.) services to several entrance cars has completely different requirements :)

Not everyone has the financial opportunity to install their own server in a Data Center, but with the penetration of broadband access technologies into the World Wide Web, it becomes possible to use the server for the web and other tasks right from home.
Now this is with a high probability available to every single resident of Moscow and St. Petersburg, but I am sure that, despite any crises, a home channel suitable for the characteristics will very soon appear in every major Russian city.

What channel do you need?

First of all, it must be:

1. Wide, symmetrical and unlimited.
2. The provider must issue static IPs
3. There should be no filtering of ports, both incoming to the server and outgoing to the outside world.
4. It is advisable that there are no VPNs.
5. If the provider is ready to correct your DNS-PTR record, then this will immediately eliminate a number of problems with mail outgoing from your server.

Now in more detail on each point.

1.a Symmetry

Most home Internet channels have one feature that has almost no meaning for a user who mainly surfs: their width (also, they say, speed) varies depending on the different directions. A typical home user downloads more from the Internet than “uploads” something to some resource.

For example, such Moscow providers as Akado and Stream are ready to provide a very wide downband (“down”, for downloading), but the width of the up (“up”, for downloading) bandwidth, even on the most expensive tariff plans, differs slightly from the cheapest ones.

Unbalanced channel is terrible for home public server because the vast majority of server traffic will go up, and no matter how expensive and cool your Internet channel is, it will, in fact, be idle. Nobody will notice your tens of megabits down, but everyone will pay attention to the brakes when downloading files from your server.
For the server, one might say, the importance of down and up changes places.

Therefore, for example, channels in Data Centers and tariffs for hosting servers are designed for the fact that up traffic will be several times greater than down traffic. In Russia, most Data Centers even charge money for violations of the traffic ratio (usually incoming:outgoing 1:4, and often there is a limit on the ratio of foreign traffic).

I have never heard that an Internet provider can somehow punish for violating the ratio (that is, for the fact that you will send more traffic than download), on the contrary, I think the situation will change in the direction we need.

Many home users share files using p2p networks, and in these networks, in order to download well, you need to have a high rating, which can only be obtained by distributing content. Already now, almost all “advanced” users will go to torrents rather than to the store to find a new mp3 album of their favorite band.
Providers understand trends and adapt. Although, of course, providers can be limited by various factors: the characteristics of their channel, last mile technology (ADSL operators simply do not have technical feasibility make the channel symmetrical), etc.

1.b Unlimited

Regarding the unlimited channel, it is obvious that if the traffic is paid, an unexpected sharp increase in traffic can be very unpleasant for your wallet.
If you provide some kind of public service, it is unlikely that you will be able to control the visitors of your service and their traffic, for which you will pay.
Even if according to your tariff plan, as is usually the case with limit tariffs, outgoing traffic is free, even if you prohibit users of the service from downloading files, there will always be incoming traffic, no matter what tricks you resort to. It will be approximately a seventh to a fifth of that outgoing to the web server.

1.in Width

.
Do you have a cheap unlimited symmetrical channel? Great! What? Is it 128kb/s wide? Believe me, in this case, no one will need your service.

Your entire bandwidth will be clogged by one user of a service with broadband access, who will be very annoyed that “the card is slow.” Who will leave and never return.
I'm sorry to disappoint you, but it's probably not worth organizing a home server if your up is only 128kbs.
I would bet minimum value at 512kbs.

But 20 megabits from an Ethernet provider would be the best solution. In this case, visitors would hardly notice the difference in the speed of the service hosted at home and the service hosted in the Data Center.
There are no such channels in the regions yet, but in Moscow they are already connecting with a larger bandwidth.

Separately, I would like to say about network connectivity.
On the World Wide Web, sometimes so-called “black holes” appear in which traffic disappears. Unfortunately, hosting providers who provide space for a server in a DC usually fight for connectivity more actively than Internet providers.

It is worth immediately keeping in mind that if your site cannot be viewed by visitors from, for example, Kamchatka, the provider’s technical support may not even accept your request for connectivity for consideration, since you are using the channel for other purposes than its intended purpose.

2. Static IP address

Some providers, such as Stream, simply do not issue home users a static IP address.
If the server’s IP address constantly changes, users of your services simply will not be able to access them.
You can try to get out using DynDNS services and even host the site like this:

host h.shaggy-cat.ru
h.shaggy-cat.ru is an alias for shaggy-cat.dyndns.org.
shaggy-cat.dyndns.org has address 91.77.252.108

Here the third level domain is a CNAME record referencing the host free service dynamic DNS.
From time to time, your server connects using a special program to the DynDNS service, which updates the A-record value for your domain.

The dyndns.org service supports free of charge only third-level domains, subdomains of domains belonging to the service.
If you are willing to pay, the service can provide you with support for your domain.

When I didn’t have a channel with a static IP, I did it simpler :) I just created a DNS CNAME record.

You can read about setting up DynDNS in Redhat-like systems.
Typically, ADSL modems and cheap home hardware routers can use dyndns.

However, believe me, you can avoid a huge number of problems, sleepless nights, and mistakes that you will step on if you simply connect a static IP address.
By any means: by paying for it as an option on your tariff plan, by getting drunk on your provider's admin panel, and ultimately by sleeping with him if you're a girl :)))
All the effort you make to get a static IP will pay off.
My personal experience indicates only constant glitches of DynDNS services :(

I got a static IP easier: I went to another Internet provider. I left the stream as a backup link for now, switching to the cheapest tariff plan.

3. Port filtering

Some Internet providers, tired of complaints from infected clients, simply disable incoming ports for their clients, through which network worms and attackers can damage their client’s computer.
Often the list of ports also includes ports through which Windows systems are usually not Trojaned. For example, Stream blocks incoming ports: 80 (goodbye web server!), 21 (goodbye ftp!), 25 (goodbye mail mx server!)

It is clear that users are unlikely to appreciate the beauty of your site’s URL if they have to access it in some way:

http://pupkin.ru:8888

As for filtering outgoing ports, port 25 filtering is usually used so that a massively infected Win user does not spam.
This may cause some inconvenience if, for example, you want users of your services to receive notifications by mail.
In this case, you can try setting local SMTP server relay mail via another SMTP using, for example, instructions: ttyts.
It is not at all necessary to use the provider's SMTP; you can use your regular free mailbox.

4. VPN and *nix systems.

How much pain, suffering, despair and complete disappointment lies behind this phrase!!
Setting up a VPN for stable operation, sufficient for the server, was and remains a huge problem for a newbie.
Even with optimal setting You should take into account that your VPN connection will drop from time to time, and you need to write scripts that will detect the drop in the channel and distort the connection.

Even if you are going to use the server under Windows, you will face the same problems with channel stability, if not greater ones, related to the features of the network subsystem device
this operating system (I haven’t used such a server myself, but one very good person told me terrible things)

It is possible to simplify the setup by using a hardware router. But a hardware router will not add a single drop of stability to the same buggy poptop.

In Moscow, Corbina Telecom is switching to an L2TP VPN connection, they say that it is much more stable.

If you can, connect to a channel that uses authentication based on the network card's MAC address.
In Moscow, these are, for example, Su-29 Telecom, Qwerty, Akado.
However, VPN is not as bad as it is bad dynamic IP address. If a VPN is unavoidable, be aware that poptop is probably the most unstable.

5. Port filtering

If the provider does not filter outgoing ports, then mail sent directly from your server is highly likely to end up in the spam folder of the destination mailbox.
This is due to the fact that almost all spam in the modern world is sent from compromised computers of home users running Windows. IP addresses issued to such users usually have a characteristic DNS PTR record of the form:

host 91.77.252.108
108.252.77.91.in-addr.arpa domain name pointer ppp91-77-252-108.pppoe.mtu-net.ru.

It is quite simple to write a regular expression (you can search for examples on Google) that distinguishes such hosts from “legitimate” SMTP relays.

If your provider corrects the PTR record for your IP, mail from your server will no longer be filtered by this criterion.

7. Server hardware

Here I find it difficult to give any detailed and professional advice, because I simply have a very poor understanding of hardware, which has never been interesting to me.

The more cores a processor has, the better. In general, the faster it is, the more correct it is. Just don’t overclock the system to cosmic speeds and tune it with hundreds of coolers, because you’ll also have to sleep at night next to this monster...
If you use virtualization technologies such as Xen, KVM, VmWare, pay attention to processors that support Intel Technologies VT or AMD Pacifica

The more RAM, the better. Especially when using Virtualization.

You don't need a fancy video card or a sound system in general. It is better to take a motherboard with integrated video, so that you can use a free PCI slot for, for example, a network card.

UPS. Very, very desirable. Just as one good person suggested to me, it’s worth activating the power-on option in the BIOS.

- “Rack”, put the server somewhere far away, so that the buzzing does not interfere, you do not accidentally fill it with liquid, drop it, and so on.
Better on the mezzanine or in the pantry. Just keep in mind that: a) dust is bad; b) In the summer, due to global warming;) in a small, stuffy kennel, it can simply overheat and turn off :(
However, problems with overheating are also possible in data centers. .masterhost was almost awarded the Runet Anti-Prime for the original technology of cooling servers with dry ice :)))

8. Software

It is most important. Something without which there will be no server as such. You can manage to organize a popular service on a dynamic IP with port filtering and an old, old Pentium-2, if you have an idea and a specific software implementation.
On the contrary, you can waste time and money and end up with a dead piece of hardware.

I use OpenVZ industrial virtualization technology on my HomeServer. You can read about it and

I use it because it’s easy to experiment with ( new container with almost any Linux distribution it is created in two to three seconds), there are no losses on virtualization, and because I consider the technology to be very progressive.

However, OpenVZ is beyond the scope of this post, I hope someday I’ll get together and talk about it and its use, just like now, on my fingers.

I recommend using some kind of virtualization technology, since you may want to host many different services on your server, each with its own requirements for the software environment (sometimes incompatible with the requirements of another service that you would also like to use) provided resources, with different attitudes of developers towards the safety of their product.

Using virtualization on a home server, you will get the same consolidation, and the house, in the end, will not turn into a branch of the data center.
One or maximum two powerful computers will be enough for you to solve any problems on virtual machines hosted on the server.

I advise you to pay attention to the following technologies:

a) Xen
b) KVM
c) OpenVZ
d) _server_ options VmWare

A detailed description of these technologies is also beyond the scope of the article; I will only express general considerations.

The most fashionable solution for virtualization now is VmWare. Its popularity is due to its ease of setup and administration.
However, VmWare is not without its drawbacks. The main one is that the most powerful version of VMware ESX Server costs money (free VMware Server looks very dull next to Xen or OpenVZ), also, I would note not the best hardware support, and large performance losses during virtualization.
I think VmWare can be called a pop solution, if you want “everything at once” and are willing to put up with some inflexibility of the solution, there is probably nothing better than VmWare for you.

KVM is perhaps the most promising technology of all of the above, taking into account the attention RedHat(tyts) pays to it and the dynamics of RedHat itself. However, now the technology clearly remains behind its competitors in terms of the number of features.

Xen Very interesting and powerful technology. There is a site with a large number of Russian articles about Xen. When I chose software platform, hesitated for a long time between Xen and OpenVZ. I chose, as I wrote above, OpenVZ

OpenVZ The main advantages are that the technology, as I wrote above, works with virtually no performance loss, that there are dozens of VPS templates with a variety of software and different distributions that can be deployed in moments.
Very convenient for experiments :)
The main disadvantage is that they are virtualized only Linux distributions

This paragraph does not reflect even a fraction of what OpenVZ has become for me. I really, really hope that I will get together and write an article on using this system.

If you plan to use several virtual servers, and there is only one external IP address (this will most likely be the case with a home server), you can give virtual machines IP addresses from ranges intended for local networks, and forward ports from external IP to virtual machines (Iptables DNAT in Linux).

If you are planning more than one web server, then port forwarding will not help. I got out of it using the nginx accelerating http reverse proxy on a separate VPS.
This nginx proxies http connections to one or another VPS. Maybe I'll tell you about this someday :))

ZY Reprinting is permitted only with a link to the original of this note.

Successful setup of your home server, and... bother with computers less, walk more often, go to a museum/theater/cinema/visit/travel!

With this review I open new section site called "". In the section, you will learn a lot of interesting things about creating your own personal server, installing the necessary software. All this together will help you organize your server and even hosting for the site. And at home!)

Accordingly, in this review we will talk about the myths and common misconceptions about this confusing topic. Which greatly influence the user’s decision in favor of creating a home server. An example would be my personal experience in detail. This will be the best example for those who find it difficult to choose a solution for hosting a website. Home server for the site. Basic myths about home servers and reality. Let's start!

The content of the article:

Home internet server for website

Nowadays, the Internet is available in almost every home, and the cost of Internet services is decreasing. Over time, the quality of Internet speed is only growing, and channel capacity is also growing. All this gives us the opportunity to create a server at home. At the same time, the costs of its maintenance will be minimal compared to the costs of a hosting provider.

This is a very expensive pleasure

This is the most common myth on the Internet, that creating a server at home is expensive. In fact, it's up to you. You yourself have the right to decide on what hardware to install the server. And you decide how much to pay for the Internet. Many people do not use necessary computers under this brainchild. For example, if you bought a new PC, you don’t need to throw away the old one.

Just give it a new life, most used PCs handle simple websites well. However, I recommend using new hardware for these purposes. Buy not expensive system unit and rejoice. There will be plenty of that.

The server consumes a lot of electricity

Many people write online that maintaining a home server is expensive. To be precise, this is mostly addressed to the costs of electricity and the Internet. Well then I have a counter question, but the TV, refrigerator, kettle, iron do not consume anything at all. This is the funniest misconception on this topic. God willing, I get 30-40 watts.

It's smaller than a refrigerator. At the same time, my server works around the clock every day. Draw conclusions about server consumption large quantity electricity is possible, provided that you have a whole server room at home. In this case, the cost of electricity is truly commensurate with the equipment.

Payment for Internet and IP or costly use of a server for the site

This misconception is even worse. How expensive it can be to pay for the Internet. You pay for the Internet! Pay! Let me explain in more detail:

  • I use the Internet from Rostelecom. The speed is 60 MB, in fact a little higher, it costs me 490 rubles.
  • Additionally, I pay for a static IP; this IP does not change the address. The service costs 150 rubles.
  • In total, I pay 640 rubles for the Internet. Well, and accordingly for the domain and DNS server(once a year).

As you can see, not so large sum, compared to renting a server. Moreover, in this case you pay for the Internet, as before, plus 150 rubles for static data. And in the case of renting a server, you will pay your uncle twice as much. At the same time, you will also pay for your Internet.

The server is very noisy like a turbine

A common misconception. If you use a PC or laptop for the server, then there will be practically no noise from them. Of course, real server solutions make noise like airplanes. But you must understand that such equipment is not created for home use.

Suitably equipped for the required loads. Such a server may have a huge number of cooling systems. No wonder it makes noise like a turbine. With all this, a home server usually has 3-5 coolers. Which work quietly.

Home server is vulnerable to hacker attacks

This is another serious misconception that many are afraid of. Your server cannot be vulnerable to attacks if you have configured everything correctly. Some home servers have more powerful protection than large companies. When you start making the first settings on your server. You will immediately understand which places are vulnerable. For example, this applies to ports to a greater extent. Which should be blocked from outside access. This is the most necessary security setting of all.

The home server will not work over a regular Internet connection

Complete nonsense! Works great, even via mobile Internet. The individuals distributing such articles have apparently never used such a server or are simply illiterate. Even a 30 MB channel is enough to run a good website. At the same time, attendance can be 1500-2000 people per day.

Moreover, it is worth considering that such a number of readers will not visit your site in one second. Even on professional hosting, the site simply cannot withstand such a huge load per second or minute. At the end of the article I will tell you in more detail all the details of creating a server. By personal example.

Only specialists and professionals in their field can configure the equipment

Such people simply did not succeed and they spread such rumors out of anger - this is a complete fallacy. Or there may be those who deliberately write such articles. Precisely in order to occupy a significant place in the search, while playing on the lack of knowledge of users of this topic. There is nothing complicated about setting up a home server. Of course, for proper operation of all software, it takes time and nerves. At the same time, there are many ready-made ones on the Internet software packages to the server.







2024 gtavrl.ru.