workstation ⚙️ Ubuntu Linux OS - martindubenet/wed-dev-design GitHub Wiki
- Check your Ubuntu version
lsb_release -a
- Change Directory to
- User root
cd ~/
-
Downloads
cd ~/Downloads
- Projects
cd ~/Projects/1idweb/martindube.net/doc/cv
- User root
For more command lines: code • Terminal command lines (CLI)
In command lines starting with sudo apt
, apt
is the package manager for Ubunto OS while curl
allowes allows you to download data from the web.
Required development dependencies:
-
curl via apt :
sudo apt install curl -y
-
NVM via curl :
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
-
NodeJS and npm via NVM :
nvm install --lts
Make
--lts
your default node version:nvm use --lts
nvm alias default lts
We have two common server; Either the classic Apache or Nginx. The later is more performant allowing to handle many concurrent connections.
Start | End |
---|---|
Terminal systemctl status apache2
|
Ctrl+C |
- Open Terminal
Ctrl+Alt+T
- Update Package List
sudo apt update
- Install Apache
sudo apt install apache2
- Adjust Firewall (if UFW is active)
- Check the status of UFW
sudo ufw status
- If it is active you'll need to allow HTTP traffic. Copy/Paste this command line in Terminal
sudo ufw allow 'Apache'
- Check the status of UFW
- Verify Apache Status
sudo systemctl status apache2
- Test Your Local Server in your browser
- You should see the Apache Ubuntu Default Page, which confirms that your local server is running.
The default web root directory for Apache on Ubuntu is /var/www/html
. This is where you'll place your website files.
- Change Directory to your local root
cd /var/www/html
When working in /var/www/html
, you may encounter permission issues. It's common to change the ownership of this directory to your user to avoid using sudo
for every file operation. For example, to change ownership to your user (replace your_username with your actual username in the following command line):
sudo chown -R your_username:your_username /var/www/html
Nginx (pronounced "engine-x") is a high-performance web server that's often preferred for its efficiency and ability to handle many concurrent connections.
sudo apt install php libapache2-mod-php php-cli php-mysql php-mbstring php-xml php-gd php-curl
Typical PHP extensions for development included in the above command line:
-
php
: The core PHP interpreter. libapache2-mod-php: The Apache module for PHP. -
php-cli
: PHP Command Line Interface, useful for running PHP scripts from the terminal. -
php-mysql
: Enables PHP to connect to MySQL/MariaDB databases (essential for many web applications). -
php-mbstring
: Provides multi-byte string functions (often required by frameworks). -
php-xml
: Enables XML parsing capabilities. -
php-gd
: For image manipulation (e.g., generating thumbnails). -
php-curl
: For making HTTP requests from PHP.
The libapache2-mod-php
package usually enables the PHP module automatically. However, if for some reason it's not, you can manually enable it and the dir module (which helps Apache serve index.php
files correctly) :
sudo a2enmod php
sudo a2enmod dir
yarn create vite MyPage --template vue
cd MyPage
yarn
- Run local server:
yarn dev
rm -rf node_modules yarn.lock
yarn cache clean
yarn install