Answers.Body: <p>Your virtual hosting config looks good to me.  However, how are you running SSL?</p>
  <p>You've only shown the port 80 / non-SSL config and it shows a redirect to https so the <code>DocumentRoot</code> probably differs between port 80 and 443 versions vhost stanzas.</p>
  <p>Make sure <code>DocumentRoot</code> is the same in both places and you should be able to load up Craft without the www-craft-test prefix.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-04-29T14:40:55.347Z
Answers.LastActivityDate: 2021-04-29T14:40:55.347Z
Answers.UserDisplayName: RitterKnight
Body: <p>I am new to craft CMS and installed it in an Amazon EC2 instance via Composer.
  This worked.
  My vhost.conf looks like this</p>
  <pre><code>&lt;VirtualHost *:80&gt;
  ServerName craft.example.com
  DocumentRoot /var/www/vhosts/viacraft/www-craft-test
  ServerAdmin tristanvii@example.com
  ErrorLog /var/www/vhosts/logs/error_log_viacraft
  &lt;Directory /var/www/vhosts/viacraft/www-craft-test&gt;
          AllowOverride All
  &lt;/Directory&gt;
  RewriteEngine On
  RewriteCond %{SERVER_NAME} =craft.viainfo.com
  RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
  &lt;/VirtualHost&gt;
  </code></pre>
  <p>Database setup worked and passed.
  Then according to the manual I called</p>
  <p><a href="https://craft.example.com/index.php?p=admin/install" rel="nofollow noreferrer">https://craft.example.com/index.php?p=admin/install</a></p>
  <p>which leads to an File not found error.</p>
  <p>Then I put a hello.php in /var/www/vhosts/viacraft/www-craft-test but <a href="https://craft.example.com/hello.php" rel="nofollow noreferrer">https://craft.example.com/hello.php</a> did not worked which I did not understand.
  Then I put the hello.php in /var/www/vhosts/viacraft <strong>and it worked</strong> which is strange because the web directory in the vhost.conf is /var/www/vhosts/viacraft/www-craft-test <strong>and not</strong> /var/www/vhosts/viacraft/</p>
  <p>Any ideas to this behaviour?</p>
  <p>Then I managed to start the whole thing by entering</p>
  <p><a href="https://craft.example.com/www-craft-test/admin/dashboard" rel="nofollow noreferrer">https://craft.example.com/www-craft-test/admin/dashboard</a></p>
  <p>Why do I have to enter my webfolder www-craft-test in the path to call the dashboard???</p>
  <p>I made my first entry - a blog and when I press Preview the following page is called</p>
  <p><a href="https://craft.example.com/www-craft-test/admin/entries/blog/17-my-first-blog" rel="nofollow noreferrer">https://craft.example.com/www-craft-test/admin/entries/blog/17-my-first-blog</a></p>
  <p>with the error</p>
  <pre>
  Page Not Found
  Template not found: blog/_entry
  </pre>
  <p>I am <strong>not</strong> in development mode.</p>
  <p>Settings/Site This site has its own base URL is UNCHECKED</p>
  <p>This is my .htaccess in the www-craft-test folder</p>
  <pre><code> &lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On
  
    # Send would-be 404 requests to Craft
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
    RewriteRule (.+) index.php?p=$1 [QSA,L]
  &lt;/IfModule&gt;
  </code></pre>
  <p>In the templates folder there is still the original index.twig file.</p>
  <p>A bit confused, happy to get some helpful ideas?</p>
  <p>Thanks</p>
  <p>Tristan</p>
  
Tags: <installation><error-templates>
Title: vhost.conf and general understanding
ThreadText: # vhost.conf and general understanding
  
  (Asked by: username_0 on 2021-04-29)
  
  I am new to craft CMS and installed it in an Amazon EC2 instance via Composer.
  This worked.
  My vhost.conf looks like this
  
  ```
  <VirtualHost *:80>
  ServerName craft.example.com
  DocumentRoot /var/www/vhosts/viacraft/www-craft-test
  ServerAdmin username_0@example.com
  ErrorLog /var/www/vhosts/logs/error_log_viacraft
  <Directory /var/www/vhosts/viacraft/www-craft-test>
          AllowOverride All
  </Directory>
  RewriteEngine On
  RewriteCond %{SERVER_NAME} =craft.viainfo.com
  RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
  </VirtualHost>
  
  ```
  
  Database setup worked and passed.
  Then according to the manual I called
  
  <https://craft.example.com/index.php?p=admin/install>
  
  which leads to an File not found error.
  
  Then I put a hello.php in /var/www/vhosts/viacraft/www-craft-test but <https://craft.example.com/hello.php> did not worked which I did not understand.
  Then I put the hello.php in /var/www/vhosts/viacraft **and it worked** which is strange because the web directory in the vhost.conf is /var/www/vhosts/viacraft/www-craft-test **and not** /var/www/vhosts/viacraft/
  
  Any ideas to this behaviour?
  
  Then I managed to start the whole thing by entering
  
  <https://craft.example.com/www-craft-test/admin/dashboard>
  
  Why do I have to enter my webfolder www-craft-test in the path to call the dashboard???
  
  I made my first entry - a blog and when I press Preview the following page is called
  
  <https://craft.example.com/www-craft-test/admin/entries/blog/17-my-first-blog>
  
  with the error
  
  ```
  
  Page Not Found
  Template not found: blog/_entry
  
  ```
  
  I am **not** in development mode.
  
  Settings/Site This site has its own base URL is UNCHECKED
  
  This is my .htaccess in the www-craft-test folder
  
  ```
   <IfModule mod_rewrite.c>
    RewriteEngine On
  
    # Send would-be 404 requests to Craft
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
    RewriteRule (.+) index.php?p=$1 [QSA,L]
  </IfModule>
  
  ```
  
  In the templates folder there is still the original index.twig file.
  
  A bit confused, happy to get some helpful ideas?
  
  Thanks
  
  Tristan
  
  **Tags:** installation, error-templates
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-04-29. Score: 1
  
  Your virtual hosting config looks good to me. However, how are you running SSL?
  
  You've only shown the port 80 / non-SSL config and it shows a redirect to https so the `DocumentRoot` probably differs between port 80 and 443 versions vhost stanzas.
  
  Make sure `DocumentRoot` is the same in both places and you should be able to load up Craft without the www-craft-test prefix.
  
  
  ---
  
  