In my last article, I’ve introduced how to access EC2 instance. In this article, let’s develop EC2 instance as a web server. First of all, let’s install nginx as web server.
- Web site can be accessed on the Internet with FQDN
- Basic LAMP environment (Linux, Nginx, PHP, MySQL)
- No redundant configuration and backup
System Configuration diagram is as below. Public Users access Web site through Route53 with FQDN. On the other hand, Administrator access to Web site via Internet Gateway.
Firstly, switch user to root user.
And, create repository setting file for nginx to download the necessary packages.
Install nginx package by executing “yum -y install nginx” command.
You can check if nginx was installed successfully by “nginx -v” command.
If the nginx version is displayed, it is successfully installed.
Next, auto starting setting can be enabled by the following command.
Next let’s start nginx.
And execute “systemctl status nginx” command, you can see “active(running)” message.
Finally, access nginx web page by accessing EC2’s public IP address by your browser.
If you can see “Welcome to nginx” page, nginx is working properly.
コメント