Dino Geek, try to help you

How to configure subdomains on a VPS server?


The process for configuring a subdomain on a VPS server can vary greatly depending on the type of server and control panel you are using. However, a general guide for Linux server using Apache (most common scenario) is as follows:

Here is a simplified step-by-step guide on how to do this:

1. Login to your VPS via SSH.

1. Navigate to Apache directory (like `/etc/apache2/sites-available/` by using the `cd` command).

1. Create a new configuration file for your subdomain by typing `sudo nano example_subdomain.conf` where “example\_subdomain” is the name of your subdomain.

1. Enter the following basic subdomain configuration, replacing “subdomain”, “domain_name”, and “directory_path” with your details:

```
ServerAdmin webmaster@localhost ServerName subdomain.domain_name.com DocumentRoot /var/www/html/directory_path ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined

```

1. Save and close the file by pressing Ctrl + O, then enter, and finally Ctrl + X.

1. Enable your new virtual host with the command `sudo a2ensite example_subdomain.conf`.

1. Restart your Apache2 server to make these changes take effect by typing `sudo service apache2 restart`.

Remember, this only works if your DNS provider is pointing to your VPS IP. If not, you need to create an A record that points your `subdomain.domain_name.com` to your VPS IP address.

Also, this setup may be different if you’re using different software or a managed control panel like cPanel or Plesk. In those cases, subdomains are usually set up within the control panel’s interface. Please refer to the documentation of your specific control panel.


Simply generate articles to optimize your SEO
Simply generate articles to optimize your SEO





DinoGeek offers simple articles on complex technologies

Would you like to be quoted in this article? It's very simple, contact us at dino@eiki.fr

CSS | NodeJS | DNS | DMARC | MAPI | NNTP | htaccess | PHP | HTTPS | Drupal | WEB3 | LLM | Wordpress | TLD | Domain name | IMAP | TCP | NFT | MariaDB | FTP | Zigbee | NMAP | SNMP | SEO | E-Mail | LXC | HTTP | MangoDB | SFTP | RAG | SSH | HTML | ChatGPT API | OSPF | JavaScript | Docker | OpenVZ | ChatGPT | VPS | ZIMBRA | SPF | UDP | Joomla | IPV6 | BGP | Django | Reactjs | DKIM | VMWare | RSYNC | Python | TFTP | Webdav | FAAS | Apache | IPV4 | LDAP | POP3 | SMTP

| Whispers of love (API) | Déclaration d'Amour |






Legal Notice / General Conditions of Use