Answers.Body: <p>This looks like a well visited question, its easy as something like this with apache2:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
          ServerAdmin webmaster@localhost
          DocumentRoot /var/www/html/web/
  
          &lt;Directory /var/www/html/web/&gt;
             Options FollowSymLinks
             AllowOverride None
             Require all granted
          &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>This is just a sample vhost file, but the real important part here is that you have the <strong>web</strong> folder set as your document root. This of course wont help anyone not using apache.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-21T08:06:37.170Z
Answers.LastActivityDate: 2018-03-21T08:06:37.170Z
Answers.UserDisplayName: Dan Zuzevich
Answers.Body: <p>This article might be useful to you; there is a section on how to deploy Craft CMS 3 as well:</p>
  
  <p><a href="https://nystudio107.com/blog/setting-up-a-craft-cms-3-project" rel="nofollow noreferrer">Setting up a New Craft CMS 3 Project</a></p>
  
  <p>We also recently did a podcast on <a href="https://devmode.fm/episodes/website-deployment-without-tears" rel="nofollow noreferrer">Website Deployment without Tears</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-07T00:20:35.383Z
Answers.LastActivityDate: 2018-03-21T14:24:40.090Z
Answers.LastEditDate: 2018-03-21T14:24:40.090Z
Answers.UserDisplayName: andrew.welch
Body: <p>I am quite new in Craft CMS 3. I have developed a new site and now I want to move it to the production server. I have just moved all the files by FTP, moved the database, changed .env variables. </p>
  
  <p><a href="https://i.sstatic.net/bRuE5.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/bRuE5.png" alt="enter image description here"></a> </p>
  
  <p>But when I go to the URL I get a message: "Forbidden You don't have permission to access / on this server."</p>
  
  <p>If I go to URL/web then I get the first page but without images. </p>
  
  <p>URL/admin shows "Not Found The requested URL /admin was not found on this server."</p>
  
  <p>How do I deploy the site? I cannot find a good article/help about deployment for Craft 3.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-01-07T00:16:22.817Z
Comments.Text: It's not about the deployment (moving/changing files) it's about the configuration of your server. Your root directory should be `path/to/craft/web` so you access `web/index.php` when you enter the normal url. Your url rewrite module should be on. You don't see any images because the file paths are messed up when you don't point to the web folder. You don't see the cp because you either entered the wrong url (`web/index.php?p=admin`) or your rewrite module is not on or you didn't move the htacces file. https://github.com/craftcms/docs/blob/master/en/installation.md#4-set-up-the-web-server
Comments.UserDisplayName: Robin Schambach
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-01-07T21:30:47.987Z
Comments.Text: Thanks Robin! I have .htacces in the /web/.htaccess folder, but I need another one in the root, right? Where can I find an example of root/.htaccess with redirection to /web? Maybe I need something more in this file? Why my craft 3 installation does not have it?
Comments.UserDisplayName: podeig
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-01-08T04:35:00.617Z
Comments.Text: There is no example or existing htacces because you don't need it. As I said your root folder for your vHost/your url should be the web folder. No one should ever have access to `/path/to/craft` only to `/path/to/craft/web`
Comments.UserDisplayName: Robin Schambach
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-11-24T14:14:48.453Z
Comments.Text: I´m in the same problem here, is there any guideline in the Craft docs to do this? I have to change the root directory on the host? I read that some folder need to be uno level up from the root for security reasons ( as craft 2 ), what folders, and how to configure the new path to them? This point it´s not clear for me.
Comments.UserDisplayName: Sebastián.
Tags: <craft3><deployment>
Title: Deployment of Craft 3 site to the production server
ThreadText: # Deployment of Craft 3 site to the production server
  
  (Asked by: username_0 on 2018-01-06)
  
  I am quite new in Craft CMS 3. I have developed a new site and now I want to move it to the production server. I have just moved all the files by FTP, moved the database, changed .env variables.
  
  [![enter image description here](https://i.sstatic.net/bRuE5.png)](https://i.sstatic.net/bRuE5.png)
  
  But when I go to the URL I get a message: "Forbidden You don't have permission to access / on this server."
  
  If I go to URL/web then I get the first page but without images.
  
  URL/admin shows "Not Found The requested URL /admin was not found on this server."
  
  How do I deploy the site? I cannot find a good article/help about deployment for Craft 3.
  
  **Tags:** craft3, deployment
  
  > **Comments:**
  > **username_1**: It's not about the deployment (moving/changing files) it's about the configuration of your server. Your root directory should be `path/to/craft/web` so you access `web/index.php` when you enter the normal url. Your url rewrite module should be on. You don't see any images because the file paths are messed up when you don't point to the web folder. You don't see the cp because you either entered the wrong url (`web/index.php?p=admin`) or your rewrite module is not on or you didn't move the htacces file. https://github.com/craftcms/docs/blob/master/en/installation.md#4-set-up-the-web-server  
  > **username_0**: Thanks username_1! I have .htacces in the /web/.htaccess folder, but I need another one in the root, right? Where can I find an example of root/.htaccess with redirection to /web? Maybe I need something more in this file? Why my craft 3 installation does not have it?  
  > **username_1**: There is no example or existing htacces because you don't need it. As I said your root folder for your vHost/your url should be the web folder. No one should ever have access to `/path/to/craft` only to `/path/to/craft/web`  
  > **username_2**: I´m in the same problem here, is there any guideline in the Craft docs to do this? I have to change the root directory on the host? I read that some folder need to be uno level up from the root for security reasons ( as craft 2 ), what folders, and how to configure the new path to them? This point it´s not clear for me.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2018-03-21. Score: 3
  
  This looks like a well visited question, its easy as something like this with apache2:
  
  ```
  <VirtualHost *:80>
          ServerAdmin webmaster@localhost
          DocumentRoot /var/www/html/web/
  
          <Directory /var/www/html/web/>
             Options FollowSymLinks
             AllowOverride None
             Require all granted
          </Directory>
  </VirtualHost>
  
  ```
  
  This is just a sample vhost file, but the real important part here is that you have the **web** folder set as your document root. This of course wont help anyone not using apache.
  
  
  ---
  
  ### Answer by username_4 on 2018-01-07. Score: 1
  
  This article might be useful to you; there is a section on how to deploy Craft CMS 3 as well:
  
  [Setting up a New Craft CMS 3 Project](https://nystudio107.com/blog/setting-up-a-craft-cms-3-project)
  
  We also recently did a podcast on [Website Deployment without Tears](https://devmode.fm/episodes/website-deployment-without-tears)
  
  
  ---
  
  