User:Kgdrenefort/Wordpress
Preinstall
CMS (Content Management System) are web applications, Wordpress needs :
- A web server - A database server - A PHP server or FastCGI
Web server
Wordpress need a web server to answers web browsers requests, serving static files (.html and .css, images, etc) as for dynamic page rendered on the fly (.php creating unique .html page).
Choosing the good www servers is an important choice, configuration and syntax are different from one to another. Some would have features that others don't, but at the end these are knows to works with Wordpress and have many examples for their configuration as virtual host file to make it works :
- Apache2, being very popular since decades and is very good to serve PHP files and has a module to run PHP server itself, also supports .htaccess file, allowing non-administrator of a server to edit rules for a website, without having actual permissions on Apache2 (only in DocumentRoot).
- nginx, designed to be fast and lightweight, it's popularity increased over the years and it's considered at least as good as Apache2, while having not some features as .htaccess files and can't run itself a PHP server as can do Apache2, but instead (as Apache2 can too) allow to run aside and connect to a PHP-FPM (FastCGI) service, allowing it to serve PHP file as well.
- lighttpd, as explained on their web site : " lighttpd (pronounced /lighty/) is a secure, fast, compliant, and very flexible web server that has been optimized for high-performance environments. lighttpd uses memory and CPU efficiently and has lower resource use than other popular web servers. Its advanced feature-set (FastCGI, CGI, Auth, Output-Compression, URL-Rewriting and much more) make lighttpd the perfect web server for all systems, small and large. (…) "
If not sure what should suits best, Apache2 will always be a safe choice and is well documented for many CMS such as Wordpress. It has many features.
While NGinX could need a little bit more tweaking, it's main argument could be it's light and fast, could suits more on a low-ressource server.
Database server
To hold datas (account and their password, articles, images, etc) and serves them fast, Wordpress rely a database services. Everything is somewhere in the database and it's mandatory to make it works.
There is also many choices while picking up a database server. The most popular and known to works with Wordpress are :
- MySQL, propably the most popular open source database server, very well documented, has a lot of features and works almost with everything everything.
- MariaDB, a fork made years ago from MySQL. It has a fully-compatibility with MySQL and could replace it very well. Syntax is still SQL as all database server and is also open source.
- PostgreSQL, another popular database server, known to works with Wordpress. Works with the same SQL syntax and is open source.
As for web server, one has to be pickup.
In doubt, MySQL is a safe choice.
PHP server
Finally, to makes the web server serves dynamic content and also to communicate between the web server and the database, PHP supports is mandatory. Wordpress being written in PHP, it has to be working.
Apache 2
Apache2 could use it's internal module to serves PHP files, or use FastCGI (PHP-FPM).
NGinX
Only choice here is to connect NGinX to a PHP-FPM server.
Lighttpd
Lacking more information, please contribute and don't hesitate to open a discussion.
The following applications will need to be installed in order for WordPress to have everything that's needed to work properly.
root #
emerge --ask www-servers/apache dev-db/mysql dev-lang/php
Apache2 could be replaced by nginx or any others as lighttpd :
root #
emerge --ask www-servers/nginx
root #
emerge --ask www-servers/lighttpd
But only one is needed and could works on the usual 80 (HTTP) and 443 (HTTPS) ports at the same time.
As MySQL could be replaced by MariaDB or postgresql as database service. Only one could works at the same time on the.
To add PHP support into apache, you must follow the directions in the main Apache article.