This howto is not a complete guide, but it contains some useful hints I learned over the last three weeks of setting up my own Linux Mint server. I hope this will be useful to you if hit a wall at some point. (And you will, belive me).
Audience:
This howto is for people with little Linux experience, but with good general server and networking knowledge, who want to set up a fully functional linux server with varius services like DHCP, DNS, etc.
Notice: I will use a "Boooo " sign in this howto to indicate well known problems, and bugs I encountered.
Quick FAQ:
There are many server distros, why use Mint for a server?
Cons:
- Linux Mint was designed to be an out-of-the-box experience for desktops. You will need to do some work to turn it into a server.
Pros:
- More stability compared to Ubuntu (because Mint is very careful in pushing updates to your computer).
- All the benefits of Mint we love. Admins are users too God Damn It. This is 21 century. We CAN have a server with GUI, Firefox with Flash and OpenOffice. Admins listen to MP3s too. And we CAN have Compiz on our server because it is so cool.
Step 1: Installing Mint
(I used 64-bit edition of Mint Gloria)
- Boot Mint Live CD and Install.
- Partitioning: Choose Advanced and create your own partitions. Search Google for various ways of how to partition your HDD in Linux.
My Example: I used 1 TB HDD and partitioned it in the following way:
- 80 GB for / (this is where your system will reside)
- 8 GB for swap (because I have 4 GB of Ram)
- 20 GB for /home (your private data and all user preferences will be here - very useful to have them on a separate partition. You will be able to reinstall your system or upgrade to Mint 8 in the future and keep all your settings).
- - 200 GB for important - I will store all my important files there, this partition will be regularly backed up together with the system partition (root partition /)
- - 628 GB for data - I will store all not so important data there. I will not backup that partition.
- I suggest you use ext3 as your file system, but you can Search Google for others.
- Boooo If you have both SATA and PATA drives on your server, then Linux will not even boot after installed because of a bug in Grub - the boot loader. In the last installation step click Advanced... and change hd0 to the partition where your system is installed. Grub will still fail and cry that it cannot find an installed system after reboot. You must edit the startup command and by trial and error find the correct partition number where your system resides. More details here: http://linux.knightnet.org.uk/2008/01/m ... a-and.html. Search Google for even more details.
At this point you should have a working Linux Mint installed. Weeee .
Step 2: Setting up Network configuration
- First enable routing:
Boooo - I did not find any GUI for that. To enable routing now you need to execute command:
Code: Select all
sudo echo 1 > /proc/sys/net/ipv4/ip_forward
Find the line:
Code: Select all
net.ipv4.ip_forward=1
- Boooo Unfortunately you must uninstall the user friendly NetworkManager and configure your network the hard way. NetworkManager prevents DHCP server from starting at boot as described here: http://ubuntuforums.org/archive/index.p ... 94344.html
Caution! After this point you will loose Internet access! Read the next steps first and after that follow them. Prepare all the needed information in advance (like your ISP nameservers IP).
- Uninstall NetworkManager with the Package Manager.
- Manually configure your network interfaces. You will need to edit the file /etc/network/interfaces:
- My file looks like this:
Code: Select all
auto lo
iface lo inet loopback
post-up iptables-restore < /etc/iptables.up.rules
auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
auto eth1
iface eth1 inet dhcp
You must also edit the file /etc/resolv.conf. It should look more or less like that:
Code: Select all
domain yourisp.com
search yourisp.com
nameserver 10.20.30.40
nameserver 10.20.30.41
After that you need to restart the Networking service for the configuration to be applied. Run the command:
Code: Select all
sudo /etc/init.d/networking restart
- Use this tutorial to install freenx on your server: https://help.ubuntu.com/community/FreeNX - it works.
- Do not forget to create a custom SSH key for security and copy it to your pendrive.
- You can now download and install NX Client from here: http://www.nomachine.com/download.php (I use my laptop to access my server remotely)
- In the advanced settings of your NX Client import the client.id_dsa.key, which you have copied on your pendrive.
- Enable the possibility to connect to multiple NX servers at the same time. Take a look at the file /etc/nxserver/node.conf on your server. Inside this file find a variable called DISPLAY_BASE. You will not be able to connect to two servers with the same DISPLAY_BASE at the same time. To fix this: Make sure that the # comment sign in front of the line is removed. Now change the number to some random value. For example:
Code: Select all
DISPLAY_BASE = 6584
Also make sure that numbers for all your servers are far apart, so you can have many simultaneous connections to each of your machines. I think nxserver takes DISPLAY_BASE for the first connection, DISPLAY_BASE + 1 for the second connection and so on...
Now you can sit back with your laptop and a beer and play with your server from a remote location.
Step 4: Installing Webmin
Webmin is the best GUI for configuring almost everything on your server I have found so far. You connect to it via a web page. You can use this tutorial to install it: http://www.webmin.com/deb.html I used the "Using the Webmin APT repository" part. Of course I did not use these stupid commands to add a new repository. Instead I used the Package Manager and added the repository the GUI way .
From here you are on your own. Browse through all the options Webmin has. In general it works like that: You use the Package Manager to install something, say PostgreSQL database and then you hit "Refresh modules" in Webmin. Ta, da. A new option just appeared on the list. If it did not, then you can look for many third-party Webmin modules on their webpage. I for example installed a very useful OpenVPN module to configure my VPN.
Webmin removes the pain of manually editing tons of obscure config files, but you still need to understand how DHCP,DNS,etc... works to configure them. In particular I had to read a lot about how Linux Firewall works to configure it correctly.
I successfully installed and configured:
- DHCP (dhcp3)
- DNS (bind9)
- HTTP (Apache, with PHP)
- Linux Firewall
- PostgreSQL
- OpenVPN Server
- Subversion Server
- Mercurial Server
- Samba Server (Windows shares)
- SpamAssasin
- Team Speak server
- Complete System backup using dar and some scripts
- Incremental backup of some important data using rsnapshot
- I failed at Dovecot, because it has a very poor GUI at Webmin and extremely obscure config files, which you have to edit manually.
I still plan to install:
- FTP server
- Glassfish
I tried to cover most of typical tasks one will have to complete to set up an admin friendly server based on Linux Mint.
I can produce more howtos and answer many questions about the installation process as needed. It took me almost a month to resolve all the Boooos I encountered. Maybe thanks to that you will configure your Mint Server faster.