C language / C ++ development environment construction on Ubuntu

It is a procedure to build a C language / C ++ development environment on Ubuntu.

Make Ubuntu available

Let's make Ubuntu available.

Proceed to the console screen where you can execute commands, and then log in as the initial user.

The individual procedures using VPS and cloud server are published below.

Create User

Next, create a user on the console screen. Let's create two users, one to run the web application (myapp) and one to our own (for example, kimoto).

Add user There is an "-m" option, set a password, and add it to the sudo group.

Firewall settings

Open the following ports in the firewall settings of the network provided by the hosting service. If you are building your server on-premises, use the ufw command to open the following ports.

SSH SSH port (default port 22 is dangerous)

Using SSH client

Let's connect to the server with SSH from the computer so that you can execute commands and edit files.

Command execution on SSH client

In the case of Windows, TeraTerm is a tool for connecting to an SSH server with an SSH client and executing commands.

There are SSH clients that work on other Windows such as PuTTY, so you can use it as you like. so.

For Mac, you can use the ssh command from the terminal.

Use SCP to edit files on the server

You can edit files on the server using a protocol built on SSH called SCP.

WinSCP is the SCP client for Windows.

There is software on your Mac that can replace WinSCP on Windows, so install it.

SSH server settings

Time zone setting

Let's set the time zone to "Asia / Tokyo".

Package installation

Ubuntu's package management tool is apt. Install the package may not work, so make sure you have the latest version of apt first.

First, let's build a web server, application server, mail sending server, and DB server all in one machine.

Compiler Linker

Install gcc for C language compilation, g ++ for C ++ compilation, and make, a tool that can resolve compilation dependencies.

Repository management

Install Install git-Git distributed repository management system

good job for today.

Associated Information