WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How create the DNS zone file and how to properly add the vhost to apache server (4 posts)

  1. silis25
    Member
    Posted 1 year ago #

    Hi,

    I have domain name (letthemstare.com) which I want to transfer to my new vps host. In order to point my domain to my new vps, I need to do the following:

    1. Change Reverse DNS
    173.246.102.22 --> letthemstare.com

    2. Request my registrar to modify the name servers to my new host name servers

    3. Add a zone file. Previously I had WHM to manage the DNS zone but now I have no idea how to create and modify a DNS zone file (I have centos 6).

    4. Add a virtualhost to my apache2 web server.
    My current server configuration is as follows:

    NameVirtualHost 182.18.185.32:80
    NameVirtualHost *
    
    <VirtualHost 182.18.185.32:80>
        ServerName saver.securehostdns.com
        DocumentRoot /usr/local/apache/htdocs
        ServerAdmin serveradmin@znetlive.com
        <IfModule mod_suphp.c>
            suPHP_UserGroup nobody nobody
        </IfModule>
    </VirtualHost>
    
    # Default vhost for unbound IPs
    
    <VirtualHost *>
        ServerName saver.securehostdns.com
        DocumentRoot /usr/local/apache/htdocs
        ServerAdmin serveradmin@znetlive.com
        <IfModule mod_suphp.c>
            suPHP_UserGroup nobody nobody
        </IfModule>
    </VirtualHost>
    
    <VirtualHost 182.18.185.32:80>
        ServerName letthemstare.com
        ServerAlias www.letthemstare.com
        DocumentRoot /home/letthems/public_html
        ServerAdmin webmaster@letthemstare.com
        UseCanonicalName Off
        CustomLog /usr/local/apache/domlogs/letthemstare.com combined
        CustomLog /usr/local/apache/domlogs/letthemstare.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
        ## User letthems # Needed for Cpanel::ApacheConf
        <IfModule mod_suphp.c>
            suPHP_UserGroup letthems letthems
        </IfModule>
        <IfModule !mod_disable_suexec.c>
            <IfModule !mod_ruid2.c>
                SuexecUserGroup letthems letthems
            </IfModule>
        </IfModule>
        <IfModule mod_ruid2.c>
            RUidGid letthems letthems
        </IfModule>
        ScriptAlias /cgi-bin/ /home/letthems/public_html/cgi-bin/
    
        # To customize this VirtualHost use an include file at the following location
        # Include "/usr/local/apache/conf/userdata/std/2/letthems/letthemstare.com/*.conf"
    
    </VirtualHost>
    
    # SSL
    # CPANEL/WHM/WEBMAIL/WEBDISK PROXY SUBDOMAINS
    <VirtualHost 182.18.185.32:80 *>
        ServerName saver.securehostdns.com
        ServerAlias cpanel.* whm.* webmail.* webdisk.*
        DocumentRoot /usr/local/apache/htdocs
        ServerAdmin serveradmin@znetlive.com
        <IfModule mod_suphp.c>
            suPHP_UserGroup nobody nobody
        </IfModule>
        <IfModule mod_security2.c>
            SecRuleEngine Off
        </IfModule>
        RewriteEngine On
        <IfModule core.c>
            SSLProxyEngine On
        </IfModule>
        RewriteCond %{HTTP_HOST} ^cpanel\.
        RewriteCond %{HTTPS} on
        RewriteRule ^/(.*) https://127.0.0.1:2083/$1 [P]
        RewriteCond %{HTTP_HOST} ^webmail\.
        RewriteCond %{HTTPS} on
        RewriteRule ^/(.*) https://127.0.0.1:2096/$1 [P]
        RewriteCond %{HTTP_HOST} ^whm\.
        RewriteCond %{HTTPS} on
        RewriteRule ^/(.*) https://127.0.0.1:2087/$1 [P]
        RewriteCond %{HTTP_HOST} ^webdisk\.
        RewriteCond %{HTTPS} on
        RewriteRule ^/(.*) https://127.0.0.1:2078/$1 [P]
        RewriteCond %{HTTP_HOST} ^cpanel\.
        RewriteRule ^/(.*) http://127.0.0.1:2082/$1 [P]
        RewriteCond %{HTTP_HOST} ^webmail\.
        RewriteRule ^/(.*) http://127.0.0.1:2095/$1 [P]
        RewriteCond %{HTTP_HOST} ^whm\.
        RewriteRule ^/(.*) http://127.0.0.1:2086/$1 [P]
        RewriteCond %{HTTP_HOST} ^webdisk\.
        RewriteRule ^/(.*) http://127.0.0.1:2077/$1 [P]
        UseCanonicalName Off
    </VirtualHost>

    Required vhost modifications:

    A. 182.18.185.32 --> 173.246.102.22
    B. ServerName saver.securehostdns.com --> ServerName dns.gandi.net
    C. DocumentRoot /home/letthems/public_html --> DocumentRoot /var/www/html/wordpress

    DocumentRoot /usr/local/apache/htdocs --> DocumentRoot /etc/httpd/htdocs

    D. Delete ServerAdmin serveradmin@znetlive.com
    E. Delete SSL configuration (CPANEL/WHM/WEBMAIL/WEBDISK)

    I would appreciate if someone would guide me how create the DNS zone file and how to properly add the vhost to my new apache server.

    Thanks and regards,

    Kfir Silis

  2. David Choi
    Member
    Posted 1 year ago #

  3. silis25
    Member
    Posted 1 year ago #

    Great tutorials, I will have a look.
    Thank you for your help.

  4. David Choi
    Member
    Posted 1 year ago #

    You are welcome! Glad it helped you.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags