Skip to content

Server Structure

/ <- Root of everything
|-- home/ <- User home directories (like Users/ on Mac)
| |-- ubuntu/ <- Your personal space when you SSH in
| +-- otheruser/
|
|-- var/ <- "Variable" data - things that change during operation
| |-- www/ <- Web server files (convention, not required)
| |-- log/ <- System logs
| +-- mail/ <- Email storage
|
|-- etc/ <- Configuration files
| |-- nginx/ <- Nginx config
| +-- ssh/ <- SSH server config
|
|-- usr/ <- User programs (installed software)
| |-- bin/ <- Commands like git, php, etc.
| +-- lib/ <- Libraries
|
|-- bin/ <- Essential commands (ls, cp, etc.)
|-- root/ <- Root user's home directory (admin)
|-- tmp/ <- Temporary files
+-- opt/ <- Optional/third-party software
  • var = “variable” - data that changes frequently (as opposed to system files)
  • Web content changes often (uploads, edits, etc.), so it lives in /var
  • /var/www/ is a convention that web servers (Apache, Nginx) use by default
  • You could technically put websites anywhere, but this is the standard
/home/ubuntu//var/www/sftp/app/
Your personal workspaceWhere the website actually runs
Only you can accessWeb server (Nginx) serves this to the internet
Put scripts, tools, personal projects herePut website files here
Not publicly accessiblePublicly accessible via HTTP

/
|-- home/
| +-- ubuntu/ <- Where you land when you SSH in
| |-- my-websocket-app/ <- Node.js WebSocket app
| |-- twilio-caller/ <- Twilio integration
| |-- native-websocket/
| +-- whisper-env/ <- AI/transcription related
|
|-- var/
| +-- www/
| |-- html/ <- Default Nginx page (mostly unused)
| |-- sftp/ <- Our actual websites live here
| | |-- app/ <- Main PHP app (My Marketing Pro)
| | |-- wordpress/ <- Main WordPress site
| | |-- wordpress-mylabelteam.com/
| | |-- wordpress-mylawyeradvertising.com/
| | |-- wordpress-myprospectingpro.com/
| | |-- wordpress-myrealtimeoffers.com/
| | |-- wordpress-themycoinc.com/
| | |-- wordpress-marketingmenus.com/
| | |-- wordpress-mygigpromoter.com/
| | |-- acellemail/ <- Email marketing software
| | +-- events/
| +-- sftp.tar.gz <- 2GB backup file
|
|-- etc/ <- Configs (Nginx, PHP, MySQL, etc.)
|-- nfs/ <- Network File System (shared storage)
|-- opt/ <- Third-party software
|-- tmp/ <- Temporary files
+-- root/ <- Root user's home (not same as /)

This is the My Marketing Pro PHP application. Key directories and files:

/var/www/sftp/app/
|-- admin/ <- Admin panel files
|-- ajax/ <- AJAX handlers
|-- api/ <- API endpoints
|-- app-functions/ <- Shared PHP functions
|-- app-dashboard.php <- Main dashboard
|-- app-crm-full.php <- CRM functionality
|-- app-auth.php <- Authentication
|-- admin-dashboard.php <- Admin dashboard
+-- ... <- Many more PHP files

OwnerMeaning
rootSystem files, requires sudo to modify
www-dataWeb server user (Nginx/PHP runs as this)
sftpFiles uploaded via SFTP by coworker
ubuntuYour user account

Terminal window
# SSH into server (manage server)
ssh mymarketingpro
# Or directly
ssh -i ~/.ssh/mymarketingpro ubuntu@18.218.4.234
Terminal window
# SFTP into server (file access)
sftp mymarketingpro

  • Disk Usage: Server is 86% full (41GB of 48GB). Monitor this.
  • Backup file: /var/www/sftp.tar.gz is 2GB - can be deleted if not needed
  • Git: Version 2.43.0 is installed on the server

BranchPurpose
mainYour changes (dev team) - deploy from here
productionCoworker’s FTP changes - auto-committed every 15 min
Coworker (FTP) ──► Production Server ──► Cron auto-commits to `production` branch
GitHub `production` branch
You review changes via PR
You (local dev) ──► Push to `main` ◄─── Merge approved changes
Deploy: ssh + git pull on server
Terminal window
# 1. Check for coworker's changes
# Go to: https://github.com/my-marketing-pro/mmp-webapp/compare/main...production
# 2. If there are changes you want, create a PR to merge production → main
# 3. Work on your changes locally
git checkout main
# ... make edits ...
git add .
git commit -m "Your changes"
git push
# 4. Deploy your changes to production server
ssh mymarketingpro "cd /var/www/sftp/app && sudo git checkout main && sudo git pull"
  • Runs every 15 minutes (at :00, :15, :30, :45)
  • Script location: /usr/local/bin/auto-commit-mmp.sh
  • Log file: /var/log/auto-commit.log
  • Commits to: production branch
Terminal window
# To deploy main branch changes to production:
ssh mymarketingpro "cd /var/www/sftp/app && sudo git stash && sudo git checkout main && sudo git pull && sudo git stash pop"

To see what your coworker changed via FTP: