Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

Create subdomain | Nginx | Fish Shell

set subdomain "apps.example.com"
# Create directory
sudo mkdir /var/www/$subdomain
# Create index.html
sudo vim /var/www/$subdomain/index.html

# 1. Copy the default config for the new subdomaine
sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/$subdomain
sudo ln -s /etc/nginx/sites-available/$subdomain /etc/nginx/sites-enabled/$subdomain
  
# 2. Open the config file
sudo echo "<h1>Subdomain Works!</h1>" > /etc/nginx/sites-available/$subdomain
  
# 3. Edit the file
# The content should look something like this
server {
        listen 80;
        listen [::]:80;
        root /var/www/apps;
        index index.html;
        server_name apps.example.com;
}
  
# 4. Restart NGINX
sudo service nginx restart

# Obtain an SSL Certificate
sudo certbot --nginx -d $subdomain
Comment

PREVIOUS NEXT
Code Example
Shell :: install dotnet 5 on pi os 
Shell :: piping results as argument linux 
Shell :: git delete branch error not found 
Shell :: Reset and sync local repository with remote branch 
Shell :: --force-confold 
Shell :: bitcoind-sv linux 
Shell :: react spring version 8 
Shell :: como hacer para loguearse en git en visual 
Shell :: win start posgres 
Shell :: is unix an open source operating system 
Shell :: Extract your external IP address using dig 
Shell :: imstall prettier 
Shell :: gem install puma 
Shell :: git checkout specific file types 
Shell :: how to clone git all repository git ubuntu 
Shell :: terminal command set audio volume 
Shell :: site:stackoverflow.com git clone specific folder 
Shell :: rsync exclude symlinks 
Shell :: curl-tomcat 
Shell :: how to make numbered directories in linux 
Shell :: eval assignment 
Shell :: Copying file permission of unixcop to monitor.txt 
Shell :: how to install startx 
Shell :: Let NetworkManager manage all devices on wsl 2 
Shell :: btrfs get disk utilization for subdirectory 
Shell :: docker gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation 
Shell :: install albert search ubuntu 
Shell :: deleting compizconfig 
Shell :: find powershell profiles linux 
Shell :: change directory in linux 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =