title: Laravel - set /public as root on LAMP stack
body: <p>I'm trying to deploy a Laravel App on a LAMP stack although I am having trouble setting the document root as <code>/public</code>. I've looked at several answers on here already for similar problems but am yet to find my problem or a solution. I ideally I want to do it through the Apache web server and not modify any Laravel files.</p>
  
  <p>I  copied the default <code>.conf</code> file a change it to the following using  <code>sudo nano /etc/apache2/sites-available/subdomain.website.com.conf</code></p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
          ServerAdmin email@gmail.com
          ServerName subdomain.website.com
          ServerAlias www.subdomain.website.com
          DocumentRoot /var/www/subdomain.website.com/public_html/public
  
          &lt;Directory /var/www/subdomain.website.com/public_html/public/&gt;
              Options Indexes FollowSymLinks MultiViews
              AllowOverride All
              Require all granted
          &lt;/Directory&gt;
  
          ErrorLog ${APACHE_LOG_DIR}/error.log
          CustomLog ${APACHE_LOG_DIR}/access.log combined
  
          &lt;IfModule mod_dir.c&gt;
              DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
          &lt;/IfModule&gt;
  
  RewriteEngine on
  RewriteCond %{SERVER_NAME} =www.subdomain.website.com [OR]
  RewriteCond %{SERVER_NAME} =subdomain.website.com
  RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>After the I ran the following commands in this order.</p>
  
  <p><code>sudo a2ensite subdomain.website.com.conf</code></p>
  
  <p><code>sudo a2enmod rewrite</code></p>
  
  <p><code>sudo systemctl restart apache2</code></p>
  
  <p><code>sudo service apache2 restart</code></p>
  
  <p>I cleared cookies, did a hard refresh and it hasn't worked. I still have to go to <code>https://subdomain.website.com/public</code> to view the website. Is there anything I have missed or anything I can do find out what the problem may be? </p>
  
  <p>The <code>.htaccess</code> file in the /public folder contains the following</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
      &lt;IfModule mod_negotiation.c&gt;
          Options -MultiViews -Indexes
      &lt;/IfModule&gt;
  
      RewriteEngine On
  
      # Handle Authorization Header
      RewriteCond %{HTTP:Authorization} .
      RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  
      # Redirect Trailing Slashes If Not A Folder...
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_URI} (.+)/$
      RewriteRule ^ %1 [L,R=301]
  
      # Handle Front Controller...
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^ index.php [L]
  &lt;/IfModule&gt;
  </code></pre>