Category Archives: Linux

Nginx Error: nginx: [emerg] the “ssl“ parameter requires ngx_http_ssl_module in /project/api/nginx.conf:

Error reporting reason:

NGX is not installed_http_ssl_Module module

Solution:

    1. check which modules are installed in Nginx
/usr/local/ngxin/sbin/nginx -V

nginx version: nginx/1.12.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 
configure arguments:

No parameters after configure arguments indicates that no modules are installed
install NGX_http_ssl_Module the module is in the installation directory ofngxin, note the installation directory, find configure and execute:

./configure --prefix=/usr/local/nginx 
./configure --with-http_ssl_module

After installation, execute make and make install

make
...
make install

Back up the original nginx, and overwrite the compiled nginx with the original nginx

cp /usr/local/nginx/sbin/nginx  /usr/local/nginx/sbin/nginx.bak
cp ./objs/nginx /usr/local/nginx/sbin/

Check whether the installation is successful

/usr/local/nginx/sbin/nginx -V

nginx version: nginx/1.12.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --with-http_ssl_module

[UNK] enable nginx

/usr/local/nginx/sbin/nginx -s reload

How to Solve Roscore Run error [Install ROS]

Command ‘roscore’ not found, but can be installed with:
sudo apt install python-roslaunch

Install Python Ross launch as prompted,

Error reporting: e: unable to correct problems, you have held broken packages

According to the online search, the binary executable named “roscore” may not exist in the folder “/opt/ROS/indigo/bin/”, and there will be no problem after having it

Solution:

1. First check whether there is a binary executable named roscore in the folder. If it does not exist, execute step 2. If it does exist, execute step 3

cd /opt/ros/melodic/bin
ls -l

2. If it does not exist, execute the following code, and then execute the first step to see if the roscore file exists. If it does, execute the third step

sudo apt-get install ros-melodic-desktop

3. If the roscore file is found in the first step, find the file named setup.sh under melody (the version of ROS you installed) and source its path

source /opt/ros/melodic/setup.sh

Enter roscore at the terminal, the problem is solved and the execution is successful.

Runtime error – [xcodeproj] unknown object version. [How to Solve]

Error during pod install:

### Error

“`
RuntimeError – [Xcodeproj] Unknown object version.
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.15.0/lib/xcodeproj/project.rb:227:in `initialize_from_file’
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.15.0/lib/xcodeproj/project.rb:112:in `open’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:1177:in `block (2 levels) in inspect_targets_to_integrate’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:1176:in `each’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:1176:in `block in inspect_targets_to_integrate’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/user_interface.rb:64:in `section’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:1171:in `inspect_targets_to_integrate’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:106:in `analyze’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:410:in `analyze’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:235:in `block in resolve_dependencies’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/user_interface.rb:64:in `section’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:234:in `resolve_dependencies’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:156:in `install!’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/command/install.rb:52:in `run’
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/command.rb:52:in `run’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/bin/pod:55:in `<top (required)>’
/usr/local/bin/pod:23:in `load’
/usr/local/bin/pod:23:in `<main>’
“`

Reason: Xcode version and CocoaPods version do not match, need to update CocoaPods
Solution.
Enter the command in the terminal

gem install cocoapods --pre

Error Messages:

ERROR:  While executing gem … (Gem::FilePermissionError)
You don’t have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

Plus permissions:

sudo gem install cocoapods --pre

Execute pod install again successfully!

Error: loading shared libraries: cannot open shared object file: No such file or directory

Error : loading shared libraries: cannot open shared object file: No such file or directory

1. Problem Description:

The program s needs the support of Library L1 and Library L2 to run Library L1/L2 after installation, when executing software s, Library L2 shared object cannot be loaded, prompting that the file or path does not exist

**2. Solution:**

When the library is dynamic library, you need to indicate the path of the dynamic library for the operating system when running the program s.

2.1 determine the path of Library :
$ sudo find/-name library_name.so
2.2 determine whether the dynamic library path exists in the environment variable (ld_library_path) 
$ echo $LD_LIBRARY_PATH 
2.3 assign the dynamic library path to the environment variable (ld_library_path)
$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/the/lib
$ export LD_LIBRARY_PATH

You can run the program.

expand:

**1. Library files in linux System: * *
library is a collection of precompiled code segments called functions. Libraries contain common functions that together form a package called a library. Functions are blocks of code that are reused throughout the program. Calling these code fragments repeatedly in the program can save time. You can avoid rewriting code multiple times. For programmers, libraries provide reusable functions, data structures, classes, and so on.

Libraries are not executable, which is the key difference between processes and applications. Libraries work at run time or compile time. In C programming language, there are two types of Libraries: dynamic library and static library.

**Dynamic and static libraries: * *
dynamic or shared libraries appear as independent files other than executable program files. Therefore, the program only needs one copy of the dynamic/shared library file at run time. The static libraries are locked in the program.

