If you're learning Linux for the first time, do this!

Target person

I decided to use Linux for business I don't know what to study from I posted it so that people can see it. If you have any questions, please comment. I will edit it as appropriate!

As a premise

There is an environment where you can operate Linux freely. There are many articles about OS installation, so I will omit it. (It is recommended to build it on the cloud rather than at home.)

Let's build a web server

I think this is the best way to learn about Linux.

--General user (user who can execute only limited commands) Login with saito --Confirm that you can log in as a saito user

$ id
uid=1000(saito) gid=1000(saito) groups=1000(saito)

Supplement: When there is no general user who can operate

# useradd saito
# passwd saito
(Any PW is OK. There is no output on the screen, so enter it twice.)

--Switch to root user

The prompt changes from $ to #.

$ su -
Password: (Enter root PW)
# 
# id
uid=0(root) gid=0(root) groups=0(root)

--Check if the required packages are installed on the web server

If you think of a package as software, it's OK. This time, Apache (httpd) is assumed. If you do the following and there is no output, you know that you have not installed it.

# rpm -qa | grep httpd

Note: How to install httpd I will post the difference between rpm and yum if I have a chance.

# rpm -ivh httpd*
Or
# yum -y install httpd

--Open your browser and try to access it

Enter "http: // localhost" in the URL of the browser and execute. I get an error because the HTTP service has not started.

--Check and start HTTP service status

# systemctl status httpd
   :
 Active: inactive (dead)
   :
# systemctl start httpd
   :
 Active: active (running)
   :

--Open your browser and try accessing it again

If you update with the F5 key on the browser, a test page will be output. image.png


Bonus: Create your own HTML file

# vi index.html
--from here--
<html>
<head>
 <title>Test Page</title>
</head>
<body bgcolor=skyblue>
 <h1>hello world</h1>
</body>
</html>
--So far--

--Check the created HTML

# ls
(index.Make sure you have html)

# cat index.html
(If you need to edit, vi index.html)

--Copy and check the created HTML file

# cp index.html /var/www/html
# ls /var/www/html

-Open your browser and try accessing it again You can check the HTML you created!


Summary

By building a web server --Login --User switching --File operation --File editing --Package management --Service startup -(Process) You can learn a lot of things.

Recommended Posts

If you're learning Linux for the first time, do this!
Let's try Linux for the first time
Kaggle for the first time (kaggle ①)
Kaguru for the first time
[For self-learning] Go2 for the first time
See python for the first time
Start Django for the first time
Differences C # engineers felt when learning python for the first time
MongoDB for the first time in Python
I tried using scrapy for the first time
How to use MkDocs for the first time
I tried python programming for the first time.
I tried Mind Meld for the first time
virtualenv For the time being, this is all!
Try posting to Qiita for the first time
Looking back on the machine learning competition that I worked on for the first time
GTUG Girls + PyLadiesTokyo Meetup I went to machine learning for the first time
What I got into Python for the first time
I tried Python on Mac for the first time.
Register a task in cron for the first time
I tried python on heroku for the first time
I will install Arch Linux for the time being.
AI Gaming I tried it for the first time
Automatic brute force machine learning (regression analysis) -This greatly reduces the time for parameter tuning-
Summary of stumbling blocks in Django for the first time
Introducing yourself at Qiita for the first time (test post)
Introduction to Deep Learning for the first time (Chainer) Japanese character recognition Chapter 1 [Environment construction]
[Introduction to Reinforcement Learning] Reinforcement learning to try moving for the time being
What kind of environment should people who are learning Python for the first time build?
Introduction to Deep Learning for the first time (Chainer) Japanese character recognition Chapter 3 [Character recognition using a model]
What to do if the inode is exhausted on EC2 Linux
I tried logistic regression analysis for the first time using Titanic data
[Python] [Machine learning] Beginners without any knowledge try machine learning for the time being
Impressions and memorandums when working with VS code for the first time
For the first time in Numpy, I will update it from time to time
Find out where the java entity is on Linux (CentOS this time)
Since I'm free, the front-end engineer tried Python (v3.7.5) for the first time.
Qiita's first post (the reason for starting)
First Steps for Machine Learning (AI) Beginners
Python Master RTA for the time being
Real Time Clock (RTC) Drivers for Linux
Let's display a simple template that is ideal for Django for the first time
Introduction to Deep Learning for the first time (Chainer) Japanese character recognition Chapter 4 [Improvement of recognition accuracy by expanding data]