Skip to main content
Go to homepage
Github

Apache

Learn how to configure an Apache web server (eg., XAMPP, LAMP, MAMP, WAMP).

Configuring Apache

To configure the Apache web server, you can use the following example to configure:

<VirtualHost *:*> DocumentRoot /var/www/html/my-app <Directory /var/www/html/my-app> AllowOverride All </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>

Using the project as a subdirectory

It is possible to use Inphinit as an directory in Apache (e.g., http://localhost/my-app/), simply by installing or moving the project to the Apache folder, as shown in these examples:

  • /var/www/html/my-app
  • C:\xampp\htdocs\my-app
  • C:\wamp\www\my-app

In this configuration, it is necessary to change the ErrorDocument in the .htaccess file at the project root:

# Redirect SAPI to errors.php ErrorDocument 403 /my-app/index.php ErrorDocument 500 /my-app/index.php

If the project path in the URL is something like http://localhost/foo/bar/baz/project/, then change it to:

# Redirect SAPI to errors.php ErrorDocument 403 /foo/bar/baz/project/index.php ErrorDocument 500 /foo/bar/baz/project/index.php