Installation configuration and setup


nginx | configuration

Please note that this configuration is a starting point, and you may need to adjust it to suit your specific Nginx and PHP-FPM setup. Also, remember to include this configuration within your Nginx server block, which is typically found in the /etc/nginx/sites-available/ directory.

# NEXT LINE IS REQUIRED FOR SETUP - change this to index.php after setup is complete
index setup.php;

# SEO settings
location / {
    try_files $uri $uri/ @htmlext;

location @htmlext {
    rewrite ^/(.*)$ /index.php?include=$1 last;

location ~ ^/welcome/([^/]+)$ {
    rewrite ^ /index.php?signup=1 last;

location ~ ^/users/([^/]+)$ {
    rewrite ^ /index.php?user=$1 last;

location ~ ^/users([^/]+)$ {
    rewrite ^ /index.php?user=$1 last;

error_page 404 /content/errors/404.html;

gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;

# Cache settings
location ~* .(ico|css|js|gif|jpe?g|png|pdf|avi|mov|ppt|doc|mp3|wmv|wav|swf)$ {
    expires 14d;
    add_header Cache-Control "public";

location ~* .(xml|txt|htm|html)$ {
    expires 1d;
    add_header Cache-Control "private, must-revalidate";

location ~* .(php|cgi|pl)$ {
    expires -1;
    add_header Cache-Control "no-store, no-cache, must-revalidate, max-age=0";
    add_header Pragma "no-cache";

# Add correct content-type for fonts
types {
    application/ eot;
    application/x-font-ttf ttf;
    application/x-font-opentype otf;
    application/x-font-woff woff;
    image/svg+xml svg;

# PHP location block
# Adjust this to match your PHP-FPM settings
location ~ .php$ {
    fastcgi_pass   unix:/var/run/php/php7.4-fpm.sock;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    include        fastcgi_params;


nginx | Setup HowTo

To set up YaWK using Nginx, follow these steps:


Ensure that you have Nginx, PHP, and PHP-FPM installed on your server. If you don't have them installed, you can follow these guides:

Installation Instructions:

  1. Create a new Nginx configuration file for your application. You can create a new file in the /etc/nginx/sites-available/ directory, for example, /etc/nginx/sites-available/your-application.
  2. Open the new configuration file you created in a text editor and paste the Nginx configuration provided in the previous response.
  3. Adjust the server block settings as needed for your specific application, such as the server_name, root, and index. Also, make sure the PHP-FPM settings (such as the fastcgi_pass directive) match your PHP-FPM configuration.
  4. Create a symbolic link to the configuration file in the sites-enabled directory to enable the site:
    sudo ln -s /etc/nginx/sites-available/your-application /etc/nginx/sites-enabled/
  5. Test your Nginx configuration for any syntax errors:
    sudo nginx -t
    If there are any issues, fix them and retest the configuration.
  6. Reload Nginx to apply the changes:
    sudo service nginx reload
  7. Upload your application files to the server, placing them in the appropriate directory specified in the root directive of your Nginx configuration file.
  8. Set the necessary permissions on your application files and directories. For example, you might need to give the web server write access to specific directories.
  9. Visit your application's domain or IP address in a web browser to ensure everything is working as expected.
  10. These instructions provide a general overview of how to set up your application with Nginx. Depending on your specific application and server setup, you might need to make additional adjustments to the configuration.

.htaccess | configuration

To set up your application using Apache, follow these steps:

Installation Instructions:

Yet another Web Kit
All in One Solution for professional Web Developers

  • MIT License |
  • YaWK on GitHub |
  • Support