Mets Minor League Blog

Music theory, instruments and musicians

Mets Minor League Blog

Music theory, instruments and musicians

How to Install LimeSurvey with Apache on Ubuntu 24.04

How to Install LimeSurvey with Apache on Ubuntu 24.04

Setting up LimeSurvey on your Ubuntu 24.04 server with Apache allows you to create, distribute, and analyze surveys efficiently. Whether you’re an educator, researcher, or business professional, deploying LimeSurvey locally or on a web server enables seamless data collection and analysis. Before starting, ensure you have a clean Ubuntu 24.04 installation and root or sudo privileges. This guide walks you through each step to get LimeSurvey up and running smoothly.

What You’ll Need

  • Ubuntu 24.04 server or desktop installed and updated
  • Root or sudo access
  • Basic knowledge of terminal commands
  • Domain name (optional, for production setup)
  • Firewall configured to allow HTTP/HTTPS traffic

Step-by-Step

  1. Update your system packages: Open your terminal and run:
    sudo apt update && sudo apt upgrade -y

    This ensures all packages are current and compatible.

  2. Install Apache web server: Execute:
    sudo apt install apache2 -y

    Verify Apache is running by visiting your server’s IP address or domain name in a browser. You should see the default Apache page.

  3. Install PHP and required modules: LimeSurvey requires PHP and certain extensions. Run:
    sudo apt install php libapache2-mod-php php-mysql php-xml php-mbstring php-zip php-gd php-curl php-zip -y

    Ensure PHP version is compatible with LimeSurvey (preferably PHP 8.0+). You can check with php -v.

  4. Install MariaDB database server: LimeSurvey needs a database. Install MariaDB with:
    sudo apt install mariadb-server -y

    Secure your database installation:

    sudo mysql_secure_installation

    Follow the prompts to set a root password and secure the database.

  5. Create a database for LimeSurvey: Log in to MariaDB:
    sudo mariadb

    Create a database and user:

    CREATE DATABASE limesurvey_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    CREATE USER 'limesurveyuser'@'localhost' IDENTIFIED BY 'your_password';
    GRANT ALL PRIVILEGES ON limesurvey_db.* TO 'limesurveyuser'@'localhost';
    FLUSH PRIVILEGES;
    EXIT;
  6. Download LimeSurvey: Visit the official website to get the latest stable version. Use wget:
    wget https://github.com/LimeSurvey/LimeSurvey/releases/download/5.4.13/limesurvey-5.4.13+210902.zip

    Replace the URL with the latest release if needed.

  7. Extract LimeSurvey: Install unzip if necessary:
    sudo apt install unzip -y

    Extract files to your web directory:

    sudo unzip limesurvey-5.4.13+210902.zip -d /var/www/html/limesurvey

    Set proper permissions:

    sudo chown -R www-data:www-data /var/www/html/limesurvey
  8. Configure Apache: Create a new virtual host file:
    sudo nano /etc/apache2/sites-available/limesurvey.conf

    Add the following configuration, replacing yourdomain.com as needed:

    <VirtualHost *:80>
        ServerName yourdomain.com
        DocumentRoot /var/www/html/limesurvey
        <Directory /var/www/html/limesurvey>
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/limesurvey_error.log
        CustomLog ${APACHE_LOG_DIR}/limesurvey_access.log combined
    </VirtualHost>

    Enable the site and rewrite module:

    sudo a2ensite limesurvey.conf
    sudo a2enmod rewrite
    sudo systemctl restart apache2
  9. Complete installation via web interface: Open your browser and navigate to http://your_server_ip/limesurvey or your domain. Follow the on-screen instructions to select language, verify server requirements, and connect to the database using the credentials you created earlier. Finish the setup to access the LimeSurvey admin panel.

Common Mistakes

  • Not securing the database with a strong password before setup.
  • Forgetting to enable Apache rewrite module, which is essential for URL rewriting and clean URLs.
  • Using incompatible PHP versions; always verify LimeSurvey’s requirements for PHP.
  • Incorrect permissions on the LimeSurvey files, leading to access issues.
  • Failing to restart Apache after configuration changes.

Tips

  • Use a domain name with SSL certificates for secure survey hosting, especially in production.
  • Regularly back up your database and LimeSurvey files.
  • Configure automatic updates for your server to keep security patches current.
  • Use strong passwords for database and admin accounts.
  • Consult LimeSurvey documentation for advanced configuration options, such as email setup and multilingual support.

Troubleshooting

If LimeSurvey does not load properly or you encounter errors, follow these steps:

  1. Check Apache logs: Review error logs with sudo tail -f /var/log/apache2/error.log to identify issues.
  2. Verify permissions: Ensure files are owned by www-data and permissions are correct:
    sudo chown -R www-data:www-data /var/www/html/limesurvey
    sudo chmod -R 755 /var/www/html/limesurvey
  3. Ensure database connectivity: Confirm database credentials are correct and the database server is running.
    Use:
  4. sudo systemctl status mariadb

    If issues persist, try re-running the web installer or check network/firewall settings.

  5. Clear browser cache: Sometimes outdated cache can cause loading issues; clear cache or try incognito mode.
  6. Disable conflicting modules or plugins: Temporarily disable other Apache modules or security tools that might block access.

Frequently Asked Questions

1. Can I install LimeSurvey on a local Ubuntu server?

Yes, you can install LimeSurvey locally for testing or internal surveys. Just ensure your local network allows web access and that Apache and database are properly configured.

2. Do I need a domain name to run LimeSurvey?

No, you can run LimeSurvey using your server’s IP address. However, for production or public access, a domain with SSL is recommended for security and branding.

3. How do I update LimeSurvey to the latest version?

Download the latest release, back up your database and files, then follow the upgrade instructions provided by LimeSurvey documentation to ensure a smooth update.

4. Is LimeSurvey free and open-source?

Yes, LimeSurvey is open-source software released under the GNU General Public License, allowing free use, modification, and distribution.

5. How can I secure my LimeSurvey installation?

Use HTTPS with SSL certificates, strong passwords, regular backups, and keep your server and LimeSurvey updated to protect against vulnerabilities.

6. What are the common requirements for running LimeSurvey?

It requires a LAMP stack (Linux, Apache, MySQL/MariaDB, PHP), sufficient server resources, and proper permissions and configurations as outlined in this guide.

Related

How to Install LimeSurvey with Apache on Ubuntu 24.04
Scroll to top