Author: sandbox

How to fix Ubuntu/Linux Error: I have no name!@

When I was doing some tests on the new servers that will be running the code for WPMove.org – free WordPress migration service some weird error messages started showing up: Ubuntu Error: I have no name!@ sudo: unable to stat /etc/sudoers: Permission denied sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin bash: /etc/bash.bashrc: Permission denied This was interesting and annoying at the same time. I have using linux for a long time and haven’t seen this message. Actually, I did some restoring but then thought that something may have been broken or not good with the OS so I reinstalled the operation system (Ubuntu). It turned out that some piece of code creates folders if they don’t exist but set’s permissions to 0770. The server configurator has modified the /etc folder’s permissions to 0770 and this blocks access to /etc/passwd , /etc/sudoers and many more.   Solution chmod 0755 /etc Related https://superuser.com/questions/589036/how-to-get-rid-of-i-have-no-name/589138 https://apple.stackexchange.com/questions/43940/when-i-open-terminal-i-get-an-i-have-no-name-prompt...

Read More

How to Generate a Free SSL Certificate using Let’s Encrypt

If you have your own dedicated or virtual server you most likely have an administrative access which is awesome & dangerous all at the same time. We’ll use a service called Let’s Encrypt to generate the SSL certificate for a selected domain. There are several things to keep in mind. The Let’s Encrypt certificates are free Let’s Encrypt certificates expire in 90 days You will get a notification when the certificate is due for renewal (the email is supplied when you request the SSL request). It’s good to use –dry-run initially because if there are too many errors Let’s...

Read More

How to Automatically Renew an SSL Certificate Issued by Let’s Encrypt

If you have followed the steps in the How to Generate a Free SSL Certificate using Let’s Encrypt article this is the next logical step. To renew an SSL from issued by Let’s Encrypt you need to schedule a task that runs regularly. This can be achieved using Linux’ cron service. Login as root and type crontab -e   An editor will pop up and you can pick Pico or other editor. If VIM editor options up press G (it’s the capital letter) and then o This will switch the editor to edit mode. Paste the following line. It should...

Read More

How to Install/Setup SSL Certificate to a Virtual Host in Apache

First you need to have the SSL certificate generated. Normally the steps are Generate CSR (certificate request) Send it to a company that you’ll buy the SSL from Install it. If you have used or want  to use Let’s Encrypt SSL certificates here are the lines that are needed. To install the SSL add these to the virtual host and then test the config & ask apache to reload its config file(s) SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem SSLCertificateChainFile /etc/letsencrypt/live/example.com/fullchain.pem   The final virtual conf file would look like this. [code] ############################################################################# # /etc/apache2/sites-enabled/example.com.conf # example.com ServerAdmin admin@example.com DocumentRoot /var/www/vhosts/example.com/htdocs ServerName example.com ServerAlias www.example.com #LogLevel debug RewriteEngine On ErrorLog /var/www/vhosts/example.com/logs/error.log CustomLog /var/www/vhosts/example.com/logs/common.log common Allow from all #/etc/apache2/ssl SSLEngine on SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem SSLCertificateChainFile /etc/letsencrypt/live/example.com/fullchain.pem # Intermediate configuration, tweak to your needs SSLProtocol all -SSLv2 -SSLv3 SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA SSLHonorCipherOrder on #SSLCompression off ####################################################################### [/code] The next step is to test if apache configuration syntax is OK. apachectl configtest If you don’t see any errors it’s time to reload apache’s configuration. service apache2 reload   If you see errors you may have to enable the mod_ssl module by doing this: a2enmod ssl   Check the output and apache will show you if you need to reload the configuration or if you need to restart apache server.   service apache2 reload or service apache2 restart   I recommend that you always try with reloading...

Read More