UNIX for Web Hosting
Due to their stability, security, and efficiency, many web servers run on UNIX-based operating systems such as Linux. Mastering basic tools and protocols used in UNIX environments is essential for web administrators and developers.
Popular UNIX Web Hosting Tools
- Apache & Nginx: Powerful and widely-used web servers.
- SSH (Secure Shell): Secure command-line access to remote servers.
- FTP & SFTP: Used to upload/download files between local machines and remote UNIX servers.
File Permissions & Security
UNIX uses a permissions system to control access to files and directories. Permissions include:
- r – read
- w – write
- x – execute
Permissions are set for three user types: owner, group, and others.
Example: chmod 755 index.html
— gives full permissions to the owner, and read/execute to group and others.
Use ls -l
to view permissions. Modify ownership with chown
.
SFTP & FTP Use
FTP (File Transfer Protocol) and SFTP (Secure FTP) are tools for uploading/downloading files between machines. SFTP is encrypted and recommended for secure transfers.
Example: Using SFTP from Terminal
sftp username@yourserver.com
cd /var/www/html
put index.html
get logs.txt
exit
Example: FTP Command-Line
ftp yourserver.com
Username: youruser
Password: ••••••
cd /public_html
put image.png
bye
Graphical clients like FileZilla can also simplify the process of SFTP and FTP file transfers.
SSH & Remote Access
SSH (Secure Shell) is used to log into a remote server securely and perform terminal-based tasks.
Example: ssh user@yourserver.com
Once logged in, you can deploy websites, manage files, and even run services directly from your UNIX shell.
SSH keys can be set up to enhance security and avoid entering your password each time.