MyWeb Tutorials
- MyWeb Tutorials: Login to MyWeb
- MyWeb Tutorials: File Manager & HTML page
- MyWeb Tutorials: Database Creation
- MyWeb Tutorials: Create PHP/DB application
- MyWeb Tutorials: Git (Version Control)
- MyWeb Tutorials: Connect to DB remotely
MyWeb Tutorials: Login to MyWeb
DirectAdmin is a web-based hosting control panel that allows you to manage your website files, databases, and basic site settings through a browser.
At the School of Computer Science, we use DirectAdmin under the name MyWeb to provide students with personal web hosting space.
-
Login to MyWeb using your UWINID and password:
https://www.myweb.cs.uwindsor.ca -
If You cannot Log In
You must activate or re-sync your password using the CS authentication portal:
MyWeb Tutorials: File Manager & HTML page
In this tutorial, we will create a simple HTML page and navigate through the website's files.
Accessing the File Manager
- Log in to MyWeb (DirectAdmin)
- From the main dashboard, click File Manager
- You will see a directory tree showing files and folders associated with your account
Understanding the File Structure
Your account contains several folders. The most important ones are:
📁 public_html (Most Important)
- This is the web root
- Any file placed here is accessible through your website
- Example:
- public_html/index.html → https://yourusername.myweb.cs.uwindsor.ca
This is where your website files go
📁 public_ftp
- Used for FTP access
- Typically not used unless you connect using an FTP client
- Does not automatically publish files to the web
📁 Other folders you may see
- logs – Website access/error logs
- domains – Used when multiple domains/subdomains exist
- System folders – Should not be modified
Do not delete folders unless instructed
Creating or Uploading Files
Inside public_html, you can:
- Upload files (HTML, PHP, images, CSS, JS)
- Create new files
- Create subfolders (e.g., images, css, js)
Example structure:
public_html/
├── index.html
├── about.html
├── css/
│ └── style.css
├── images/
│ └── logo.png
Website Entry (Starting) Files
When someone visits your website, the web server looks for default index files.
Common starting files:
- index.html
- index.php
If both index.html and index.php exist, index.html will win and load first
When to Use HTML vs PHP
Use HTML (.html) when:
- Your site is static
- No database or server logic is needed
- You are learning basic web structure
Use PHP (.php) when:
- You need server-side logic
- You connect to a database
- You process forms or user input
Quick Tips & Common Mistakes
✔ Always place website files in public_html
✔ File names are case-sensitive (Index.html ≠ index.html)
✔ One index file per folder is enough
❌ Don’t delete system folders
❌ Don’t expect files outside public_html to be public
Create Your first HTML page
- From "File Manager", go to "public_html"
- Optional: backup your current index.html file (rename it to index.html-backup)
- Create a new file index.html
- Right-click on the newly created index.html file and select "Edit"
- In the new page, place your code, or optionally, copy the following code:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Your Name - Personal Site</title> <!-- You can add CSS styling here or link an external CSS file --> <style> body { font-family: sans-serif; margin: 40px; line-height: 1.6; } h1 { color: #333; } p { color: #666; } </style> </head> <body> <h1>Hello, I'm [Your Name]</h1> <p>Welcome to my personal website!</p> <p>I am a student at School of Computer Science at the University of Windsor, and you can learn more about me on this page.</p> <h2>Interests</h2> <ul> <li>Coding</li> <li>Design</li> <li>[Your Other Interest]</li> </ul> <h2>Contact</h2> <p>You can reach me via email at [your email address].</p> </body> </html> - Then "Save" the page and your refresh your website at https://yourusername.myweb.cs.uwindsor.ca
Congratulations! You created your first website :)
MyWeb Tutorials: Database Creation
This article provides step-by-step instructions for creating a database in MyWeb (DirectAdmin) and a table in phpMyAdmin.
- Login to MyWeb using your UWINID and password:
https://www.myweb.cs.uwindsor.ca - From “Account Manager” menu, click on “Databases”
- In the “Create Database” section, click on “Advanced mode”
Fill in:
a. Database Name (example: projectdb)
b. User name (can be the same as DB name)
c. Password (generate or enter your own)
- After creation, you will get a confirmation like the following (record these info)
- To access the Database, you can use phpMyAdmin, you can access it either from the same page where you created the Database (top right)
or you can access phpMyAdmin from the left menu:
In the phpMyAdmin page, click on your newly created Database
- You can create a table either using the “Create new table” wizard
Then define your fields/columns (as shown in the image below as an example)
Or you can create it using SQL command (the recommended method):
Please refer to the following sites for additional information about SQL:
· https://www.datacamp.com/tutorial/my-sql-tutorial
· https://www.w3schools.com/MySQL
· https://www.mysqltutorial.org
MyWeb Tutorials: Create PHP/DB application
This tutorial shows how to:
- Create a PHP file
- Connect to a database
- Display table contents
- Add Create, Read, Update, Delete (CRUD) functionality
Create a PHP File
- Log in to MyWeb (DirectAdmin)
- Open File Manager
- Go to:
- public_html
- Create a new file called:
- people.php
- Edit the file
Database Table Used
We assume the following table already exists: (refer to this tutorial in case you dont have this table)
Persons
--------------------------------
PersonID INT (Primary Key)
LastName VARCHAR(255)
FirstName VARCHAR(255)
Address VARCHAR(255)
City VARCHAR(255)
Database Connection
At the top of people.php, add:
<?php
$host = "localhost";
$db = "testproj1_myDB";
$user = "testproj1_myDB";
$pass = "myPassword";
$conn = new mysqli($host, $user, $pass, $db);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
?>
Replace the database credentials with your own.
Display Table Contents (READ)
Add this below the connection code:
<h2>People List</h2>
<table border="1" cellpadding="5">
<tr>
<th>ID</th>
<th>First Name</th>
<th>Last Name</th>
<th>Address</th>
<th>City</th>
<th>Actions</th>
</tr>
<?php
$result = $conn->query("SELECT * FROM Persons");
while ($row = $result->fetch_assoc()) {
echo "<tr>";
echo "<td>{$row['PersonID']}</td>";
echo "<td>{$row['FirstName']}</td>";
echo "<td>{$row['LastName']}</td>";
echo "<td>{$row['Address']}</td>";
echo "<td>{$row['City']}</td>";
echo "<td>
<form method='post' style='display:inline;'>
<input type='hidden' name='delete_id' value='{$row['PersonID']}'>
<input type='submit' value='Delete'
onclick=\"return confirm('Delete this record?');\">
</form>
</td>";
echo "</tr>";
}
?>
</table>
Add New Records (CREATE)
Add this above the table:
<form method="post">
<label>Person ID:</label><br>
<input type="number" name="personid" required><br><br>
<label>First Name:</label><br>
<input type="text" name="firstname" required><br><br>
<label>Last Name:</label><br>
<input type="text" name="lastname" required><br><br>
<label>Address:</label><br>
<input type="text" name="address"><br><br>
<label>City:</label><br>
<input type="text" name="city"><br><br>
<input type="submit" name="add" value="Add Person">
</form>
Then add this PHP logic near the top of the file:
if (isset($_POST['add'])) {
$stmt = $conn->prepare(
"INSERT INTO Persons (PersonID, FirstName, LastName, Address, City)
VALUES (?, ?, ?, ?, ?)"
);
$stmt->bind_param(
"issss",
$_POST['personid'],
$_POST['firstname'],
$_POST['lastname'],
$_POST['address'],
$_POST['city']
);
$stmt->execute();
$stmt->close();
header("Location: people.php");
exit;
}
Delete Records (DELETE)
Add this near the top:
if (isset($_POST['delete_id'])) {
$id = (int) $_POST['delete_id'];
$stmt = $conn->prepare("DELETE FROM Persons WHERE PersonID = ?");
$stmt->bind_param("i", $id);
$stmt->execute();
$stmt->close();
header("Location: people.php");
exit;
}
Now clicking Delete removes a record.
Full people.php file
<?php
/**
* Simple PHP CRUD Example
* Table: Persons
*
* Columns:
* - PersonID (INT, Primary Key, Auto Increment)
* - FirstName (VARCHAR)
* - LastName (VARCHAR)
* - Address (VARCHAR)
* - City (VARCHAR)
*/
/* ===============================
Database Configuration
=============================== */
$host = "localhost";
$db = "testproj1_myDB";
$user = "testproj1_myDB";
$pass = "myPassword";
/* ===============================
Database Connection
=============================== */
$conn = new mysqli($host, $user, $pass, $db);
if ($conn->connect_error) {
die("Database connection failed: " . $conn->connect_error);
}
/* ===============================
CREATE (Add New Record)
=============================== */
if (isset($_POST['add'])) {
$stmt = $conn->prepare(
"INSERT INTO Persons (PersonID, FirstName, LastName, Address, City)
VALUES (?, ?, ?, ?, ?)"
);
$stmt->bind_param(
"issss",
$_POST['personid'],
$_POST['firstname'],
$_POST['lastname'],
$_POST['address'],
$_POST['city']
);
$stmt->execute();
$stmt->close();
header("Location: people.php");
exit;
}
/* ===============================
DELETE (Remove Record)
=============================== */
if (isset($_POST['delete_id'])) {
$id = (int) $_POST['delete_id'];
$stmt = $conn->prepare("DELETE FROM Persons WHERE PersonID = ?");
$stmt->bind_param("i", $id);
$stmt->execute();
$stmt->close();
header("Location: people.php");
exit;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>People CRUD Example</title>
</head>
<body>
<h1>People Database</h1>
<!-- ===============================
CREATE FORM
=============================== -->
<h2>Add New Person</h2>
<form method="post">
<label>Person ID:</label><br>
<input type="number" name="personid" required><br><br>
<label>First Name:</label><br>
<input type="text" name="firstname" required><br><br>
<label>Last Name:</label><br>
<input type="text" name="lastname" required><br><br>
<label>Address:</label><br>
<input type="text" name="address"><br><br>
<label>City:</label><br>
<input type="text" name="city"><br><br>
<input type="submit" name="add" value="Add Person">
</form>
<hr>
<!-- ===============================
READ (Display Records)
=============================== -->
<h2>People List</h2>
<table border="1" cellpadding="6" cellspacing="0">
<tr>
<th>ID</th>
<th>First Name</th>
<th>Last Name</th>
<th>Address</th>
<th>City</th>
<th>Action</th>
</tr>
<?php
$result = $conn->query("SELECT * FROM Persons");
while ($row = $result->fetch_assoc()) {
echo "<tr>";
echo "<td>{$row['PersonID']}</td>";
echo "<td>{$row['FirstName']}</td>";
echo "<td>{$row['LastName']}</td>";
echo "<td>{$row['Address']}</td>";
echo "<td>{$row['City']}</td>";
echo "<td>
<form method='post' style='display:inline;'>
<input type='hidden' name='delete_id' value='{$row['PersonID']}'>
<input type='submit' value='Delete'
onclick=\"return confirm('Delete this record?');\">
</form>
</td>";
echo "</tr>";
}
?>
</table>
</body>
</html>
File Location Reminder
File must be in:
public_html/people.php
Access it via:
https://yourname.myweb.cs.uwindsor.ca/people.php
Errors and Logs
During building of your PHP application, you may need to view the errors either on the webpage or via the log.
To view errors on your PHP page, add the following at the top of your PHP file:
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
Put them before any other PHP code.
Once fixed, remove the debug lines.
Or you can access the log file from "Site Summary/Statistics/Logs"
Summary
- PHP files go in public_html
- Use PHP + MySQLi to access databases
- CRUD means:
- Create – Insert records
- Read – Display records
- Update – Modify records
- Delete – Remove records
MyWeb Tutorials: Git (Version Control)
Recommended Workflow (Read First)
If you are planning to use GIT, then you need to consider our GitLab server is the source of truth for your website code. You should write and edit your code locally on your own computer using any editor or IDE (such as VS Code). Your local project must be connected to gitlab.cs.uwindsor.ca, where you commit and push your changes. Once your code is pushed to GitLab, you then log in to MyWeb (DirectAdmin) and use Fetch followed by Deploy to publish the latest version of your code to the web server. Do not edit files directly in MyWeb using File Manager or FTP after Git is enabled, as those changes will be overwritten on the next deploy.
Summary of Workflow:
- Edit locally on your computer
- Commit & push to GitLab
- Fetch & Deploy to MyWeb
First-Time Setup (Do Once)
- Create an SSH key on the student’s local computer
- Add the local SSH key to GitLab (gitlab.cs.uwindsor.ca)
- Configure your IDE (e.g., VS Code) to use GitLab
- Create a new project on GitLab and copy the SSH remote URL
- Initialize the local project and connect it to the GitLab repository
- If code already exists on MyWeb, import it into the local project
- Commit and push the initial codebase to GitLab
- Create a separate SSH key in MyWeb (DirectAdmin) for deployment
- Add the MyWeb public SSH key to GitLab
- Initialize and connect the Git repository in MyWeb
- Perform the first Fetch and Deploy from GitLab to MyWeb
Daily / Ongoing Workflow
- Edit code locally on the student’s computer
- Commit and push changes to GitLab
- Log in to MyWeb (DirectAdmin)
- Fetch updates from GitLab
- Deploy the latest code to the website
1. Create an SSH key on the student’s local computer
- SSH keys are used to connect your computer to GitLab securely
- If you already have an SSH key, you may reuse it
- For simplicity and clarity, it is recommended to create a new SSH key specifically for GitLab
Windows (Windows Terminal / PowerShell / Git Bash)
- Open Windows Terminal, PowerShell, or Git Bash
- Generate a new SSH key:
ssh-keygen -t ed25519 -C "yourusername@gitlab.cs.uwindsor.ca"
- When prompted:
- File location: press Enter to accept default
(or use gitlab_cs if you want a dedicated key) - Passphrase: optional (press Enter to skip)
- Start the SSH agent:
eval "$(ssh-agent -s)"
- Add the key to the agent:
ssh-add ~/.ssh/id_ed25519
(or the filename you chose)
macOS / Linux
- Open Terminal
- Generate a new SSH key:
ssh-keygen -t ed25519 -C "yourusername@gitlab.cs.uwindsor.ca"
- When prompted:
- File location: press Enter to accept default
- Passphrase: optional (press Enter to skip)
- Start the SSH agent:
eval "$(ssh-agent -s)"
- Add the key to the agent:
ssh-add ~/.ssh/id_ed25519
Verify the Key Was Created (All Systems)
- List SSH keys:
ls ~/.ssh
- You should see:
- id_ed25519
- id_ed25519.pub
Notes for Students:
- .pub file = public key (safe to share)
- non-.pub file = private key (never share)
- Public key will be added to GitLab in the next step
- You do not need to repeat this step unless you change computers
2. Add the SSH Key to GitLab (gitlab.cs.uwindsor.ca)
- Open GitLab in your browser:
- https://gitlab.cs.uwindsor.ca
- Log in with your CS credentials
- Open User Preferences
- Go to SSH Keys
Copy Your Public Key (from your computer)
- Display the public key:
cat ~/.ssh/id_ed25519.pub
(If you used a different filename, replace id_ed25519 accordingly.)
- Select and copy the entire output (starts with ssh-ed25519)
Add the Key in GitLab
- Paste the key into the Key field
- (Optional) Set a descriptive Title (e.g., Laptop – CS GitLab)
- Click Add key
Quick Verification (Optional but Recommended)
- Test the SSH connection:
ssh -T git@gitlab.cs.uwindsor.ca
- You should see a success message indicating authentication worked
Notes for Students
- You can add multiple SSH keys to the same GitLab account (one per device)
- This key is for your local computer only
- Do not upload private keys (id_ed25519)—only the .pub file
3. Configure Your IDE (VS Code) to Use GitLab
- Install Visual Studio Code if it is not already installed
- Ensure Git is installed on your system and available in your terminal
- Open VS Code
Verify Git Is Detected by VS Code
- Open the integrated terminal in VS Code:
- View → Terminal
- Check Git availability:
git --version
- If Git is detected, VS Code will automatically enable source control features
Configure VS Code to Use Your SSH Key
- Ensure the SSH agent is running (from earlier step)
- Confirm your SSH key is loaded:
ssh-add -l
- You should see your id_ed25519 (or chosen key name)
VS Code uses the system SSH configuration automatically—no extra setup is required if SSH works in the terminal.
(Optional but Recommended) Configure Git Identity
- Set your name and email (used in commits):
git config --global user.name "Your Full Name"
git config --global user.email "yourusername@uwindsor.ca"
(Optional) Test GitLab Access from VS Code
- From the VS Code terminal, test SSH:
ssh -T git@gitlab.cs.uwindsor.ca
- A success message confirms VS Code can authenticate with GitLab
Notes for Students
- VS Code does not store your SSH key; it uses the system SSH agent
- If Git works in the terminal, it will work in VS Code
- You only need to do this setup once per computer
4. Create a Project on GitLab and Get the SSH Remote URL
- Open GitLab in your browser:
- https://gitlab.cs.uwindsor.ca
- Log in with your CS credentials
- Click New Project
- Choose Create blank project
Project Setup
- Enter a Project name (e.g., myweb-project)
- Leave Visibility as default (Private)
- Click Create project
Get the SSH Remote URL
- After the project is created, open the project page
- Click Code (or Clone)
- Select SSH
- Copy the SSH URL, which looks like:
git@gitlab.cs.uwindsor.ca:yourusername/myweb-project.git
Notes for Students
- Always use the SSH URL, not HTTPS
- This URL will be used to connect:
- Your local project
- Your MyWeb deployment
- You only create the GitLab project once
5. Initialize the Local Project and Push Code to GitLab
This step connects your local code to the GitLab repository you just created.
If You Are Starting with New Code (No Existing MyWeb Files)
- Open a terminal inside your project folder
- Initialize Git:
git init
- Add the GitLab remote (use the SSH URL you copied):
git remote add origin git@gitlab.cs.uwindsor.ca:yourusername/myweb-project.git
- Add all files:
git add .
- Commit the initial version:
git commit -m "Initial commit"
- Push to GitLab:
git branch -M main
git push -u origin main
If Code Already Exists on MyWeb (Common Case)
- First, make sure your local project folder contains the files from MyWeb (public_html)
- Download them from MyWeb (zip or File Manager)
- Or copy them manually
- Then, inside that folder:
git init
git remote add origin git@gitlab.cs.uwindsor.ca:yourusername/myweb-project.git
git add .
git commit -m "Initial import from MyWeb"
git branch -M main
git push -u origin main
✔ GitLab now contains the full website code
✔ GitLab becomes the source of truth
Notes for Students
- This initialization happens once
- After this step:
- Do not treat MyWeb as the main copy
- All future changes start locally
6. Create a Deployment SSH Key in MyWeb (DirectAdmin)
This key is used only by MyWeb to fetch and deploy code from GitLab.
It is separate from the SSH key on your local computer.
- Log in to MyWeb (DirectAdmin)
- Go to Advanced features → SSH Keys
- Click Create Key
Fill in the fields
- Key ID: gitlab (or any short name)
- Authorize: ✔ checked
- Comment: yourusername@gitlab.cs.uwindsor.ca
- Key Size: 2048
- Password: leave empty
- Click Create
Copy the Public Key
- After creation, copy the public key (the .pub content)
- You will add this key to GitLab in the next step
To copy the public key, right click on *.pub file and open/edit it and copy the full content (to be used in step 7 below)
Notes for Students
- This key stays on the server
- Do not download or reuse it on your computer
- One MyWeb key can be reused for multiple repositories
7. Add the MyWeb SSH Key to GitLab
- Open GitLab in your browser:
- https://gitlab.cs.uwindsor.ca
- Log in with your CS credentials
- Go to User Preferences
- Select SSH Keys
Add the MyWeb Public Key
- Paste the public SSH key you copied from MyWeb
- Set a clear Title (e.g., MyWeb Deployment Key)
- Click Add key
Notes for Students
- This key is server-side only (deployment)
- It is different from your local computer’s SSH key
- GitLab allows multiple SSH keys per account
8. Initialize and Connect the Repository in MyWeb (DirectAdmin)
This step links MyWeb to your GitLab repository so it can deploy your code.
- Log in to MyWeb (DirectAdmin)
- Go to Advanced Features -> Git
- Click Create Repository
Fill in the Repository Details
- Domain: select your MyWeb domain (auto-filled)
- Name: any label (e.g., myweb-site)
- Remote: paste the SSH URL of your GitLab repository
- git@gitlab.cs.uwindsor.ca:yourusername/myweb-project.git
- Keyfile: select or enter the path to the private key created in MyWeb
- .ssh/gitlab (the exact file name you have in .ssh folder)
- Click Create Repository
What This Does
- Creates a local Git repository on MyWeb
- Links it to GitLab using SSH
- Prepares MyWeb for deployment (no files are changed yet)
Notes for Students
- Always use the SSH remote, not HTTPS
- Do not include full /home/... paths in the Keyfile field
- This setup is done once per project
9. Fetch and Deploy the Code to MyWeb
This step publishes your GitLab code to your MyWeb website.
Fetch From GitLab
- In MyWeb (DirectAdmin), go to Git
- Locate your repository
- Click the three dots (⋯) next to it
- Click Fetch
What Fetch does:
- Connects to GitLab
- Retrieves the latest commits and branch information
- Does not change your website files
Deploy to MyWeb
- Click the three dots (⋯) again
- Click Deploy
What Deploy does:
- Checks out the latest commit (usually from main)
- Copies files into:
- public_html/
- Makes the code live on your website
Verify Deployment
- Open File Manager
- Confirm files appear in public_html
- Visit your website in a browser:
- https://yourproject.myweb.cs.uwindsor.ca/
Important Notes for Students
- Always Fetch before Deploy
- Do not edit files in File Manager or via FTP after Git is enabled
- Manual changes will be overwritten on the next deploy
✅ Setup Complete
You have now:
- Connected your local computer to GitLab
- Connected MyWeb to GitLab
- Deployed your site using Git
Daily Workflow Reminder
- Edit code locally
- Commit and push to GitLab
- Fetch and Deploy from MyWeb
MyWeb Tutorials: Connect to DB remotely
In addition to accessing your database through phpMyAdmin on MyWeb, you may also connect to your database directly from your own computer using tools such as HeidiSQL, MySQL Workbench, DBeaver, or the MySQL command-line client. Remote database access allows you to manage tables, run queries, and test your applications more easily while developing locally. In this guide, you will learn how to enable remote access to your database on MyWeb (DirectAdmin) and how to configure your database client to connect securely to the server.
- Login to https://myweb.cs.uwindsor.ca with your username and password
- From "Account Manager" -> Databases. Select or create the database you want to connect to:
-
Click on “Manage”
- Select the user you want to connect with, and click on “Manage”
-
Scroll down to “Allowed Hosts” and add % in the “Allow access from” and click on “Add Host”
Note: % means any host
-
That’s it.
-
Now you can test connecting to the database from your computer (after connecting to VPN).
Example:Host: myweb.cs.uwindsor.ca Port: 3306 Database: testproj1_myDB Username: testproj1_myDB Password: <DB password>
You can use any client to connect and manage the database from your computer. I recommend HeidiSQL https://www.heidisql.com/download.php