Debian server configuration
Contents
1) Server config
- Stack
- Nginx 1.10.3 (
apt-get -t jessie-backports install nginx-full
) - Php 5.6 (
apt-get install php5 php5-fpm php5-gd php5-json php5-mysql php5-curl php5-mcrypt
) - MariaDB 10.0 => Mysql 5.6 (
apt-get install mariadb-server
)
2) User
Create user name
password
- Directory
- create website directory /var/www/
name
/101-website.address
/public_html - create log directory /var/www/
name
/log/101-website.address
/ - create log directory /var/www/
name
/repository/branch_name
/
3) Webservice config (php-fpm
, nginx
, mariaDB
)
- Nginx
- change config to startup by
name
nginx.conf
{% highlight nginx %} username
; http { … include /etc/nginx/sites-enabled/*.conf; … } {% endhighlight %}
- MariaDB
- change config to startup by another gnerate
port
check not available portsmy.cnf
{% highlight nginx %} [client] port = 5xxxx …. [mysqld] … port = 5xxxx … {% endhighlight %}
- php-fpm
- change config to startup by another
name
www.conf
{% highlight bash %} … [www] … user = name group = name … listen.owner = name listen.group = name … {% endhighlight %}
4) SSH
- Change default port from 22 to random
- Jail
- add new lines in /etc/ssh/sshd_config {% highlight nginx %} Match user name ChrootDirectory home/jail* X11Forwarding no AllowTcpForwarding no {% endhighlight %} restart