注意:

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "Web-server-stack"

From Funtoo
Jump to navigation Jump to search
m
m (fix some stuff to make the page make more sense and easy to follow)
Line 8: Line 8:


=== Email Servers ===
=== Email Servers ===
* {{Package|mail-mta/postfix}} <-- default in Funtoo
* {{Package|mail-mta/postfix}} <-- suggested
* {{Package|mail-mta/ssmtp}}
* {{Package|mail-mta/ssmtp}}
* {{Package|mail-mta/exim}}
* {{Package|mail-mta/exim}}
Line 17: Line 17:
It is common practice to use FTP servers to host files for downloading.
It is common practice to use FTP servers to host files for downloading.


* {{Package|net-ftp/vsftpd}}
* {{Package|net-ftp/vsftpd}} <-- suggested
* {{Package|net-ftp/proftpd}}
* {{Package|net-ftp/proftpd}}
* {{Package|net-ftp/pure-ftpd}}
* {{Package|net-ftp/pure-ftpd}}
Line 27: Line 27:
=== Databases ===
=== Databases ===
* {{Package|dev-db/mysql}}
* {{Package|dev-db/mysql}}
mariadb is a drop in replacement for mysql <-- default in Funtoo
 
* {{Package|dev-db/mariadb}}
mariadb is a drop in replacement for mysql
* {{Package|dev-db/mariadb}} <-- suggested
 
percona is a drop in replacement for mysql
percona is a drop in replacement for mysql
* {{Package|dev-db/percona-server}}
* {{Package|dev-db/percona-server}}
* {{Package|dev-db/postgresql-server}}
* {{Package|dev-db/postgresql-server}}
* {{Package|dev-db/sqlite}}
* {{Package|dev-db/sqlite}}


=== Languages ===
=== Languages ===
* {{Package|dev-lang/php}}
* {{Package|dev-lang/php}} <-- suggested
* {{Package|dev-lang/perl}}
* {{Package|dev-lang/perl}}
* {{Package|dev-lang/python}}
* {{Package|dev-lang/python}}
Line 42: Line 45:
* {{Package|www-servers/apache}}
* {{Package|www-servers/apache}}
* {{Package|www-servers/cherokee}}
* {{Package|www-servers/cherokee}}
* {{Package|www-servers/nginx}}
* {{Package|www-servers/nginx}} <-- suggested
* {{Package|www-servers/tengine}}
* {{Package|www-servers/tengine}}
* {{Package|www-servers/lighttpd}}
* {{Package|www-servers/lighttpd}}
Line 52: Line 55:
* {{Package|www-servers/nginx}}
* {{Package|www-servers/nginx}}
* {{package|net-misc/stunnel}}
* {{package|net-misc/stunnel}}
* {{package|www-servers/pound}}
* {{package|www-servers/pound}} <-- suggested for ssl termination & load balancing
* {{Package|www-servers/varnish}}
* {{Package|www-servers/varnish}} <-- suggested for caching to reduce power consumption & reduce the need of constantly rebuilding pages
* {{Package|net-proxy/squid}}
* {{Package|net-proxy/squid}}


Line 61: Line 64:
=== Firewalls ===
=== Firewalls ===
* {{Package|net-firewall/nftables}}
* {{Package|net-firewall/nftables}}
* {{Package|net-firewall/iptables}}
* {{Package|net-firewall/iptables}} <-- suggested
* {{Package|net-firewall/firewalld}}
* {{Package|net-firewall/firewalld}}
* {{Package|net-firewall/ufw}}
* {{Package|net-firewall/ufw}}


=== Dynamic Firewalling ===
=== Dynamic Firewalling ===
* {{Package|app-admin/sshguard}}
* {{Package|app-admin/sshguard}} <-- suggested
* {{Package|net-analyzer/fail2ban}}
* {{Package|net-analyzer/fail2ban}}
=== Webapp Firewalls ===
Apache has an option for webapplication firewalling.  as far as [[User:Threesixes|Threesixes]] ([[User talk:Threesixes|talk]]) can tell this passes login errors & excessive site fuzzing to logs for fail2ban/sshguard to deal with.
https://github.com/nbs-system/naxsi is a web app firewall for nginx, however it is not in portage (as of 22:29, December 5, 2014 (UTC))


=== Benchmarking ===
=== Benchmarking ===

Revision as of 22:29, December 5, 2014

Pre-install considerations

ssl

Ssl wild card certificates can use the same certificate to cover several subdomain names. As in https://wiki.funtoo.org https://www.funtoo.org https://forums.funtoo.org can all use the same certificate. https://funtoo.org would not be covered under the wildcard, so Threesixes (talk) suggests using http://domain.tld as a http navigation splash page directory. All that is required to setup a ca signed ssl certificate is an email on the server. https://www.startssl.com offers free ssl ca certificates, though there are several other certificate providers. Many web apps require you set your URL & will have problems if your URL is set to http://, rather than https://

sockets vs tcp stack

Sockets have less overhead but can not be shared across jails, or to other machines. Tcp stack has more overhead but is far more flexible.

Email Servers

FTP Servers

It is common practice to use FTP servers to host files for downloading.

Webserver

Web servers come in several varieties. The most common stack is known as LAMP which stands for linux apache mysql php. Threesixes (talk) suggests setting up the web server stack by selecting the database first, then scripting language second, and web server 3rd.

Databases

mariadb is a drop in replacement for mysql

percona is a drop in replacement for mysql

  • No results

Languages

Web Servers


SSL Termination, Reverse Proxies, & load balancing

Reverse proxies are useful, some cache static data, and shuck out cached pages rather than hitting the web server. Some pass requests to backend nodes high availability clustering your website, some web servers have this functionality built in.

Post install

There are several considerations to take into account with a web server install, such as setting up an email server, setting up a firewall, firewalling web applications, and dynamically firewalling attackers.

Firewalls

Dynamic Firewalling

Webapp Firewalls

Apache has an option for webapplication firewalling. as far as Threesixes (talk) can tell this passes login errors & excessive site fuzzing to logs for fail2ban/sshguard to deal with. https://github.com/nbs-system/naxsi is a web app firewall for nginx, however it is not in portage (as of 22:29, December 5, 2014 (UTC))

Benchmarking

It's a good idea to benchmark your system, server, & websites. There are several tools to assist you in doing this.