Apache 2.4 Laravel Server Configuration

Published on Author craigzearfossLeave a comment
<VirtualHost *:80>
    ServerAdmin webmaster@PROJECT_NAME.com

    DocumentRoot /var/www/PROJECT_NAME/public/
    ServerName PROJECT_DOMAIN

    <Directory />
        Options FollowSymLinks
        AllowOverride All
    </Directory>
    <Directory /var/www/PROJECT_NAME/public/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
        Allow from all
    </Directory>

    #ErrorDocument 404 /
    ErrorLog ${APACHE_LOG_DIR}/PROJECT_NAME_error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/PROJECT_NAME_access.log combined

</VirtualHost>

<IfModule mod_ssl.c>
    <VirtualHost _default_:443>
        ServerAdmin webmaster@PROJECT_NAME.com

        DocumentRoot /var/www/PROJECT_NAME/public/
        ServerName PROJECT_DOMAIN

        SSLEngine on
        SSLCertificateFile /etc/apache2/ssl/apache.crt
        SSLCertificateKeyFile /etc/apache2/ssl/apache.key

        <FilesMatch "\.(cgi|shtml|phtml|php)$">
                        SSLOptions +StdEnvVars
        </FilesMatch>

        <Directory /usr/lib/cgi-bin>
                        SSLOptions +StdEnvVars
        </Directory>
        BrowserMatch "MSIE [2-6]" \
                        nokeepalive ssl-unclean-shutdown \
                        downgrade-1.0 force-response-1.0
        BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

        #ErrorDocument 404 /
        ErrorLog ${APACHE_LOG_DIR}/PROJECT_NAME_error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/PROJECT_NAME_access.log combined

    </VirtualHost>
</IfModule>

Leave a Reply

Your email address will not be published. Required fields are marked *