Как освободить занятый порт с командной строки?

  • Найти запущенный процес/порт:
netstat -anp tcp | grep 3000

ИЛИ



ps -eaf|grep 3000  

ИЛИ

lsof -i tcp:3000
  • Лог выполнения комманды:
>> 501 11207 11177 0 11:06PM ttys001 0:00.00 grep 3000

Нас интересует id процесса где запущен наш процес/порт, в нашем случае это “11177”

  • Убиваем процесс с помощью найденного id, коммандой “kill”:
kill -9 11177

git-ftp of Jenkins

Jenkins

git-ftp init -u $FTP_USERNAME -p $FTP_PASSWORD ftp://google.com/

ubuntu https://www.digitalocean.com/community/tutorials/how-to-install-jenkins-on-ubuntu-16-04

отдельно установить java

 

https://github.com/git-ftp/git-ftp/edit/master/INSTALL.md

 

# INSTALL

You can find instructions for:

- [Linux/Unix based systems using make](#linuxunix-based-systems-using-make)
- [Debian, Ubuntu and others using apt](#debian-ubuntu-and-others-using-apt)
- [ArchLinux](#archlinux-aur-unofficial)
- [MacOS](#macos)
- [Windows](#windows)


## Linux/Unix based systems using make

Note: Make sure Git and cURL are installed.

This should work on MacOS, Debian, Ubuntu, Fedora, RedHat, etc.

The easiest way is to use Git for installing:

```sh
git clone https://github.com/git-ftp/git-ftp.git
cd git-ftp

# choose the newest release
tag="$(git tag | grep '^[0-9]*\.[0-9]*\.[0-9]*$' | tail -1)"

# checkout the latest tag
git checkout "$tag"
sudo make install
```

Updating using git:

```sh
git fetch
git checkout "$(git tag | grep '^[0-9]*\.[0-9]*\.[0-9]*$' | tail -1)"
sudo make install
```


## Debian, Ubuntu and others using apt

At least Debian and Ubuntu provide git-ftp in their main repositories.

```sh
sudo apt-get install git-ftp
```

If you would like the newest release maintained by Git-ftp,
you can add the PPA:

```sh
sudo -s
add-apt-repository ppa:git-ftp/ppa

# On Debian, you need to modify the sources list to use the same PPA
source /etc/*-release
if [ "$ID" = "debian" ]; then
    dist="$(echo /etc/apt/sources.list.d/git-ftp-ppa-*.list | sed 's/^.*ppa-\(.*\)\.list$/\1/')"
    sed -i.backup "s/$dist/precise/g" /etc/apt/sources.list.d/git-ftp-ppa-*.list
fi

apt-get update
```


## ArchLinux (AUR: unofficial)

See https://aur.archlinux.org/packages/?O=0&C=0&SeB=nd&K=git-ftp&SB=v&SO=d&PP=50&do_Search=Go


## MacOS

First, ensure you have installed Xcode and command line tools. Command line tools can be download at https://developer.apple.com/download/more/ or via command: 

```
xcode-select --install
```

Using homebrew:

```sh
brew install git
brew install curl --with-libssh2
brew install brotli
brew install git-ftp
```

## Windows

There are at least two ways to install git-ftp on Windows.

- Using Git for Windows, former msysgit (recommended)
- Using cygwin

### Git for Windows, former msysgit (recommended)

Install [Git for Windows](https://git-for-windows.github.io/).
It comes with curl installed, but it doesn't support SFTP by default.
In order to use SFTP, [download curl](http://curl.haxx.se/download.html) for
Windows with SFTP support.
Win32 2000/XP MSI or Win64 2000/XP x86_64 MSI is recommended.
If you installed curl, then remove `bin/curl.exe` from your Git for Windows
installation directory. It will fall back to the newly installed version.

Finally, open the Git Bash which is located in `C:\Program Files (x86)\Git`
by default.

```bash
curl https://raw.githubusercontent.com/git-ftp/git-ftp/master/git-ftp > /bin/git-ftp
chmod 755 /bin/git-ftp
```

*Note: the `/bin` directory is an alias.
By default this is the same as `C:\Program Files (x86)\Git\usr\bin`.*

### cygwin

Install cygwin and install the package 'curl'.
Then open the cygwin console and install Git-ftp with the following commands:

```bash
curl https://raw.githubusercontent.com/git-ftp/git-ftp/master/git-ftp > /bin/git-ftp
chmod 755 /bin/git-ftp
```

### Git for Windows and cygwin both installed

If you have both Git for Windows and cygwin installed on Windows and want to
use Git for Windows for Git commands, you may get an error
"No such file or directory" for a path starting with "/cygdrive/", for example:

    creating `/cygdrive/c/TEMP/git-ftp-m7GH/delete_tmp': No such file or directory

The problem is that Git-ftp use commands from both Git for Windows and cygwin
directories. But by default, cygwin is configured to start paths with the
prefix "/cygdrive" while Git for Windows starts paths with "/".
To fix the problem, open file "<cygwin>\etc\fstab"
(e.g. "c:\cygwin\etc\fstab") and change parameter "/cygwin/" to "/", for example:

    # This is default:
    none /cygdrive/ cygdrive binary,posix=0,user 0 0

change to:

    # This is changed:
    none / cygdrive binary,posix=0,user 0 0

After this, close all console windows and try again.

 

vk.com/video13387403_456239249

How to Install RabbitMQ on CentOS 7

RabbitMQ is a widely used open-source message broker written in the Erlang programming language. As a message-oriented middleware, RabbitMQ can be used to implement the Advanced Message Queuing Protocol (AMQP) on all modern operating systems.

This article explains how to install RabbitMQ on a Vultr CentOS 7 server instance.

Prerequisites

Before getting started, you need to:

  • Deploy a brand new Vultr CentOS 7 server instance.
  • Log into the server as a non-root user with sudo privileges. You can learn about how to create such a sudo user in this Vultr article.

Step 1: Update the system

Use the following commands to update your CentOS 7 system to the latest stable status:

sudo yum install epel-release
sudo yum update
sudo reboot

Step 2: Install Erlang

Since RabbitMQ is written in Erlang, you need to install Erlang before you can use RabbitMQ:

cd ~
wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
sudo rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
sudo yum install erlang

Verify your installation of Erlang:

erl

You will be brought into the Erlang shell which resembles:

Erlang/OTP 18 [erts-7.3] [source-d2a6d81] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V7.3  (abort with ^G)
1>

Press Ctrl+C twice to quit the Erlang shell.

Step 3: Install RabbitMQ

Use the following commands to install the latest version of RabbitMQ which is 3.6.1 at the time of writing:

cd ~
wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-3.6.1-1.noarch.rpm
sudo rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc
sudo yum install rabbitmq-server-3.6.1-1.noarch.rpm

Step 4: Modify firewall rules

In order to access the RabbitMQ remote management console, you need to allow inbound TCP traffic on ports 4369, 25672, 5671, 5672, 15672, 61613, 61614, 1883, and 8883.

sudo firewall-cmd --zone=public --permanent --add-port=4369/tcp --add-port=25672/tcp --add-port=5671-5672/tcp --add-port=15672/tcp  --add-port=61613-61614/tcp --add-port=1883/tcp --add-port=8883/tcp
sudo firewall-cmd --reload

Start the RabbitMQ server and enable it to start on system boot:

sudo systemctl start rabbitmq-server.service
sudo systemctl enable rabbitmq-server.service

You can check the status of RabbitMQ with:

sudo rabbitmqctl status

Step 5: Enable and use the RabbitMQ management console

Enable the RabbitMQ management console so that you can monitor the RabbitMQ server processes from a web browser:

sudo rabbitmq-plugins enable rabbitmq_management
sudo chown -R rabbitmq:rabbitmq /var/lib/rabbitmq/

Next, you need to setup an administrator user account for accessing the RabbitMQ server management console. In the following commands, “mqadmin” is the administrator’s username, “mqadminpassword” is the password. Remember to replace them with your own ones.

sudo rabbitmqctl add_user mqadmin mqadminpassword
sudo rabbitmqctl set_user_tags mqadmin administrator
sudo rabbitmqctl set_permissions -p / mqadmin ".*" ".*" ".*"

Now, visit the following URL:

http://[your-vultr-server-IP]:15672/

Log in with the credentials you had specified earlier. You will be greeted with the RabbitMQ remote management console, where you can learn more about RabbitMQ. Enjoy!

 

 

http://www.rabbitmq.com/tutorials/tutorial-one-php.html

Install Composer on CentOS

First you have to go to the /tmp directory

cd /tmp

Download the composer.phar file

curl -sS https://getcomposer.org/installer | php

Move it to /usr/local/bin/

mv composer.phar /usr/local/bin/composer

Now you can to use the command composer globally.

CentOS xdebug php72

http://xdebug.org/install.php#configure-php
Debugger Configuration Validation with PhpStorm
on CentOS: 1. You need to install PHP’s devel package for PHP commands execution yum install php-devel yum install php-pear 2. Next install GCC and GCC C++ compilers to compile Xdebug extension yourself. yum install gcc gcc-c++ autoconf automake 3. Compile Xdebug pecl install Xdebug 4. Find the php.ini file using locate php.ini And add the following line [xdebug] zend_extension="/usr/lib64/php/modules/xdebug.so" xdebug.remote_enable = 1 5. Restart Apache service httpd restart 6. Test if it works – create test.php with the following code phpinfo()

 

 

PHP72

 

yum install --enablerepo=epel,remi-php72   php-devel
yum install --enablerepo=epel,remi-php72  php-pear
yum install gcc gcc-c++ autoconf automake

nano /etc/php.ini
в конце добавляем

[xdebug]
zend_extension="/usr/lib64/php/modules/xdebug.so"
xdebug.remote_enable = 1


 
 pecl install xdebug
sudo systemctl restart php-fpm

 

 

В файлe php.ini добавить раздел [xdebug] с требуемыми параметрами, вот что  содержится в моем файле:

[xdebug]
xdebug.default_enable=on
xdebug.remote_enable=on
xdebug.remote_autostart=on
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.idekey="netbeans-xdebug"
xdebug.remote_log="/tmp/xdebug_log.log"
xdebug.profiler_output_dir="/tmp"

 

 

В случае необходимости создать исключения для порта 9000:

 

semanage port -a -t http_port_t -p tcp 9000

Настраиваем NetBeans

  • Tools – Options – PHP
  • Вкладка General – для параметра PHP interpreter, указать /usr/bin/php, отметить параметры – Output Window, Web Browser
  • Вкладка Debugging – оставить все парамтры по умолчанию (Debugger – port 9000, Dession ID – netbeans-xdebug), убрать флажок с параметра Stop at First Line
  • В файл /usr/local/netbeans/etc/netbeans.conf добавить настройку параметра netbeans_default_options:

-J-Dorg.netbeans.modules.php.dbgp.level=400

 

 

SF 2 console if not work на самом сервере выполнить

export XDEBUG_CONFIG=”remote_host=192.168.80.254 idekey=PHPSTORM”
echo $XDEBUG_CONFIG

 

 

/etc/php/7.0/mods-available
sudo service php7.0-fpm restart
export XDEBUG_CONFIG=’remote_host=192.168.81.228 idekey=PHPSTORM’

export XDEBUG_CONFIG=’remote_host=localhost idekey=phpstorm’

Как настроить Xdebug в PhpStorm

https://freshnotes.org/2016/12/ustanovka-i-nastrojka-xdebug-phpstorm-v-ubuntu-16-04-elementary-os-0-4-loki-mint-18/

yum install

все нужные пакеты устанавливаются

yum --enablerepo=remi,remi-php72 install  **** название пакета *****

 

 

 

yum install gcc gcc-c++ autoconf automake

 

Next install GCC and GCC C++ compilers to compile Xdebug extension yourself.

yum install gcc gcc-c++ autoconf automake
yum --enablerepo=remi,remi-php72 install php-pecl-apcu php-cli php-pear \
 php-pdo php-mysqlnd php-pgsql php-pecl-mongodb php-pecl-memcache php-pecl-memcached \
 php-gd php-mbstring php-mcrypt php-xml

 

yum install curl-devel

 

ЭТО ПРОСТО ЗАМЕТА 

В CentOS,

Установите PHP Pear, если он еще не установлен:
# yum install php-pear

Установите GCC, если он еще не установлен:
# yum install gcc

Установите cURL, если он еще не установлен:
# yum install curl-devel

Установите следующую библиотеку, если она еще не установлена:
# yum install php-devel    # yum install zlib-devel    # yum install pcre-devel

Запустите основную установку:
# pecl install pecl_http

Добавьте следующую строку в файл /etc/php.ini расширение = raphf.so расширение = propro.so расширение = http.so
перезапустить сервер Apache, чтобы расширение можно было загрузить

 

в конце 

pecl install pecl_http

 

yum update
yum install php-devel gcc gcc-c++ autoconf automake
yum install php-pear
pecl install Xdebug
Then add the following line to the php.ini file:

zend_extension=/usr/lib64/php/modules/xdebug.so

https://sys-adm.in/os/nix/400-centos-install-xdebug-for-netbeans.html


http://xdebug.org/install.php#configure-php
Debugger Configuration Validation with PhpStorm
on CentOS: 1. You need to install PHP’s devel package for PHP commands execution yum install php-devel yum install php-pear 2. Next install GCC and GCC C++ compilers to compile Xdebug extension yourself. yum install gcc gcc-c++ autoconf automake 3. Compile Xdebug pecl install Xdebug 4. Find the php.ini file using locate php.ini And add the following line [xdebug] zend_extension="/usr/lib64/php/modules/xdebug.so" xdebug.remote_enable = 1 5. Restart Apache service httpd restart 6. Test if it works – create test.php with the following code <?php phpinfo() ?>

 

 

сервер

[root@vps-27610 ~]# history
    1  yum update
    2  yum install epel-release
    3  yum install nginx
    4  systemctl enable nginx
    5  systemctl start nginx
    6  rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
    7  yum install --enablerepo=epel,remi-php72 php php-mbstring
    8  yum install --enablerepo=epel,remi-php72  php-fpm
    9  systemctl start php-fpm
   10  systemctl enable php-fpm
   11  nano /etc/nginx/nginx.conf
   12  yum install nano
   13  yum install wget
   14  nano /etc/nginx/nginx.conf
   15  nginx -t
   16  systemctl restart nginx
   17  nano /etc/nginx/nginx.conf
   18  nano /usr/share/nginx/html/index.php
   19  yum install --enablerepo=epel,remi-php72   php-devel 
   20  yum install --enablerepo=epel,remi-php72  php-pear
   21  yum install gcc gcc-c++ autoconf automake
   22  nano /etc/php.ini
   23  sudo systemctl restart php-fpm
   24  pecl install xdebug
   25  sudo systemctl restart php-fpm
   26  nano /etc/php.ini
   27  sudo systemctl restart php-fpm
   28  nano /etc/php.d/15-xdebug.ini
   29  cd  /etc/php.d/
   30  ls
   31  nano /etc/php.d/15-xdebug.ini
   32  nano /etc/php.ini
   33  sudo systemctl restart php-fpm
   34  history
[root@vps-27610 ~]#

GIT

You can use WANDisco's CentOS repository to install Git 2.x: for CentOS 6, for CentOS 7

Install WANDisco repo package:

yum install http://opensource.wandisco.com/centos/6/git/x86_64/wandisco-git-release-6-1.noarch.rpm
- or -
yum install http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-1.noarch.rpm
- or -
yum install http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm
Install the latest version of Git 2.x:

yum install git
Verify the version of Git that was installed:

git --version