Ubuntu 14.04 setup for ServerPilot

Home » Computer Articles » Linux » Ubuntu 14.04 setup for ServerPilot
June 12, 2016 Linux No Comments

So I wanted to try out ServerPilot, ServerPilot is a web tool that helps setup your server for WordPress or php needed applications.

 

You can go to https://serverpilot.io/ to check out ServerPilot.

 

You need to have a basic Ubuntu 14.04 or Ubuntu 16.04 Server setup.

 

I also wanted to make some tweaks to the server for better performance before install ServerPilot.

 

So you have a basic server deployed and up and running.

 

Login with SSH.

 

Make sure server is on the right timezone.

# dpkg-reconfigure tzdata

 

Change hostname

# nano /etc/hostname

hostname

 

Mount partitions to noatime to help with I/O utilization

nano /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
#/dev/mapper/CAC_VG-CAC_LV /               ext4    errors=remount-roi 0       1
/dev/mapper/CAC_VG-CAC_LV /               ext4    noatime,errors=remount-ro 0       1
# /boot was on /dev/sda1 during installation
UUID=1d92b194-7885-4b25-a4ba-a7b8683229e1 /boot           ext4    defaults        0       2
# swap was on /dev/sda2 during installation
UUID=be7625e5-2e2c-41f2-8d5f-331f90980b9e none            swap    sw              0       0
#/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0
# mount -o remount /

If you type mount you should now see noatime on your mounted root partition.

 

Make sure server is fully updated.

# apt-get update
# apt-get upgrade

 

Sysctl Tweaks

nano /etc/sysctl.conf
### IMPROVE SYSTEM MEMORY MANAGEMENT ### 
# Increase size of file handles and inode cache 
fs.file-max = 2097152 

# Do less swapping 
vm.swappiness = 10 
vm.dirty_ratio = 60 
vm.dirty_background_ratio = 2 

### GENERAL NETWORK SECURITY OPTIONS ### 
# Number of times SYNACKs for passive TCP connection. 
net.ipv4.tcp_synack_retries = 2 

# Allowed local port range 
net.ipv4.ip_local_port_range = 2000 65535 

# Protect Against TCP Time-Wait 
net.ipv4.tcp_rfc1337 = 1 

# Decrease the time default value for tcp_fin_timeout connection 
net.ipv4.tcp_fin_timeout = 15 

# Decrease the time default value for connections to keep alive 
net.ipv4.tcp_keepalive_time = 300 
net.ipv4.tcp_keepalive_probes = 5 
net.ipv4.tcp_keepalive_intvl = 15
 
### TUNING NETWORK PERFORMANCE ###
# Default Socket Receive Buffer net.core.rmem_default = 31457280 

# Maximum Socket Receive Buffer 
net.core.rmem_max = 12582912 

# Default Socket Send Buffer 
net.core.wmem_default = 31457280 

# Maximum Socket Send Buffer 
net.core.wmem_max = 12582912 

# Increase number of incoming connections 
net.core.somaxconn = 4096 

# Increase number of incoming connections backlog 
net.core.netdev_max_backlog = 65536 

# Increase the maximum amount of option memory buffers 
net.core.optmem_max = 25165824 

# Increase the maximum total buffer-space allocatable 
# This is measured in units of pages (4096 bytes) 
net.ipv4.tcp_mem = 65536 131072 262144 
net.ipv4.udp_mem = 65536 131072 262144 

# Increase the read-buffer space allocatable 
net.ipv4.tcp_rmem = 8192 87380 16777216 
net.ipv4.udp_rmem_min = 16384 

# Increase the write-buffer-space allocatable 
net.ipv4.tcp_wmem = 8192 65536 16777216 
net.ipv4.udp_wmem_min = 16384 

# Increase the tcp-time-wait buckets pool size to prevent simple DOS attacks 
net.ipv4.tcp_max_tw_buckets = 1440000 
net.ipv4.tcp_tw_recycle = 1 
net.ipv4.tcp_tw_reuse = 1

Run this command to make changes active.

# sysctl -p

 

Increase open files.

nano /etc/security/limits.conf
* hard nofile 500000 
* soft nofile 500000 
root hard nofile 500000 
root soft nofile 500000

Restart server to make these changes active.

 

Now you can go to ServerPilot and setup your server.

https://serverpilot.io/

 

Things I have found interesting with ServerPilot.

Running multiple version of PHP at the same time.

Software keeps security updates updated automatically.

Applies firewall rules automatically.

 

Reference:

https://serverpilot.io/

increase-open-files-limit

sysctl-conf tweaks

Share This:

Leave a Reply

Your email address will not be published. Required fields are marked *