0

I'm a newbie with Magento 2 so please bear with me.

I've been trying to make the cron run. First, I tried to Create a Password File. I was able to create the directory, but whenever I ran the command to create the password it says:

htpasswd command not found

As a workaround, I manually created the password file with the help of this site.

Question A: Why can't it find htpasswd command?

Question B: Is it the same if I used the manual method?

Question C: What should be the file name/extension? .htpasswd or just password?

--

Second, I modified the .htaccess file inside pub folder with the code below so I can run the pub/cron.php file on browser but it's not working.

<Files cron.php>
 AuthType Basic
 AuthName "Cron Authentication"
 AuthUserFile /home/floweraddict123/public_html/fa-private/password/.htpasswd
 Require valid-user
</Files>

Question D: What's wrong with my .htaccess code?

Since it wasn't working, I removed the .htaccess restriction first, then run that file again on browser (twice as suggested on Magento user guide) and I got a blank page both times. I looked in my database and there was a cron_schedule table with the values of today's date, so I guess it worked. I already put back the restriction, but I think the cron is still not properly setup. I guess if I get the answers above then I can try this part again.

Question E: Is it just supposed to be blank?

--

Lastly, I tried to check my existing crontab with this code:

crontab -u <Magento file system owner name> -l

Question F: Is the file system owner (a user with root privileges) name same as my cPanel username?

We're hosted on GoDaddy, if that helps.

Apologies for the loads of questions, but looking forward to the replies.

Thank you!

0

A: Most likely you didn't have apache2-utils installed on your remote server. You can install it by this command:

sudo apt-get install apache2-utils

Ref: https://askubuntu.com/questions/378965/htpasswd-executable-is-missing

B: Same, no differences

C: Up to you, but I usually use .htpasswd as it can be hidden on normal ls command.

D: Please make sure .htpasswd is inside the folder specified on AuthUserFile

E: If you see sth, it means errors happens. If you see blank page, it means the cron.php runs properly. Of course, you've to grant the necessary rights.

F: Unlikely. You can check the user list by this command:

cat /etc/passwd | cut -d: -f1

Ref: http://www.tech-faq.com/how-to-list-unix-users.html

P.S: I usually run cron.php via crontab, this method is new for me ;-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.