Follow the steps given below to add a domain without a control panel on the server.

First, add the user on server.

useradd hostdens

Then go to the home folder and search the user.

cd /home/

ls -ld hostdens

Then go to the user by giving the below command.

cd hostdens

Create the public_html folder under that user.

mkdir public_html

Provide proper ownership and permission to public_html folder.

chown hostdens. public_html

chmod 750 public_html

Now, add manual entries of virtual host at the end of httpd.conf. Before that take the copy of httpd.conf

cd /etc/httpd/conf/

cp httpd.conf httpd.conf-bak

vi /etc/httpd.conf

ex
—————————-
<VirtualHost 192.99.205.115:80>
ServerAdmin webmaster@hostdens.com
DocumentRoot /home/hostdens/public_html
ServerName hostdens.com
ErrorLog logs/hostdens.com-error_log
CustomLog logs/hostdens.com-access_log common
</VirtualHost>

change the document root path, server name, error logs and custom logs
save the files and restart the apache. First, check the apache syntax is correct.

httpd -t

/etc/init.d/httpd restart

Then create the DNS entry of the domain

Go to named path

cd /var/named/

Copy the entry of another domain

cp hostdens1.com.db hostdens.com.db-bak

mv hostdens.com.db-bak hostdens.com.db

Open that file now.

vi hostdens.com.db

Accept name server replace the domain name with your main domain name.

$TTL 14400
hostdens.com. 86400 IN SOA ns1.hostdens.com. support.hostdens.com. (
2010020703 ;Serial Number
86400 ;refresh
7200 ;retry
3600000 ;expire
86400 ;minimum
)
hostdens.com. 86400 IN NS ns1.hostdens.com.
hostdens.com. 86400 IN NS ns2.hostdens.com.
hostdens.com. 14400 IN A 192.99.205.115
hostdens.com. 14400 IN MX 0 hostdens.com.
mail 14400 IN CNAME hostdens.com.
www 14400 IN CNAME hostdens.com.
ftp 14400 IN A 192.99.205.115

save and quit the file.

Open named.conf file and the entery of that domain, First create the backup file of named.conf

cd /etc/

cp named.con named.conf-bak

vi /etc/named.conf

Copy the entry of another domain and replace the other domain with your domain name.

zone “hostdens.com” {
type master;
notify no;
file “hostdens.com.db”;

};

Once done then restart the named service.

/etc/init.d/named restart

Restart the ftp service to connect to the server via FTP now.


Vishwajit Kale

Vishwajit Kale blazed onto the digital marketing scene back in 2015 and is the digital marketing strategist of Hostdens, a company that aims to provide reliable web hosting solutions. Vishwajit is experienced in digital and content marketing along with SEO. He's fond of writing technology blogs, traveling and reading.