change access folder for user on vsftp centos

Friday,March, 16, 2018 Leave a comment

usermod -d /usr/share/nginx/html/ username

 

http://rao5s.vn

Categories: Uncategorized

Issue SSL Certificates for Apache Using Certbot on CentOS 7

Wednesday,March, 7, 2018 Leave a comment

Introduction

Certbot is an automated SSL Certificate issuer for the Let’s Encrypt Certificate Authority. It was developed as a client for Let’s Encrypt and will also work with any other CAs that support the ACME protocol.

In this tutorial, we will cover the process of installing Certbot on CentOS 7 running Apache and configure it to issue and and renew Let’s Encrypt SSL Certificates.

Prerequisites

  • A CentOS 7 Server
  • A functional Apache webserver
  • mod_ssl

Installation

Certbot is available on the EPEL Yum Repository. If you do not have EPEL installed already, you can install it using the command below:

# yum -y install epel-release mod_ssl openssl

Next, we will need to install Certbot and its Apache plugin

# yum -y install certbot python-certbot-apache

Run Certbot:

# certbot --apache

To avoid errors, please ensure that your virtual host is already setup for the domain you wish to the the SSL Certificate for and that DNS is properly configured.

Configuration

Once you run the Certbot Apache Plugin, an installation wizard will appear. The configurable options include:

  • Select domains you wish to issue a certificate for (Note: http://www.example.com and example.com will be issued separate SSL Certificates).
  • SSL Enforcement Options.

Auto-Renewal

Let’s Encrypt certificates expire after 90 days. Certbot can handle automated renewals with ease.

# certbot renew --dry-run

# certbot renew --quiet

This concludes our tutorial. Thank you for reading.

 

(note for me)

Categories: Uncategorized

Install php56 and common extensions on Centos 7

Monday,March, 5, 2018 Leave a comment

yum install epel-release

rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

yum-config-manager –enable remi-php56

yum install php-mysql php-devel php-gd php-pecl-memcache php-pspell php-snmp php-xmlrpc php-xml php-mcrypt php-imap php-mailparse

Categories: Uncategorized

Error: 500 OOPS: vsftpd: refusing to run with writable root inside chroot()

Saturday,January, 13, 2018 Leave a comment

(note for me)

This error may occur when attempting to connect to a vsftpd FTP server that is configured to jail (prevent from accessing other directories) each FTP user. It is best practice to create Linux users specifically for FTP, that can’t login via SSH. For example, if you wanted to remove SSH access for testuser, then you’d use the following command:

usermod -s /sbin/nologin testuser

However, that won’t address the problem listed in the error. To do that, you must make the user’s home directory read only. Assuming the username is testuserand the home directory is /home/testuser, then execute the following command:

chmod a-w /home/testuser

For good measure, be sure to restart vsftpd:

systemctl restart vsftpd

Alternative Fix

Alternatively, you can bypass the writable check in the vsftpd config file by running the following two commands:

echo 'allow_writeable_chroot=YES' >> /etc/vsftpd/vsftpd.conf

systemctl restart vsftpd

 

http://rao5s.vn

Categories: Uncategorized

MAC Sierra Change PHP Installation

Saturday,September, 30, 2017 Leave a comment

Note for me.

 

Instructions to Change PHP Installation


First, Lets find out what version of PHP we’re running (To find out if it’s the default version).

To do that, Within the terminal, Fire this command:

which php

This should output the path to the default PHP install which comes preinstalled by Mac OS X, by default it has to be (Assuming you’ve not changed it before):

/usr/bin/php

Now, We just need to swap this over to the PHP that is installed with MAMP, which is located at /Applications/MAMP/bin/php/php5.4.10/bin (MAMP 2.1.3)

To do this, We need to edit the .bash_profile and add the MAMP version of PHP to the PATH variable.

Follow these simple steps:


  1. Within the Terminal, run vim ~/.bash_profile
  2. Type i and then paste the following at the top of the file:
     export PATH=/Applications/MAMP/bin/php/php5.4.10/bin:$PATH
    
  3. Hit ESC, Type :wq, and hit Enter
  4. In Terminal, run source ~/.bash_profile
  5. In Terminal, type in which php again and look for the updated string. If everything was successful, It should output the new path to MAMP PHP install.
  6. In case it doesn’t output the correct path, try closing the terminal window (exit fully) and open again, it should apply the changes (Restart in short).

http://rao5s.vn

Categories: Uncategorized

IIS 7 – How To Resolve Error HTTPs 413: Request Entity Too Large

Friday,September, 22, 2017 Leave a comment
  1. Launch “Internet Information Services (IIS) Manager”
  2. Select the site that you are hosting your web application under it.
  3. In the Features section, double click “Configuration Editor”
  4. Under “Section” select: system.webServer  then serverRuntime
  5. Modify the “uploadReadAheadSize” section to be like 20MB (the value there is in Bytes)
  6. Click Apply

http://rao5s.vn

Categories: Uncategorized

Set proxy for git and fix error ssl verify

Tuesday,September, 19, 2017 Leave a comment
git config --global http.proxy http://xxx
git config --global https.proxy https://xxxx

git config --global http.sslVerify false

http://rao5s.vn
Categories: Uncategorized

Note- LEMP – Linux/Nginx/Mysql/PHP

Saturday,September, 16, 2017 Leave a comment

uninstall all the packages install through Homebrew.

brew remove --force $(brew list) --ignore-dependencies  

To remove unused archives run.

brew cleanup  

How to update PHP on Mac OsX

As we want to update the built-in version of PHP of our Mac OsX, at this point maybe its better to think at a more valuable solution.

Update PHP… go to php.net/downloads.php, download the latest version of PHP, unzip, compile, configure… Mmm, there is a better solution for sure!

And in fact, those good boys at Liip have thought that there should be a better solution… And they built it!

So, in your Terminal, type (use 7.1 if you want to install the last PHP 7.1 version!):

$ curl -s http://php-osx.liip.ch/install.sh | bash -s 5.6

You have just downloaded the best PHP latest version you can find ever.

Now, let’s configure it: it needs less then 5 minutes!

How to configure your updated version of Mac OsX built-in PHP

The package you have just downloaded is a custom version of PHP built by Liip and it provides a lot more functionalities and useful PHP extension than the original Mac OsX built-in PHP, so you will save a lot of time when you’ll install and update them (think at Intl extension or xDebug, for example).

Once downloaded, the Liip’s PHP moves all the files into /usr/local/php5-5.6.11-20150710-223902/bin and makes a symlink of this folder called php5. In this way, when you’ll update PHP, Apache will automatically load the new PHP version (see more about this in a moment). Really smart!

If you type in Terminal again which php you’ll get the same result as before. This is because we have to tell our Mac OsX to load PHP from the new location.

To do this we will create a .bash_profile in our user directory:

$ sudo vi ~/.bash_profile

This will open VIM that will create the new file (if it is already present, type the letter a to enter the edit mode).

Into the .bash_file write the line export PATH=/usr/local/php5/bin:$PATH, then press Esc and type SHIFT + Z for two times (a shortcut to save and close the file).

Then load again the .bash_profile file and restart Apache:

$ source ~/.bash_profile
$ sudo apachectl restart
$ which php
/usr/local/php5/bin/php

You have updated your Mac OsX built-in PHP.

On the Liip’s PHP Mac OsX home page you will find a lot of useful information about your new PHP.

The next step you should do is open the php.ini located at /usr/local/php5/lib/ and set it the right way.

And, once you have configure your php.ini, maybe you want to configure your Mac Osx built-in Apacheor want to install MySQL in your Mac (as it is not shipped by default).

Categories: Uncategorized

IIS error not load css/javascript/fonts(staticContent) – error 404/500/…

Wednesday,August, 9, 2017 Leave a comment
If your website on IIS can not load static content(css/js/fonts..).
Please add the config as below into web.config
and then restar
 <staticContent>
      <remove fileExtension=".woff" />
      <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
      <remove fileExtension=".woff2" />
      <mimeMap fileExtension=".woff2" mimeType="application/x-font-woff" />
      <remove fileExtension=".css" />
      <mimeMap fileExtension=".css" mimeType="text/css; charset=UTF-8" />
      <remove fileExtension=".js" />
      <mimeMap fileExtension=".js" mimeType="text/javascript; charset=UTF-8" />
    </staticContent>
Categories: Uncategorized

Visual Studio Code – auto reveal

Monday,August, 7, 2017 Leave a comment
If you want to VSC not automatically reveal when open files.
You can setting as below:
(1). Open Visual Studio Code
(2). Go to menu File -> Preferences -> Settings -> File Explorer
// Controls if the explorer should automatically reveal and select files when opening them.
“explorer.autoReveal”: true,
(3). Setting it become false
“explorer.autoReveal”: false,
(4). Restart VSC
Categories: Uncategorized