I wrote it in, but it's over, so I moved to article 1 2019/03/03
I tried to transfer the domain I had for a long time to AWS, so I thought about doing something
Create an instance on EC2 with t2.small (because elasticsearch was an error with t2.micro) Fixed public IP with Elastic IP Go to ~ / .ssh
ssh -i ~/.ssh/[Key file].pem centos@[IP set]
Initially https://github.com/weseek/growi I tried to start it from, but it didn't work well on the way (I just forgot to open the port when I think about it later ...) https://github.com/weseek/growi-docker-compose Built in So the procedure is blurred
Since it is from a new instance, there are places that include things that are not related to this installation wget
## wget, yarn, node, npm
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
sudo yum -y install wget
sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo
sudo yum install git gcc-c++ make nodejs yarn
sudo npm install -g [email protected]
## selinux
sudo /etc/sysconfig/selinux
sudo vi /etc/sysconfig/selinux
## epel, jdk
sudo yum -y install epel-release
sudo yum -y install java-1.8.0-openjdk
## nginx, docker, docker-compose
sudo yum -y install nginx
sudo yum -y install docker
sudo yum -y install docker-compose
## forever
sudo npm install forever -g
## growi
mkdir personal
cd personal/
git clone https://github.com/weseek/growi.git
cd growi/
sudo sudo git checkout -b v3.3.10 refs/tags/v3.3.10
##After that, I made various trials and errors
##I noticed here that elasticsearch does not start and changed the instance type
## growi-docker-compose
cd ../
git clone https://github.com/weseek/growi-docker-compose.git
sudo vi growi-docker-compose/docker-compose.yml
cd growi-docker-compose/
docker-compose up -d
##I did not start here, so check the error
## service
sudo vi /etc/nginx/nginx.conf
sudo systemctl enable nginx
sudo systemctl start nginx
##Add docker user
sudo groupadd docker
sudo gpasswd -a $USER docker
sudo systemctl restart docker
exit
##Re-ssh and start
cd personal/growi-docker-compose/
docker-compose up -d
/etc/sysconfig/selinux
#SELINUX=enforcing
SELINUX=disabled
/etc/nginx/nginx.conf
http {
map $http_upgrade $connection_upgrade {
default Upgrade;
'' close;
}
upstream growi {
server localhost:3000;
}
server {
location / {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://growi;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 900s;
}
}
}
docker-compose.yml
#Remove localhost
ports:
- 3000:3000 # localhost only by default
#Enable file upload
environment:
- FILE_UPLOAD=local # activate this line if you use local storage of server rather than AWS
If you do so far http://[ElasticIPで設定したIP] The initial screen was displayed from the browser with At first I didn't open ports 80 and 3000 here in the EC2 security group http://[ElasticIPで設定したIP] http://[ElasticIPで設定したIP]:3000 I was addicted to not seeing either of them. .. ..
I was able to set the domain and DNS migrated with Route53 and link the Elastic IP to the subdomain and display it in the migration domain
Recommended Posts