Apache module installation needed to server WordPress with PHP

So I have removed all my modules all my apache modules and my apache server does not starting now 🙂

$sudo service apache2 restart
* Restarting web server apache2                                         [fail]
* The apache2 configtest failed.
Output of config test was: AH00534: apache2: Configuration error: No MPM loaded. Action ‘configtest’ failed.
The Apache error log may have more information.

Ok so we don’t have MPM loaded then.

So lets load mpm_prefork module

$sudo a2enmod mpm_prefork

$sudo service apache2 start

OK what is know:)

Output of config test was:
AH00526: Syntax error on line 156 of /etc/apache2/apache2.conf:
Invalid command ‘Require’, perhaps misspelled or defined by a module not included in the server configuration
Action ‘configtest’ failed.
The Apache error log may have more information.

Another issue:)

$sudo vim /etc/apache2/apache2.conf (in vim press :156) go!

This tells me:

Require all denied 😉

Oh a quick search in google save my day

http://httpd.apache.org/docs/2.4/upgrading.html

So we need another module or we need to remove the config from the configuration 🙂

ods-enabled# a2enmod authz_host

More about this module: http://httpd.apache.org/docs/2.4/mod/mod_authz_host.html

Considering dependency authz_core for authz_host:
Enabling module authz_core.
Enabling module authz_host.
To activate the new configuration, you need to run:
service apache2 restart’

$sudo service apache2 restart

service apache2 restart
AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1. Set the ‘ServerName’ directive globally to suppress this message
* Restarting web server apache2

Ah yest got sweet Jesus!. It’s up and running.

Now we can also remove this annoying message!

Follow the quide depend on the system. You don’t have to use localname 🙂

https://amionrails.wordpress.com/2014/02/09/how-to-fix-could-not-reliably-determine-the-servers-fully-qualified-domain-name-using-127-0-1-1-for-servername-on-ubuntu-linux/

OK apache will now work with its minimal configuration.

Next step is to add some php module so we can serve php websites.

Again lots of information:

http://phplens.com/phpeverywhere/tuning-apache-php

https://www.digitalocean.com/community/tutorials/how-to-optimize-apache-web-server-performance

http://haydenjames.io/strip-apache-improve-performance-memory-efficiency/

http://2bits.com/articles/apache-fcgid-acceptable-performance-and-better-resource-utilization.html

OK

gets some other default modes added to apache conifuuration

$sudo a2endmod rewrite

$sudo a2endmod dir

$sudo a2endmod alias

$sudo a2endmod env

$sudo a2endmod setenvif etc.

My list of runnig modules

Loaded Modules:
core_module (static)
so_module (static)
watchdog_module (static)
http_module (static)
log_config_module (static)
logio_module (static)
version_module (static)
unixd_module (static)
alias_module (shared)
auth_basic_module (shared)
authn_core_module (shared)
authn_file_module (shared)
authz_core_module (shared)
authz_host_module (shared)
authz_user_module (shared)
dir_module (shared)
env_module (shared)
mpm_prefork_module (shared)
rewrite_module (shared)
setenvif_module (shared)

You can add any of these modes by doing $sudo a2enmod (module_name without world module) eg. rewrite instead of rewrite_module

You can try this if you want or

http://www.vps.net/blog/2013/04/08/apache-mpms-prefork-worker-and-event/

http://2bits.com/articles/high-performance-drupal-with-apache-mpm-worker-threaded-server-and-php-fpm.html

Simply make sure that these modules are there

a2ensmod ph5 and a2ensmode mpm_prefork

a2enmod deflate – to reduce bandwith

Then you may need to edit your php conf if you have got “Order” issue

http://stackoverflow.com/questions/10925528/invalid-command-order-perhaps-misspelled-or-defined-by-a-module-not-included

http://askubuntu.com/questions/364722/invalid-command-order-after-deleting-etc-apache2

http://httpd.apache.org/docs/2.4/upgrading.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s