**2. linux system environment variables: * *
environment variables and shell variables:

Environment variables are managed by the shell. The difference between environment variables and regular shell variables is that shell variables are local variables of specific instances of shell, such as shell scripts, while environment variables are “inherited” by any program you start, including another shell. In other words, the new process obtains copies of its own variables. It can read and modify these variables and pass them to its child processes in turn. In fact, every UNIX process (not just shell) passes its environment variables to its child processes.

Environment variables are globally available in programs and their subroutines. Shell variables are only available in the current shell. Environment variables like $shell are valid system wide. In the current bash shell, $bash points to the execution path of bash, while $shell points to the shell (its value may be the same) defined as Default.

#Define the shell variable VAR and its value
[biocodee@localhost ~]$ VAR="This is a variable"
[biocodee@localhost ~]$ echo $VAR
This is a variable
# See if the shell variable exists in the environment variable env
[biocodee@localhost ~]$ env | grep VAR
# Convert a shell variable to an environment variable
[biocodee@localhost ~]$ export VAR
[biocodee@localhost ~]$ env | grep VAR
VAR=This is a variable

[Solved] Linux: downloading arXiv papers using WGet: error 403: forbidden

Use command

wget https://arxiv.org/pdf/The_papers_you_need_to_download.pdf

from vengeance.”

Resolution arxiv.org (arxiv.org)…128.84.21.199
Connecting to arxiv.org (arxiv.org)|128.84.21.199|:443… Available403 Forbidden
2021-10-22 13:57:11 ERROR 403: Forbidden

The solution is:

Modified:

wget -U NoSuchBrowser/1.0 https://arxiv.org/pdf/The_papers_you_need_to_download.pdf

You can download it successfully

Linux Ubuntu Django Error: uwsgi: error while loading shared libraries: libpcre.so.1

Deploy Django service under Ubuntu and report errors using uwsgi

uwsgi --http :8001 --wsgi-file test.py

Error Messages: uwsgi: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory

Solution:

sudo apt-get install libpcre3 libpcre3-dev # Install the required packages

find/-name libpcre.so.3 # Find libpcre.so.3 (usually in the root directory /lib/x86_64-linux-gnu)

Find /lib/x86_64-linux-gnu/libpcre.so.3

sudo ln -s /lib/x86_64-linux-gnu/libpcre.so.3 /usr/lib/libpcre.so.1 # Just make a soft link

[Solved] Failed to start LSB: Bring up/down networking

Similarly, this can also solve the problem that Linux Ping does not sleep on the host because the network is not turned on

Solve the problem of failed to start LSB: bring up/down Networking: caused by MAC address

Here are two solution I found online:

1. Close NetworkManager
2. Change MAC
I tried, but failed

Later, I found that the name of my network card was wrong, so I changed it, and the memory size of the virtual machine became like this

Later, I copied the network card and changed its name

Linux Error: Failed to connect to ::1: No route to the host

When I started es on Linux today, it showed that I did not find the route of the host, and I reported similar errors before, because the port was not configured in Alibaba cloud security group configuration, and this problem was solved after configuration. Today, this problem arises again. I can’t help but let people think about it. Later, it was found that kenneng was caused by insufficient memory automatically allocated to the JVM when ES was started. Therefore, we need to modify the default memory parameters.

We go to jvm.options under config in the ES folder

Since the memory of the server you bought is only 2G, 218m is allocated (Note: – XMS and no space between numbers)

Linux system service command error: Failed to allocate directory watch: Too many open files

In the Linux system, an error is reported through the service or systemctl command

    Failed to allocate directory watch: Too many open files

The solution is as follows

vim /etc/sysctl.conf
	fs.inotify.max_user_instances=512
	fs.inotify.max_user_watches=262144

Add the above two lines
to execute

sysctl -p 

Syactl – a view all current system parameters

Linux Install Docker Error: Failed to restart docker.service: Unit docker.service not found.

Exception during Linux Installation of docker: failed to restart docker.service: unit docker.service not found

Linux CentOS version confirmation

1. Linux system centos7 installation docker
install here in centos7. You can use the following command to view the CentOS version

lsb_release -a

Check whether docker list is installed

yum list installed | grep docker

2.2 installing docker

yum -y install docker

-Y means do not ask for installation until the installation is successful. After the installation, check the installation list again

2.3 start docker

systemctl start docker

2.4 viewing docker service status

systemctl status docker
    1. linux centos8 installation docker
    1. installation dependency
yum install -y yum-utils  device-mapper-persistent-data  lvm2
 yum-config-manager  --add-repo   https://download.docker.com/linux/centos/docker-ce.repo
 yum install docker-ce docker-ce-cli containerd.io

Install docker

yum install docker-ce docker-ce-cli

Start docker

systemctl start docker

Startup self startup

Set the docker to start automatically after startup

systemctl enable docker