
# Apache VirtualHost Configuration for Factur-X System
# Place this in /etc/apache2/sites-available/factur-x.conf

<VirtualHost *:80>
    ServerName factur-x.point8.fr
    DocumentRoot /var/www/factur-x
    
    # Admin panel access
    Alias /admin /var/www/factur-x/admin
    <Directory /var/www/factur-x/admin>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    
    # Main site access (if needed)
    <Directory /var/www/factur-x>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    
    ErrorLog ${APACHE_LOG_DIR}/factur-x_error.log
    CustomLog ${APACHE_LOG_DIR}/factur-x_access.log combined
</VirtualHost>

# Enable SSL (recommended)
<VirtualHost *:443>
    ServerName factur-x.point8.fr
    DocumentRoot /var/www/factur-x
    
    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/factur-x.crt
    SSLCertificateKeyFile /etc/ssl/private/factur-x.key
    
    # Admin panel access
    Alias /admin /var/www/factur-x/admin
    <Directory /var/www/factur-x/admin>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    
    ErrorLog ${APACHE_LOG_DIR}/factur-x_ssl_error.log
    CustomLog ${APACHE_LOG_DIR}/factur-x_ssl_access.log combined
</VirtualHost>
