📜 ⬆️ ⬇️

Home server for a web developer: setting up Ubuntu 9.04

Content:

  1. Introduction;
  2. Iron;
  3. Cooking flash drive;
  4. Install Ubuntu 9.04, start up;
  5. Homemade SAMBA;
  6. Apache, PHP, MySQL, phpMyAdmin;
  7. (to be updated on 09/23/2009) SVN (Subversion);
  8. (to be updated on 09/23/2009) VSFTPD or FTP humanly;

1. Entry.


Why do I need a home server will not describe. Everyone decides for himself.
My requirements for DS were as follows:

Climbing all the available links, I did not find the comprehensive article of the guide I needed, for a beginner ubunt-gadget, and just a complete article. Therefore, this manual, the so-called “Step By Step Install”, was assembled in parts. Upon completion, I decided to try to describe the clean installation and configuration of Ubuntu 9.04 from scratch, all in one article (and the development, soon, will be in the blog).

One more thing. Home server implies a dedicated channel , and preferably also with a dedicated IP address, although DynDNS is quite suitable for some people, but I preferred to pay UAH 10 per month ($ 1.2) to my provider, so the DynDNS question in this article, not yet considered. Having a good speed - 4 Mbit / s for the world and 100 Mbit / s for Ukraine (UA-IX), makes it possible to use the server within Ukraine to its fullest extent.

2. Iron.


A warning:
Your hardware can be any, the only thing you need to be sure that you have access to the Internet, that the hardware is supported in Ubuntu. Those. if you have some kind of extra-hyper modification of ARM, do not complain that something is wrong with you. I personally preferred to buy a separate machine for this.
')
By choosing a piece of hardware for DS, I have already unsubscribed from a separate article (http://habrahabr.ru/blogs/hardware/68805/). Who is too lazy to read, it is:
Motherboard - Zotac IONITX-A (Intel Atom N330);
RAM - 2 Gb;
Winchester - Seagate-Maxtor DiamondMax 23 500Gb (7200rpm, 16Mb cache, SATA II, 3.5 ”);
Enclosure - CFI A8989;
Propeller (for blowing) - Zalman Ultra Quiet 80mm.
From the additional, a separate 1GB flash drive was purchased, in order not to play with CD / DVD drives, but install directly from the flash drive.

PS: I ask you not to point out that this is the Seagate-Maxtor hard drive, the WD-box is better, of course, but unfortunately, they disappeared without a trace at the time of purchase in our city, and we had to temporarily take this one.

Wi-Fi on DS - you can throw right away. It makes absolutely no sense. 54Mbps will give you only 6.75 MB / s at 100% signal level, and when the channel is divided into torrents + home network (in which the real situation is watching videos and listening to music from the server), the actual speed is 1.5-2 MB / s that is - unacceptable. My choice is that since the Zotac IONITX-A board holds a 1Gb Ethernet port, there will be a direct connection to the router via Ethernet. The Wi-Fi router was changed from D-link DIR-615 + to D-Link DIR-655, due to the fact that the latter has support for 1Gb WAN + 4 x 1Gb LAN Ethernet port. Together made it possible to reach the maximum speed of information transfer. To enhance the coverage of Wi-Fi, for home laptops and wi-fi devices, two D-Link ANT-24 0070C antennas (7dbi, instead of the standard 2dbi) were used.

The router is configured to distribute the Internet via DHCP (I didn’t want to fool around with the static, and I don’t see any special meaning) and the server is naturally static, and the router is set to forward ports to the internal fixed IP 192.168.0.66:

PS: Please, I don’t want to set up a Wi-Fi 802.11n installation if possible, replacing hardware with 802.11n on all devices, in my opinion, would be just a waste of money. Over time, this will be necessary, but so far I have chosen Ethernet for my home server. You think I'm wrong? You and cards in hand. :)

3. Cooking flash drive.


Personally, I was preparing a USB flash drive in Windows. Used software:

Quick Install:

4. Install Ubuntu 9.04, start configuration


Ubuntu itself can probably put even a child. From a flash drive it is even faster and more convenient, I think everyone in the BIOS can boot from a USB flash drive, right? The best part about Ubuntu is that almost all the drivers are from the box. In my case, there was not only an NVidia GeForce 9300M driver. I will describe some of the installation points that I personally use.
1. The presence of the Internet when downloading from the LiveCD.
Why is this necessary? When I install, I choose the language - “Russian” (by the way, switching by Alt + Shift, by default, if required). Ubuntu independently still during installation pulls up all the necessary localization files. I did not try to play further with their search for them and did not have the slightest desire. Therefore, I take for the fact - the Internet connection should be at installation.
2. Breakdown of the hard disk.
How much documentation has been dug up on this issue, because I just wanted to understand how to split the disk in Linux so that, with further reinstallations, not to lose all the information on the main section.

The decision was made, the 500 GB screw was broken into:
Primary partition -> RaiserFS -> 300Mb -> "/ boot"
Primary partition -> swap -> 4096Mb
Primary partition -> Ext3 -> 40000Mb -> "/"
Primary partition -> Ext3 -> ... 450 GB the rest of the place ... -> "/ home".

All other points, such as the choice of language installer and the choice of name and password, leave as "homework." I will write in advance that I put the name of the computer “ homeserver ” and the administrator login “ odmin ”, in the future we will assume that you have it the same.

Everything after installation - we pull out the flash drive (so that it does not boot 10 times from it) and reboot.
Voila! Net system is running.

Now a little feint ears. I’m used to the Russian menu in Ubuntu, and I want to use the Russian localization of the system, but the names of folders like “Desktop”, “Video”, and generally Russian names of folders, I want to be “Desktop”, “Video”, “ Documents ". I don’t know how to do it any other way, so I’m describing how I’m doing to get rid of this problem. We stamp in the item System -> Administration -> Localization . Asking to update the localization packages - we are updating (I repeat - this is a step by step guide for a CLEAN installation from scratch). After that, select the language English (USA) in the menu and in the login - we press the "OK" button. In the process, the System Update window will most likely pop up against the background - until we touch it, for we are going step by step. Press " CTRL + ALT + F1 " - go to the console. Log in, enter the command:
sudo /etc/init.d/gdm restart

This is where we reboot the Gnome Desktop Manager , which is gdm . Login in graphical mode (if not jumped, we press CTRL + ALT + F7 ). After loading, the system will display a window asking about the change of names for the bourgeois localization. Put a tick - “ Do not ask more ” and select “ Update names ” (this is renaming folders). We stamp again in the Localization item ( System -> Administration -> Localization ) and return “Russian” in the menu and in the login. After this, we restart gdm again.

Against the backdrop of a sad still trying to interrogate the update system. Now we will satisfy her. If she is tired of begging and did not show the window, then we will call her from System -> Administration -> System Update . Click " Check for updates " and after that " Install updates ". The system happily bristles with the Internet, and we can safely, depending on the size of the Internet channel, go for a smoke. On my 4 Mbit / sec channel, updates for 157 megabytes are downloaded for approximately 2-3 minutes and after that the packages are installed, another 4 minutes ... plus or minus, for a total of, say, 10 minutes. What is the same - a cup of coffee brewed independently in the Turk + cigarette. We are returning - we see a joyful message that the system is fully satisfied and asks for a reboot, in which we help it. Another stage passed.

Let's go further - and then we need to realize that we still have a “Server”, which means that we should not sit at the graphic screen, but should sit remotely ... for example, in another room and from a laptop. For this we need SSH , but what kind of SSH without Midnight Commander . Let's go to the Terminal (for those who are completely unaware, the Terminal is called like this: Programs -> Standard -> Terminal ).
# We cleaned after the update
sudo apt-get autoremove
# Install SSH, MC
sudo apt-get install ssh mc

Now some changes in the SSH config
sudo mcedit / etc / ssh / sshd_config

We change the line “ Port 22 ” to “ Port 44000 ” and restart SSH.
sudo /etc/init.d/ssh restart

Everything. With ponte, micro-protection from idiots - is.

This completes the pre-installation. We disconnect the monitor from the server, we stuff the server under the table, and it is even better to fill up with some books to create the complete atmosphere of remoteness and the impossibility of access to the server.

PS: In this section, however, I also install drivers for NVidia GeForce for my motherboard, but I will describe their installation a little later.

5. Homemade SAMBA


At this point, I broke more than one tambourine. All I had to do was share a couple of folders for sharing and a few with password access (personal for father and wife). So far, I figured out just how to share access for everyone on the network, but with the help of reading gurus, I plan to add this section, so I immediately added questions about private password folders.

After Windows, the lack of a breakdown on disks drives me the most, which is very inconvenient for me, and I prefer to maintain order in folders. Therefore, I have developed such a directory structure for shared folders.


Given that we have a huge / home folder, everything will be stored there in an elementary way. When you reinstall it just do not format. In the future, add folders on external drives.

Let's get back to installing and configuring samba.
# Install
sudo apt-get install samba samba-tools
# Create a main folder (I said that we are considering a clean system)
sudo mkdir / home / samba
# Attach user
sudo smbpasswd -a odmin
# Activate the user:
# (I do not understand all the actions, I only know that they work)
sudo smbpasswd -e odmin
# Create and open the file / etc / samba / smbusers for editing
# (also not understand why, but necessary)
sudo mcedit / etc / samba / smbusers

# /etc/samba/smbusers
#
odmin = Admin


All instructions are written about the fact that you need to configure the /etc/samba/smb.conf file to add and delete new shared folders, but I have a strict requirement for the task - to trash the system with unnecessary tasks, commands, etc., so that I refused to edit the configuration file. Instead, I met a great team - “net”. It is convenient for me so that you can (if you know of course all the syntaxes) add users and stuff through the command line. If I am wrong in something, I repeat, please correct it, and together we will supplement this manual. In the meantime, we continue, as I know:
# Create a folder for sharing
sudo mkdir / home / samba / public
# Register this folder in the samba, where:
# Syntax: net usershare share_name / path / to / share [acl] [<guest_ok = [y | n]>]
# Public is the name under which the folder will be visible in Windows;
# / home / samba / public is the path to our folder;
# Everyone: F is some kind of scary acl, I don't understand its purpose either
# but as far as I understand it is in this direction that you need to pick
# in order to make access to a specific user folder.
# guest_ok = y is the provision of access to all "guests."
sudo net usershare add Public / home / samba / public Everyone: F guest_ok = y

By analogy, add the Video and Music folders.
To apply all changes, we restart samba with the command:
sudo /etc/init.d/samba restart

That's where all my knowledge of samba ends, but this is enough for the internal sharing of the folder and the direction where to dig.

PS: I apologize if in these decisions the real Gurus see the security problems as well as any other problems. I am not an administrator - I am a web developer, I need a home system for testing. I ask for help to create a script for automatically setting up shared folders. If someone has a desire to help make one, I can throw off what I would like to get from him. Either I can pay for it, within reason, but I can. In any case, please write in the personal ICQ or Skype number how to contact you and I think we will solve this issue. Naturally the script and your name will immediately be attached to the article here and when reprinted.

6. Installing Apache, MySQL, PHP and phpMyAdmin


Well, everything is quite simple here.
The directory structure, which I chose again from all my requirements of convenience to the location of folders.

Source: https://habr.com/ru/post/70338/


All Articles