Mets Minor League Blog

Music theory, instruments and musicians

Mets Minor League Blog

Music theory, instruments and musicians

How to Install GLPI ITSM on Ubuntu with Apache

How to Install GLPI ITSM on Ubuntu with Apache

Managing IT assets and support tickets effectively is crucial for any organization. GLPI (Gestionnaire libre de parc informatique) is a powerful open-source IT Service Management (ITSM) solution that helps streamline asset management, ticketing, and service desk operations. Installing GLPI on an Ubuntu server with Apache provides a robust, customizable platform to enhance your IT support capabilities. This step-by-step guide walks you through the entire process, ensuring you set up a secure and functional GLPI environment on your Ubuntu server.

What You’ll Need

  • Ubuntu Server (version 20.04 LTS or later recommended)
  • Root or sudo user privileges
  • Basic familiarity with Linux command line
  • Internet connection for downloading packages
  • Optional: a domain name pointed to your server’s IP address for easier access

Step-by-Step

  1. Update and Upgrade Your System
    1. Open your terminal or connect via SSH to your Ubuntu server.
    2. Run the following commands to update your package lists and upgrade installed packages:
      sudo apt update
      sudo apt upgrade -y
  2. Install Apache, MySQL, and PHP
    1. Install Apache web server:
      sudo apt install apache2 -y
    2. Install MariaDB (a drop-in replacement for MySQL):
      sudo apt install mariadb-server -y
    3. Secure your MariaDB installation:
      sudo mysql_secure_installation

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

    4. Install PHP and required modules:
      sudo apt install php php-mysql php-xml php-zip php-gd php-curl php-mbstring php-bcmath php-ldap -y
  3. Configure MariaDB for GLPI
    1. Log into MariaDB:
      sudo mysql -u root -p
    2. Create a database and user for GLPI:
      CREATE DATABASE glpi CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
      CREATE USER 'glpiuser'@'localhost' IDENTIFIED BY 'your_secure_password';
      GRANT ALL PRIVILEGES ON glpi.* TO 'glpiuser'@'localhost';
      FLUSH PRIVILEGES;
      EXIT;
  4. Download and Install GLPI
    1. Navigate to the /tmp directory:
      cd /tmp
    2. Download the latest GLPI version from the official site (check for the latest version at https://glpi-project.org/):
      wget https://github.com/glpi-project/glpi/releases/download/10.0.10/glpi-10.0.10.tgz
    3. Extract the archive:
      tar -xzf glpi-10.0.10.tgz
    4. Copy the extracted files to the web root:
      sudo cp -r glpi /var/www/html/
  5. Configure Permissions
    1. Set ownership to Apache user:
      sudo chown -R www-data:www-data /var/www/html/glpi
    2. Set appropriate permissions:
      sudo chmod -R 755 /var/www/html/glpi
  6. Configure Apache for GLPI
    1. Create a new configuration file:
      sudo nano /etc/apache2/sites-available/glpi.conf
    2. Add the following configuration:
      <VirtualHost *:80>
          ServerAdmin admin@yourdomain.com
          ServerName yourdomain.com
          ServerAlias www.yourdomain.com
          DocumentRoot /var/www/html/glpi
      
          <Directory /var/www/html/glpi>
              Options Indexes FollowSymLinks
              AllowOverride All
              Require all granted
          </Directory>
      
          ErrorLog ${APACHE_LOG_DIR}/glpi_error.log
          CustomLog ${APACHE_LOG_DIR}/glpi_access.log combined
      </VirtualHost>
    3. Enable the site and rewrite module:
      sudo a2ensite glpi.conf
      sudo a2enmod rewrite
      sudo systemctl restart apache2
  7. Complete GLPI Setup via Web Interface
    1. Open your web browser and navigate to http://your_server_ip or your domain name.
    2. You will see the GLPI installation page. Select your language and follow the on-screen instructions.
    3. Enter database details:
      • Database name: glpi
      • Username: glpiuser
      • Password: your_secure_password
    4. Finish the installation, then delete the install directory for security:
      sudo rm -rf /var/www/html/glpi/install
    5. Login to your new GLPI instance with default credentials (admin / glpi) and start configuring your ITSM system.

Common Mistakes

  • Not securing MariaDB after installation, leaving default settings vulnerable.
  • Forgetting to set correct permissions on the GLPI directory, which can cause access issues.
  • Not enabling the Apache rewrite module, leading to broken URLs or failed setup.
  • Using outdated packages or skipping system updates, which can cause compatibility problems.
  • Failing to delete the install directory after setup, creating a security risk.
  • Incorrect database credentials during setup, leading to connection errors.

Tips

  • Always use strong, unique passwords for database users and admin accounts.
  • Configure a firewall to restrict access to your server, especially if accessible over the internet.
  • Use SSL/TLS to encrypt data transmitted between clients and your server for enhanced security.
  • Regularly update your system and GLPI to patch security vulnerabilities.
  • Back up your database and GLPI files regularly to prevent data loss.
  • Customize your GLPI setup with plugins and configurations to suit your organization’s needs.

Troubleshooting

If you encounter issues during installation or operation, consider these common solutions:

  • Cannot access GLPI web interface: Verify Apache is running: sudo systemctl status apache2. Check your domain or IP address, and ensure firewall rules allow HTTP traffic.
  • Database connection errors: Double-check database credentials and ensure the MariaDB service is running. Test connection using mysql -u glpiuser -p -D glpi.
  • Permissions issues: Ensure the web server has proper ownership and permissions on the GLPI directory: sudo chown -R www-data:www-data /var/www/html/glpi.
  • PHP errors or missing modules: Confirm all required PHP modules are installed. Restart Apache after installation: sudo systemctl restart apache2.
  • SSL configuration issues: Use Let’s Encrypt to generate free SSL certificates and update your Apache configuration accordingly.

Frequently Asked Questions

1. How secure is GLPI on Ubuntu?

GLPI can be secure if you follow best practices: keep the system updated, use strong passwords, enable SSL, and restrict server access. Regular backups also enhance security.

2. Can I install GLPI on a different web server like Nginx?

Yes, but this guide focuses on Apache. Installing on Nginx requires different configuration steps, especially for URL rewriting and PHP handling.

3. How often should I update GLPI?

It’s recommended to update GLPI whenever new releases are available to benefit from security patches, bug fixes, and new features.

4. Is it possible to run multiple GLPI instances on the same server?

Yes, by configuring separate virtual hosts and databases for each instance, you can run multiple GLPI environments on a single server.

5. What should I do if the installation fails at the database setup?

Check your database credentials, ensure MariaDB is running, and verify network connectivity. Review the GLPI installation logs for specific errors.

6. How do I backup and restore GLPI data?

Backup your database with mysqldump and copy the GLPI directory. To restore, import the database dump and replace the GLPI files accordingly.

Installing GLPI on Ubuntu with Apache is a straightforward process that, once completed, offers a comprehensive platform for managing your IT assets and support tickets. With proper configuration and security measures, it becomes a reliable tool to streamline your IT service management workflows.

Related

How to Install GLPI ITSM on Ubuntu with Apache
Scroll to top