Posts

Showing posts from 2021

Ubuntu 18.04 npm install got error EMISSINGARG / 우분투18.04 nodejs npm install 에러

 As I setup ubuntu 18.04 and node app server, I found that funny error as follows: when I install nodejs and npm with apt.  It shows error msg like EMISSINGARG. npm ERR! Linux 4.15.0-139-generic npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" npm ERR! node v8.10.0 npm ERR! npm v3.5.2 npm ERR! code EMISSINGARG npm ERR! typeerror Error: Missing required argument #1 npm ERR! typeerror at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3) npm ERR! typeerror     at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22) npm ERR! typeerror     at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12) npm ERR! typeerror     at /usr/share/npm/lib/install/deps.js:457:7 npm ERR! typeerror     at /usr/share/npm/node_modules/iferr/index.js:13:50 npm ERR! typeerror     at /usr/share/npm/lib/fetch-package-metadata.js:37:12 npm ERR! typeerror     at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:

[VSCODE] Remote-SSH Linux Permission denied (public key)

Image
윈도우에서 Remote-SSH로 서버에 접속할때, 문제가 없었는데, 우분투에 vs code를 설치하고, PEM파일을 다운로드 받아서 실행시켜보니 아래와 같은 에러가 발생.  이유: pem파일의 파일 퍼미션이 너무 공개라 에러 발생 (644)  해결책: pem파일의 파일 퍼미션을 조정(600) --------------------- As windows vs code runs Remote-SSH well, I installed vscode in ubuntu 18.04 for aws server maintenance.  But, I got an error message like this.  I checked log file and found that public file permission got an error.  So, I changed public key to 600, then it works like charm. 

How to add webpage on lightsail bitnami wordpress aws amazon / 아마존 라이트세일 워드프레스 이미지에 워드프레스 아닌 페이지 추가하기

 I love aws lightsail.  I have set up lightsail wordpress preinstalled image for wordpress blogging.  But, recently, I need to test php site but I don't like to set up another lightsail image for that.  So, I have googled it but there be lots of wordpress multi-sites posts but adding non-wordpress page on wordpress image.  I have checked httpd.conf and found that Alias makes what I am thinking works.  So, I have inserts one Alias setting like below: Alias /test /opt/bitnami/apache/htdocs/test (/opt/bitnami/apache/conf/httd.conf) And restart apache2 server using script.  sudo ./restart.sh (/opt/bitnami/scripts) Then, Ta-da-! I can get non-wordpress site as below: http://wordpresssiteIPaddress/test Now, I can test php site for my study.  ---------------------------------------------------------------------------- 한국어 요약버젼 1. php페이지를 테스트하려고 보니, 워드프레스 페이지만 뜨더라  2. /opt/bitnami/apache/conf/httpd.conf 를 열어보니, Alias 설정을 할 수 있더라 3. Alias /test /opt/bitnami/apache/htdocs/test 로 설정하고 apache

Apache2 CORS issue and solution / 아파치2 CORS 이슈와 해결책

Recently, I got a CORS error in nodejs project when I tried to load a file from webdav server (hosted by apache2 of ubuntu 18.04).  So, I have learned that server configuration on CORS makes this done.  As I googled with keywords ‘cors apache2’ and found that apache2.conf setting on <Directory> tag make things work.  < Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted Header always set Access-Control- Allow -Origin " * " Header always set Access-Control- Allow -Headers " origin, content-type, cache-control, accept, authorization, if-match, destination, overwrite " Header always set Access-Control-Expose-Headers " ETag " Header always set Access-Control- Allow -Methods " GET, HEAD, POST, PUT, OPTIONS, MOVE, DELETE, COPY, LOCK, UNLOCK " Header always set Access-Control- Allow -Credentials " true " </ Directory > If you got some errors like headers then yo

viewstl.com STL viewer implementation / GET으로 파일URL추가해서 넣기.

Image
 As I made node app with STL viewer.  I installed viewstl.com's js app as STL viewer.  But, I would like to generate STLviwer with different files.  So, I studied online blogs and youtube videos.  I found that I can use HTTP GET request for stl file name as parameters like  http://host/stlview/:id then I can get :id as req.params.id and it can be used as stl filename.  I got two things comes up.  One is CORS I solved this from (https://enable-cors.org/server.html) for Apache as webserver and as webdav server and for express. Two is HTTP GET params.id called twice with wrong parameters.  So, I tried query like this: http://host/stlview?id=fileurl Then It works like a charm.  I am so happy to solve this issue in 3 weeks of struggling.  --------------------------------------------------------------------------- 한국어 3줄요약 1. STL viewer를 실행하는데, STL파일URL을 전달하고 싶은데, POST로 하니, 피곤한게 많아짐.  2. 결국은 GET으로 해서 id=fileurl을 전달하니, CORS때문에 안되다가 해결하고나니.  3. 아주 잘됨.