Apache Configuration
Article Topics: Setup
Join Link Issues
The following information can be used for your Apache Configuration files if you are having problems with your NATS join links.
Executing PHP Pages
Your server needs to parse both your tour and members area pages for PHP, so that you can use our NATS tracking and join links correctly. If you're currently using html pages, you can tell Apache to parse them for PHP as well. Find the following line in your Apache httpd.conf:
AddType application/x-httpd-php .phpAdd the following extensions to the end of the line above:
.php .php3 .html .htmYou might be using a different named PHP handler than "application/x-httpd-php". If so, look for the line that begins with AddType, and includes .php, and modify that.
FollowSymLinks
If your linkcodes go to your NATS install instead of your site, ensure you have the following two lines in your Apache configuration:
<Directory /home/www>
Options FollowSymLinks
AllowOverride All
</Directory>The lines should be in a global virtual host configuration. For example:
<VirtualHost *:80>
ServerAdmin webmaster@site.com
DocumentRoot /home/www
ServerName site.com
ServerAlias *.site.com
CustomLog /dev/null common
<Directory /home/www>
Options FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>Custom PHP Handlers
NATS assumes that your Apache PHP handler is named "application/x-httpd-php", and makes that assumption when setting up your track links. If your PHP handler is named differently, you can let NATS know your PHP handler by setting the $nats-php-handler Apache variable in your virtual host.
Add this to your NATS virtual host:
Where [handler] is the name of the handler you wish to use.
For example:
If you're using PHP-FPM
You can also use this variable to set the handler variable by giving the full proxy handler path, as you would when setting the php AddType.
For example:
You may need to ensure that SetHandler is set. For example (depending on setup, needs, socket location, etc):
If directives in the .htaccess file are not parsing properly, php-fpm could be encountering an issue related to 'security.limit_extensions' for items in our .htaccess file. To resolve, you will need to set the directive to match our .htaccess directives. For example:
Keep in mind
You'll still need to set the handler for normal .php files using AddType, as normal. This variable simply allows NATS to know which handler to use for custom shortened links.
This change will allow the NATS .htaccess file to be able to use your handler if you're using php-fpm, but there are other concerns to consider when using php-fpm as well -- this variable will not resolve all of them. If looking to set up using php-fpm instead of the Apache mod_php module, please submit a support ticket.
Apache-defined variables are globally scoped, which means if you set a variable in your virtualhost, it can affect other virtualhosts as well.
See Also
Apache2 Performance Tuning -- Official documentation about tuning your Apache for maximum performance. (Apache 2)
Apache Performance Tuning -- Official documentation about tuning your Apache for maximum performance. (Apache 1.3)
Last updated
Was this helpful?