Saltar al contenido principal

Configuracion de Apache

Complete Apache setup guide for FeedbackPulse SaaS.


Requisitos Previos

  • Apache 2.4+
  • mod_rewrite enabled
  • mod_headers enabled (for security headers)
  • PHP 8.2+ (via mod_php or PHP-FPM)

Enable Required Modules

sudo a2enmod rewrite headers ssl
sudo systemctl restart apache2

Basic Virtual Host

Create a new virtual host file:

sudo nano /etc/apache2/sites-available/feedbackpulse.conf

Paste the following:

<VirtualHost *:80>
ServerName yourdomain.com
ServerAlias www.yourdomain.com
DocumentRoot /var/www/feedbackpulse-saas/public

<Directory /var/www/feedbackpulse-saas/public>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>

# Logging
ErrorLog ${APACHE_LOG_DIR}/feedbackpulse-error.log
CustomLog ${APACHE_LOG_DIR}/feedbackpulse-access.log combined
</VirtualHost>

Enable the site and restart:

sudo a2ensite feedbackpulse.conf
sudo a2dissite 000-default.conf # Disable default site (optional)
sudo systemctl restart apache2

HTTPS Virtual Host (with Let's Encrypt)

After obtaining an SSL certificate:

<VirtualHost *:443>
ServerName yourdomain.com
ServerAlias www.yourdomain.com
DocumentRoot /var/www/feedbackpulse-saas/public

SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/yourdomain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/yourdomain.com/privkey.pem

<Directory /var/www/feedbackpulse-saas/public>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>

# Security Headers
Header always set X-Frame-Options "SAMEORIGIN"
Header always set X-Content-Type-Options "nosniff"
Header always set X-XSS-Protection "1; mode=block"
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"

ErrorLog ${APACHE_LOG_DIR}/feedbackpulse-ssl-error.log
CustomLog ${APACHE_LOG_DIR}/feedbackpulse-ssl-access.log combined
</VirtualHost>

# Redirect HTTP to HTTPS
<VirtualHost *:80>
ServerName yourdomain.com
ServerAlias www.yourdomain.com
Redirect permanent / https://yourdomain.com/
</VirtualHost>

Wildcard Subdomain Support (Optional)

If you want tenant subdomains like acme.yourdomain.com:

<VirtualHost *:443>
ServerName yourdomain.com
ServerAlias *.yourdomain.com
DocumentRoot /var/www/feedbackpulse-saas/public

SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/yourdomain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/yourdomain.com/privkey.pem

<Directory /var/www/feedbackpulse-saas/public>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

Importante: You also need a wildcard DNS record (*.yourdomain.com) and a wildcard SSL certificate. See Wildcard DNS Setup and SSL Certificates.


The .htaccess File

FeedbackPulse ships with a .htaccess file in the public/ directory. It handles:

  • URL rewriting (pretty URLs without index.php)
  • Forcing HTTPS
  • Setting security headers

If your .htaccess is not working, make sure AllowOverride All is set in your virtual host configuration.

The default .htaccess includes:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

And in public/.htaccess:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>

cPanel / Shared Hosting

If you're on hosting compartido with cPanel:

Option A: Install in public_html

  1. Upload all files to public_html/feedbackpulse/
  2. In cPanel → Domains or Addon Domains, set the document root to public_html/feedbackpulse/public
  3. If you can't change the document root, use this trick:

Create a .htaccess in your public_html/ root:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ feedbackpulse/public/$1 [L]
</IfModule>

Option B: Install in a Subdomain

  1. Create a subdomain in cPanel (e.g., feedback.yourdomain.com)
  2. Set its document root to the public/ folder
  3. Upload all FeedbackPulse files to the subdomain directory

Option C: Move public/ Contents

As a last resort on restrictive hosting:

  1. Upload all files to a directory outside public_html/ (e.g., /home/user/feedbackpulse/)
  2. Copy the contents of public/ into public_html/
  3. Edit public_html/index.php — update the paths:
// Change this:
require __DIR__.'/../vendor/autoload.php';
// To this:
require '/home/user/feedbackpulse/vendor/autoload.php';

// Change this:
$app = require_once __DIR__.'/../bootstrap/app.php';
// To this:
$app = require_once '/home/user/feedbackpulse/bootstrap/app.php';

Advertencia: Option C requires updating paths after every update. Use Option A or B if possible.


Laragon (Windows Local Development)

Laragon makes this incredibly easy:

  1. Place the feedbackpulse-saas folder in C:\laragon\www\
  2. Laragon automatically creates a virtual host: feedbackpulse-saas.test
  3. Visit http://feedbackpulse-saas.test in your browser
  4. Laragon points to public/ automatically!

Laragon auto virtual host: Laragon creates Apache virtual hosts for every folder in www/. The document root is automatically set to public/ if that directory exists.


Verify Apache Configuracion

# Test configuration syntax
sudo apachectl configtest

# Check if mod_rewrite is enabled
apache2ctl -M | grep rewrite

# Check if site is enabled
ls /etc/apache2/sites-enabled/

# Restart Apache
sudo systemctl restart apache2

Visit https://yourdomain.com — you should see the FeedbackPulse pagina de aterrizaje or installer.


Proximos Pasos