WEBVTT

00:03.050 --> 00:04.250
For this course.

00:04.250 --> 00:07.610
I assume you have vagrant installed on your system.

00:07.880 --> 00:14.240
If not, please refer to the additional materiality at the end of the course where you will find a lecture

00:14.240 --> 00:16.250
on how to install vagrant.

00:16.550 --> 00:23.660
So I am now in the project directory and to download and run an ubuntu instance, I'll run vagrant in

00:23.660 --> 00:23.780
it.

00:23.780 --> 00:29.210
Ubuntu slash trusty 64 and vagrant up commands then vagrant ssh.

00:37.360 --> 00:40.120
Now let's install engine x on Ubuntu.

00:40.450 --> 00:47.000
Engine x is a popular open source web server that is widely used for web hosting and reverse proxy services.

00:47.020 --> 00:50.080
Step one Update System Packages.

00:50.320 --> 00:56.500
Before installing any software, it is always a good practice to update the system packages, open the

00:56.500 --> 01:00.190
terminal and run the following command to update the package index.

01:00.190 --> 01:01.810
Sudo apt update.

01:06.520 --> 01:14.530
Step two to install engine x run sudo apt install engine x step three start engine x service.

01:14.530 --> 01:20.500
Once the installation is complete, start the engine x service by running the following command pseudo

01:20.500 --> 01:22.960
system CTL Start engine X.

01:35.210 --> 01:36.950
Okay, we've got an error here.

01:36.950 --> 01:41.840
The error message pseudo system CTL command not found.

01:41.870 --> 01:46.370
It indicates that the system CTL command is not installed on the system.

01:46.370 --> 01:50.600
This error occurs because the system CTL command is part of the system.

01:50.600 --> 01:56.600
DH System and service manager, which is not installed by default on all distributions of Ubuntu.

01:56.630 --> 02:03.290
To resolve this issue, you need to install system D by running the following command sudo appkit install

02:03.290 --> 02:04.220
system rd.

02:04.250 --> 02:09.770
After installing system rd, you should be able to use the system settle command to manage services

02:09.770 --> 02:10.730
on your system.

02:12.770 --> 02:14.450
And we've got an error again.

02:14.480 --> 02:23.290
The error message failed to issue method call unit Engine X service failed to load no such file or directory.

02:23.300 --> 02:27.680
It indicates that the engine X service unit file could not be found.

02:27.710 --> 02:33.140
This error occurs because the service unit file is not properly installed on the system.

02:33.260 --> 02:38.360
To resolve this issue, you need to create the Engine X service unit file.

02:38.570 --> 02:45.920
Run the following command in the terminal to create the unit file pseudo nano slash ETSI system DX slash

02:45.920 --> 02:48.410
system slash engine X service.

02:59.900 --> 03:00.860
And an error.

03:00.860 --> 03:05.480
Again, the error message job for Engine X service failed.

03:05.480 --> 03:11.270
It indicates that there was a problem starting the Engine X service to troubleshoot the issue.

03:11.300 --> 03:17.270
You can check the status of the Engine X service and view the system logs to check the status of the

03:17.270 --> 03:18.470
engine X service.

03:18.470 --> 03:21.980
Run the following command in the terminal pseudo system.

03:22.010 --> 03:24.380
CTL Status Engine X Service.

03:24.380 --> 03:30.260
This command will provide detailed information about the Engine X service and any errors that may have

03:30.260 --> 03:32.230
occurred while starting the service.

03:32.240 --> 03:38.300
You can also view the system logs by running the following command pseudo journal CTL.

03:38.300 --> 03:39.020
Ken.

03:39.290 --> 03:45.410
This command will show you the logs generated by the system, including logs related to the Engine X

03:45.410 --> 03:46.190
service.

03:46.190 --> 03:52.250
By reviewing the status and logs, you should be able to identify the problem and take the necessary

03:52.250 --> 03:53.780
steps to resolve it.

03:53.960 --> 03:57.740
It could be a misconfigured engine x configuration file.

03:57.740 --> 04:00.770
Missing dependencies or another issue.

04:01.730 --> 04:03.020
Let's troubleshoot it.

04:03.050 --> 04:08.420
We'll copy this command and run it System CTL Status Engine X Service.

04:08.420 --> 04:15.410
The error Message Engine X bind to Port 80 failed address already in use indicates that the Engine X

04:15.410 --> 04:21.040
service is unable to bind to Port 80 as another process is already using that port.

04:21.050 --> 04:28.010
To resolve this issue, you need to find the process that is using Port 80 and either stop that process

04:28.010 --> 04:34.690
or configure engine X to use a different port to find the process that is using port 80.

04:34.700 --> 04:42.070
You can run the following command pseudo net stat rt ulp and vertical bar grep 80.

04:42.080 --> 04:46.480
This command will show you a list of all the processes that are listening on Port 80.

04:46.490 --> 04:52.760
Once you have identified the process that is using port 80, you can either stop that process or configure

04:52.760 --> 04:59.150
engine X to use a different port to configure engine X, To use a different port, you need to edit

04:59.150 --> 05:05.210
the engine X configuration file, run the following command in the terminal to edit the configuration

05:05.210 --> 05:05.810
file.

05:05.810 --> 05:13.910
Pseudo nano slash etsy engine x engine x conf in the configuration file.

05:13.910 --> 05:19.600
Find the line that starts with listen 80 and change 80 to the desired port number.

05:19.610 --> 05:26.900
For example, you can change it to listen 8080 after making the changes save the file by pressing Ctrl

05:26.900 --> 05:34.550
plus x, then y and finally enter, then restart the engine X service by running the following command

05:34.550 --> 05:38.210
pseudo system CTL Restart Engine X.

05:38.210 --> 05:41.390
The Engine X service should now be listening on the new port.

05:41.390 --> 05:48.740
So here the output of the command pseudo net start rt ulp and vertical bar grep 80 confirms that engine

05:48.740 --> 05:52.670
X is indeed listening on port 80 since another process.

05:52.670 --> 05:56.600
In this case engine X is already using port 80.

05:56.630 --> 06:03.650
You need to either stop that process or configure engine X to use a different port to stop the process

06:03.650 --> 06:05.170
that is using port 80.

06:05.180 --> 06:10.790
You can use the kill command with the process id of the process that is using port 80.

06:10.790 --> 06:17.900
The process ID can be obtained from the output of the command sudo net stat rt ulp and vertical bar

06:17.900 --> 06:19.250
grep 80.

06:19.400 --> 06:24.050
In the example you provided, the process id is 2469.

06:24.050 --> 06:30.170
To stop this process, run the following command in the terminal pseudo kill 2469.

06:30.170 --> 06:36.710
After stopping the process, you can start again by running the following command pseudo system CTL

06:36.710 --> 06:42.860
start engine X Engine X should now be able to bind to Port 80 and start serving web pages.

06:42.860 --> 06:44.480
So we did the following.

06:44.480 --> 06:49.160
Pseudo kill 2469 pseudo net stat to check the port usage again.

06:49.160 --> 06:56.450
Pseudo system CTL start engine x pseudo system, CTL status Engine X service and it looks like Engine

06:56.450 --> 07:00.200
X has started successfully now as the output of the pseudo system.

07:00.230 --> 07:05.180
CTL Status Engine X service Command shows that it is active running.

07:05.360 --> 07:11.090
You can confirm that Engine X is up and running by accessing a web page hosted by Engine X in a web

07:11.090 --> 07:18.080
browser or by using the CURL command in the terminal curl http slash local host.

07:18.080 --> 07:24.290
This should return the default engine x welcome page indicating that engine X is working correctly.
