I have a working setup of the codedeploy which deploys when I commit to my repository. Following is my appspec.yml configuration -
version: 0.0
os: linux
files:
- source: /
destination: /var/www/html/
permissions:
- object: /var/www/html/rentals
pattern: "**"
owner: apache
mode: 777
type:
- directory
Problem is though i have .htaccess file on git, Codedeploy ignoring this file.
Depending on where your .htaccess file is located it may not be uploaded to the remote git repository and then the file will be missing when CodeDeploy deploys your application.
The accepted answer on the stack overflow question Make .git directory web inaccessible suggests placing a .htaccess file inside the .git directory and in this case the file won't get pushed to your remote repo (e.g. GitHub).
I'd check that the .htaccess file exists in the root directory of the repository and not the .git directory and then verify the file is getting pushed to the remote repository that CodeDeploy is configured to deploy from.
Related
I am using Netlify to host a github repo and am trying to find a way to host additional files on the domain.
( If you don't know what Netlify is check it out. It's a fast dirty and free version of AWS code deploy as far as I understand. (Disclaimer have not used AWS code deploy))
Example
Base Domain:
https://physiome-test.netlify.com/
Load a 3D model from
https://physiome-test.netlify.com/3Dmodels/heart/fullheart.json
Does anyone know if this is possible? I understand that they only provide 'static sites' but I don't see why that couldn't include file storage so that one doesn't have to worry about CORS
Netlify will host all static content in the folder you tell it to on deploy. You are currently telling Netlify to put your whole repository into the site starting at the root of the repository. This is causing issues with your relative paths.
You can go to any path in your repository at this time on your site and get a returned response of the file.
Solution:
Build your site into one build location and have Netlify deploy that location to the site. Any path relative to the root path of the location will be the root of your site.
1. Put the body assets under your simple_heart/models directory at simple_heart/models/body
2. netlify.toml (root of your repository)
[build]
command = "cp -r ./simple_heart ./build && npm run build"
publish = "build"
3. Fix your index.html in the simple_heart to reflect the relative paths from the root of simple_heart which will now be the root of your site with the build assets physiomeportal.js and physiomeportal.min.js at the root of your site.
note: To see this, run the command from the root of your site on a local build.
I saw this https://kroltech.com/2014/09/14/quick-tip-increase-upload-size-in-aws-elastic-beanstalk-node-js-env/
and created a file called .ebextensions/00_reload_nginx.conf with:
files:
"/etc/nginx/conf.d/proxy.conf":
mode: "000755"
owner: root
group: root
content: |
client_max_body_size 100M;
However, when I ssh into the machine, that file doesn't exist and nor doe the content. What am I doing wrong?
So stupid! The filename has to end in .config, not .conf. I hope someone else is saved the hours of agony that I went through.
I have tried all .ebextensions method of adding implementation level configuration and it didn't help me in the latest Amazon Linux AMI. You need to follow this structure to increase the upload size.
You need to follow this structure to increase the upload size limit.
Add the below folder setup in the root level of your project folder.
Folder structure (.platform/nginx/conf.d/proxy.conf)
.platform/
nginx/
conf.d/
proxy.conf
Add this line to proxy.conf (Inside .platform/nginx/conf.d/ folder)
client_max_body_size 50M;
commit this file and deploy again using eb deploy.
I recently started to make my website and found interesting thing. I spent like 30 mins to modify my index page but it didn't change somehow. And then I found out index.jade is the one in wwwroot folder, not repository folder. I compared these two folders and it has no difference at all. They both have same jade files.
I wonder what is the purpose for each directory? What wwwroot directory for and what repository directory for?
When I tested, there is no change in "actual website" when I modify index.jade file in repository directory. But actual website changes when I modify index.jade file in wwwroot folder.
Thanks in advance.
When you provision a webapp in Azure appservice you will not have repository folder by default. When you enable deployments (like say Local Git Repository) then repository folder is created. wwwroot will be there by default and is the right location where the actual content is served by the webapp. Repository is where you can push your code (through git push) from local git repo to azure remote and will be first staged in "repository" directory and deployed to "wwwroot" but i don't think if you change/upload/ftp the files to repository it won't impact anything unless you either copy to wwwroot as well (or deploy code through git push to remote). so in short wwwroot is where the content is served by your web server and repository is where the code is managed/staged for fetch/push.
https://azure.microsoft.com/en-us/documentation/articles/app-service-deploy-local-git/
OpenShift expects the following directory structure for nodejs app.
(git repo)
../-- .git
-- package.json
--server.js
--Gruntfile.js
-- ....
--/...
I have following git repository directory structure.
(git repo)
../-- .git
-- webserver ( nodejs app with package.json and gruntfile resides here)
-- mobileApp
-- dbScripts
Is it possible to direct OpenShift to consider webserver directory as nodejs app directory?
The easiest way to do this would be to move the files in the webserver directory into the root directory of the Openshift gear. That or you could alter your start and stop action hooks in .openshift/action_hooks/ to start your Nodejs application from within that webserver directory.
I have a git repo where a group of developers and I are collaborating on project code. occasionally, we'd like to copy the git repo to a VPS (setup as Linux server) that has an external IP address (w.x.y.z).
I can go into an SFTP client and navigate up the folder hierarchy to the server root and then navigate down to /var/www/ (server web root) to drop my files in but I'd like to deploy to the server through the command line instead.
My goal is to configure the Linux server as a remote git directory but don't know how to go about navigating up the file hierarchy to have git recognize that the remote branch repo needs to go into /var/www/.
Brief search has uncovered git remote add origin username#w.x.y.z then use git push origin.
It seems that connecting this way to w.x.y.z will land me at the home folder of 'username', not the root web directory (/var/www/) when accessed via the browser.
Does anyone have insight into how I should go about setting up a remote directory for deploying a git repo to a "production" server?
You appear to be doing this a rather non-obvious way. I think what you want to do is copy the git repo to somewhere else (the vps server). The standard way to achieve this is git clone.
In your /var/www/ directory or an appropriate subdirectory thereof, do:
git clone [URL-FROM-GITHUB]
That will clone the git repository to your VPS. You can then update it with
git pull
could script this with
ssh my.vps.server 'cd /var/www/whatever && git pull'
However, normally you don't want the entire project in '/var/www/...' because that would also put stuff you did not mean to deploy there, e.g. the .git directory. Hence perhaps better to clone the repo within your home directory, and make a small script to rsync the appropriate /var/www/ directory against your repo, using --exclude to remove files you don't want, or just rsync-ing a subdirectory of the repo.