, , , , , ,

The Web Developer Job Search

I decided to investigate the idea of working for an established web development / web hosting company. Having created an account at Indeed.com (which I prefer over alternatives such as GlassDoor and ZipRecruiter), I have been researching available web development gigs with some success!

I wanted to share with you 10 questions which were presented to me in an email as part of an evaluation, pre-interview. Perhaps understanding that these are potential questions that you might be presented with in your own search for employment, you might like to study or refresh your memory on these topics.

I present to you the 10 questions, and my responses to them:

1. How would you manually migrate a WordPress website? Do note that on your server you have full SSH access and the source server is a typical shared cPanel hosting.
Backup database and files from server1. I could use cPanelโ€™s integrated backup utility, but I will do this manually. I will use SFTP to upload the files to server2. I will import the resulting database SQL backup file to server2, ideally using software like phpMyAdmin. I could use SSH (e.g. Putty) to administer the MySQL server if phpMyAdmin is not available. After database is imported and files are uploaded, I will log in to ./wp-admin to ensure functionality.
2. Unfortunately, after the migration, it seems that some folders have passed with wrong ownership. Our user:group is www- data:www-data. What actions should be taken?
I can use SSH (or hosting admin interface like cPanel) to execute the following command:
>$ chown -R www-data:www-data /home/site/public_html/folder
3. A website seems to be down, server resources are high and the website is most likely infected. How would you identify if itโ€™s an infection and possible ways of clearing it up?
Place the website in Maintenance mode (if thatโ€™s an option). Some hosting admin software such as cPanel– and WordPress itself– have tools (e.g. WordFence) to scan for potentially corrupt files — initiate a scan if available. If itโ€™s a CMS site, ensure that all plugins and themes are up to date. Check error logs to identify problems.
4. The obvious answer between HTTP and HTTPS is HTTPS. But what would be needed in terms of files and data to install a certificate on a server?
Assuming I have Apache and OpenSSL: I will generate a CSR on the production server as is required to generate a private key. Create a key pair from the command line (SSH).
$> openssl genrsa โ€“des3 โ€“out www.mydomain.com.key 2048

Create a password and generate an SSL Certificate Signing Request (CSR) with a command like the following:

$> openssl req โ€“new โ€“key www.mydomain.com.key โ€“out www.mydomain.com.csr

Finally, generate the CSR file:
$> openssl req -noout -text -in www.mydomain.com.csr

An SSL certificate must then be ordered using the CSR file. The certificate data should be saved as text in a .CRT file. E.g.

-----BEGIN CERTIFICATE-----

Cert data here (text characters)

-----END CERTIFICATE-----


Finally, upload the files to the designated SSL folder on the production server. Ensure the proper file path references are added to the Apache httpd.conf file and restart Apache.
5. A website returns an error of PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 139264 bytes) in /var/web/site/public_html/wp-includes/functions.php on line 4552 . What would this error mean and how could it be resolved?
This is a fairly common error with WordPress. Many users reported problems after WP v5.6. The recommended fix is to add the following line to the ./public_html/wp-config.php file:

define( 'WP_MEMORY_LIMIT', '256M' );
6. A website has some old pages – /contact-us-now/, /about-me/ , /portfolio.html. Since they donโ€™t exist anymore, they would have to be redirected to the main domain of mysite.com. Give us an example of how this would be possible while using NGINX.
Since NGINX ignores rules in .htaccess files, it will be necessary to add the redirect information in a .conf file on the server. The code to add to the whatever.conf file should resemble the following:

302 Temporary Redirect:

server {
# 302 Temporary redirect
rewrite ^/oldpage$ http://www.domain.com/newpage redirect;
}


301 Permanent Redirect:

server {
# 301 Permanent redirect
rewrite ^/oldpage$ http://www.domain.com/newpage permanent; }


The server must be restarted after the lines have been added to the .conf file(s).
7. A customer requests that some of his folders & files require 777 permissions. How would you handle this?
This is generally most easily accomplished from the command line, which should look like the following for a recursive operation performed on a folder:

$> chmod -R 777 ./target-directory

If the operation is to apply to a single file (or folder without the -R recursive flag), the command would be:

$> chmod 777 ./filename.php
8. What ports are mainly used for HTTP, HTTPS, SMTP, FTP, SFTP & SSH?
HTTP - :80
HTTPS - :443
SMTP - :25
FTP - :21
SFTP - :22
SSH - :22
9. How would you check Memory & CPU statistics & identify the top 5 processes utilizing them?
From SSH, i could execute the following commands to identify the intensive processes:

$> ps aux --sort -%mem
$> ps aux --sort -%cpu
10. What is the difference between RAM & SWAP?
Swap space (generally a term used in the Linux OS context) is used when the amount of physical memory (RAM) is full. If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space. Swap space is usually a separate partition on the hard drive. It is most desirable to have RAM (physical memory) available, as data access from Swap will be slower.

Whatchu do


Leave a Reply

Your email address will not be published. Required fields are marked *