Skip to content

Instantly share code, notes, and snippets.

@ajayfroiden
Last active January 22, 2025 06:40
Show Gist options
  • Save ajayfroiden/e83680b33e8b39f5f8b0d12a2aff6f06 to your computer and use it in GitHub Desktop.
Save ajayfroiden/e83680b33e8b39f5f8b0d12a2aff6f06 to your computer and use it in GitHub Desktop.
Virtual Host configuration apache example.com
@ajayfroiden
Copy link
Author

Apache Virtual Host Configuration for example.com

Virtual Host Configuration

<VirtualHost *:80>
    ServerName example.com
    ServerAlias www.example.com

    DocumentRoot /var/www/html

    # Directory settings
    <Directory /var/www/html>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    # Log files
    ErrorLog ${APACHE_LOG_DIR}/example.com-error.log
    CustomLog ${APACHE_LOG_DIR}/example.com-access.log combined
</VirtualHost>

@ajayfroiden
Copy link
Author

ajayfroiden commented Jan 9, 2025

/etc/apache2/sites-available/example.com.conf.

sudo service apache2 restart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment