toggle menu

How to setup FTP account on digital ocea?

Dhananjay Kumar |01 Feb at 11:02

I have problem with setup digital ocean on FTP account, please advice.

  • 0 like
  • 1 comment

Dhananjay Kumar01 Feb at 12:02

Hello ,

I have got the solution, Follow the below Steps :

1) Install ufw and run below commands :
a) apt update
b) apt install ufw
c) ufw allow OpenSSH
d) ufw enable /// check status with command : ufw status
e) sudo ufw allow 20/tcp
sudo ufw allow 21/tcp
sudo ufw allow 990/tcp
sudo ufw allow 40000:50000/tcp

2) Install vsftpd
a) sudo apt-get install vsftpd

b) sudo nano /etc/vsftpd.conf

Add /edit below text
# Allow anonymous FTP? (Disabled by default).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
local_enable=YES
write_enable=YES

# Prevent the FTP-connected user from accessing any files or commands outside
# the directory tree
chroot_local_user=YES

# Add a user_sub_token in order to insert the username in our local_root directory
# path so our configuration will work for this user and any future users that might
# be added

user_sub_token=$USER
local_root=/var/www/ftp

# Set up the configuration so that access is given to a user only when they
# are explicitly added to a list rather than by default
userlist_enable=YES
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO

sudo chown nobody:nogroup /var/www/ftp
sudo chmod a-w /var/www/ftp
sudo chown ftpuser:ftpuser /var/www/ftp/myApplication

sudo systemctl restart vsftpd

Also must added :

HTTP on port 80, which is what unencrypted web servers use, using sudo ufw allow http or sudo ufw allow 80
HTTPS on port 443, which is what encrypted web servers use, using sudo ufw allow https or sudo ufw allow 443
FTP on port 21, which is used for unencrypted file transfers (which you probably shouldn't use anyway), using sudo ufw allow ftp or sudo ufw allow 21/tcp

Install CURL on PHP7.0 on LEMP server DigitalOcean?

Dhananjay Kumar |13 Aug at 11:08

Behave simply change below In command line and its working fine.

sudo apt-get install php7.0-curl

sudo systemctl restart php7.0-fpm

Please try.
Thanks

  • 1 like
  • 1 comment

Dhananjay Kumar04 Oct at 07:10

New updates come with :
sudo apt-get install php7.2-curl

Actually, you need to see what the version of PHP you installed here "/etc/php/"

We have find the solution with below steps:
Go with Access Command prompt
Run:

# sudo mysql

mysql > GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost';

mysql> exit;

 

And  For specified database:

GRANT ALL ON databasename TO 'username'@'localhost';

Hope help you lots.

 

 

 

  • 1 like
  • 0 comment

502 Bad Gateway nginx error

Dhananjay Kumar |04 Oct at 08:10

After creating new server LEMP on digital ocean getting below error, please any one heplon this.

502 Bad Gateway

 


nginx

  • 1 like
  • 2 comments

Dhananjay Kumar04 Oct at 10:10

I got the solution:
if you have on nginx server then go with error log here:
/var/log/nginx/error.log

in the log file, you seem proper issues.
Like i have issues with "fastcgi://unix:/run/php/php7.0-fpm.sock:"
just chage with new version php7.2 and working fine.

immwit work12 Dec at 01:12

don't know

nxn

Immwit work |12 Dec at 01:12

nxnx

  • 0 like
  • 0 comment

PHP mail() function not working on digitalocean

Sanjay Kumar |29 Mar at 04:03

I have installed Postfix as per suggestion (on DigitalOcean) for PHP mail(), But its not working.
i have just create droplet and setup LEMP and all postfix steps executed without any issues, but not working mail.
$to      = 'youremail@email.com';
$subject = 'mail subject';
$message = 'Mail Body';
$headers = 'From: info@email.com' . "\r\n" .
   'X-Mailer: PHP/' . phpversion();

if(mail($to, $subject, $message, $headers)){
    echo "done";
}else{
    echo "not sent";
}
?>

Run with ip address like (dummy ip) : http://122.21.23.21/emailfile.php
executed url and seems mail sent. But not getting mail.

Pleae any one have idea about this please suggest.

  • 2 likes
  • 4 comments

Dhanavi07 Apr at 08:04

Maybe, mail is going to spam.

vibhu09 Apr at 08:04

how to fix

vibhu09 Apr at 08:04

how to fix

vibhu09 Apr at 08:04

how to fix

Postfix install for the send only mail on LEMP

Dhananjay Kumar |10 Apr at 05:04

Hi All,

I have installed postfix on the LEMP server for the SMTP send only mail.

And its working fine, but mail going always in spam.

I want a solution to mail going to inbox directly. please suggest

  • 1 like
  • 0 comment

SSL installed successfully but getting issues

Dhananjay Kumar |30 Mar at 04:03

I have installed SSL on Nginx server on DigitalOcean and seems in a browser secure connection activated.

But when i check my SSL with SSL checker getting below issues:

"The certificate is not trusted in all web browsers. You may need to install an Intermediate/chain certificate to link it to a trusted root certificate."

Anyone can suggest about this.

  • 1 like
  • 0 comment

Issues with SSL integration on DigitalOcean Server

Dhananjay Kumar |27 Mar at 01:03

I have purchased ssl from ipower and getting certificate and prive key, but as per the suggestion we have changed in /etc/nginx/site-enable in defualt page the below things :

server {

    listen 80;
    listen [::]:80;
      
    listen 443 ssl;
    listen [::]:443;
   
    root /var/www/abc.com;

    index index.php index.html index.htm index.nginx-debian.html;

    server_name abc.com www.abc.com;
   
    ssl_certificate /etc/nginx/ssl/abc.com.crt;
    ssl_certificate_key /etc/nginx/ssl/abc.com.key;
   

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location = /favicon.ico { log_not_found off; access_log off; }
    location = /robots.txt { log_not_found off; access_log off; allow all; }
    location ~*  \.(jpg|jpeg|png|gif|ico|css|js)$ {
        expires 365d;
    }
   
    location ~*  \.(pdf)$ {
        expires 30d;
    }
   
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }
    location ~ /\.ht {
        deny all;
    }   

}

 

Please any one hepl with the steps for setup ssl on digital ocean.

  • 1 like
  • 2 comments

Rajesh Kumar28 Mar at 04:03

I have reviewed your server configer script, it seems it configured very well. there may be issue with the .crt and .key files of content format.
i have getting the same issues with ssl integration on digital ocean sever in nginx.

i was just added new line in below format:

------BEGIN CERTIFICATE-----
XXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXX
-----END CERTIFICATE-----

i was getting such issues with the simply copy and paste certificate and key inside the files. After formatting like above then its work.

Please once try

Dhananjay Kumar28 Mar at 06:03

Thanks for the suggestion, we have done the same way and it's working.
Really thanks for your support..

i have getting issues with ssl integration on digitalocen server, any one can suggest.

when sudo nginx -t run run :


SSL: error:0906D06c:PEM routines:PEM_read_bio:no start line:Expecting: TRUSTED CERTIFICATE
PEM_read_bio:no start line:Expecting: TRUSTED CERTIFICATE on digital ocean nginx
Nginx [emerg] PEM_read_bio_X509_AUX("/etc/nginx/ssl/adb.com.crt")

  • 1 like
  • 2 comments

Dhananjay Kumar28 Mar at 08:03

We have already tried with :
ssl on;
ssl_certificate /etc/nginx/ssl/abc.com.crt;
ssl_certificate_key /etc/nginx/ssl/abc.com.key;
ssl_dhparam /etc/nginx/ssl/abc.pem;

Dhananjay Kumar28 Mar at 06:03

yes i was just try with formate in certificate and private key files and its working
Like below :
------BEGIN CERTIFICATE-----
SFSDFSDFSDFSDFSDFSD SDXXXXX
XXXXXXXXSDFSDFSDXXXXXXXXXXX
SA21DDASDSA323CDSSADASDASS
GFHFGHF23423SDFSDFSDF1234SD
KTUY23DSFSDFDSFDSFSDFSDFSDA
1SDFSDFSDF DSF SDFS DFDSDSFSD
5SDFSDFSDFSDFSDFS
-----END CERTIFICATE-----