Change location of the main website

apitsos

Verified User
Joined
Dec 30, 2009
Messages
75
Location
Athens, Greece
Hi there!

I have a website hosted in DirectAdmin. It is about a static website, which has to be replaced by a new joomla site. I need to move the site in a specific directry (eg. "old") but also to be accessible with its URL (eg. www.mysite.com) and without index.html redirection, as I want all the Google indexed page to continue working properly. I need to that because I want to make the joomla installation in the root directory and start building the new site, without downtime of the old site.

I tried "Domain pointer" (with and without alias), "Site Redirection" and "Subdomain Management". Nothing worked like I wanted. I did make the opposite scenario working, which means that I could access the website located in the root through the URLs old.mysite.com and/or www.mysite.com/old, but this is not what I need. This will work fine for the new site, where I can build it in the root and make demo.mysite.com pointing the root (with a domain pointer as alias). But this is a step 2.

Thanks a lot in advance for your time and your views.

Best regards,
Angelos Pitsos
 
Well, you should edit the /usr/local/directadmin/data/users/USERNAME/httpd.conf to point the "www" to the subdirectory you want and once your webste is ready just restore the original one.

Keep in mind that the file is replaced by directadmin on subdomain add (for example) so maybe you should chattr +i that file till you end your new website.

Regards
 
Hello my friend!

Thank you very much for your suggestion. I tried already to make some modifications on this file, but with no luck. More specifically...

1. I changes the following line...
DocumentRoot /home/winners/domains/winners.gr/public_html
into...
DocumentRoot /home/winners/domains/winners.gr/public_html/old
...it didn't worked!

2. I changed the following line...
<Directory /home/winners/domains/winners.gr/public_html>
into...
<Directory /home/winners/domains/winners.gr/public_html/old>
...and it didn't worked, too.

Here is the whole file...
# Auto generated apache config file by DirectAdmin version 1.40.3
# Modifying this file is not recommended as any changes you make will be
# overwritten when the user makes any changes to his/her website

# For global config changes that affect all Users, see this guide:
# http://help.directadmin.com/item.php?id=2
# For local config changes that only affect one User, see this guide:
# http://help.directadmin.com/item.php?id=3

# Frontpage requires these parameters in every httpd.conf file or else
# it won't work.
ServerRoot /etc/httpd



<VirtualHost 93.174.121.132:80 >


ServerName www.winners.gr
ServerAlias www.winners.gr winners.gr
ServerAdmin [email protected]
DocumentRoot /home/winners/domains/winners.gr/public_html
ScriptAlias /cgi-bin/ /home/winners/domains/winners.gr/public_html/cgi-bin/

UseCanonicalName OFF

SuexecUserGroup winners winners
CustomLog /var/log/httpd/domains/winners.gr.bytes bytes
CustomLog /var/log/httpd/domains/winners.gr.log combined
ErrorLog /var/log/httpd/domains/winners.gr.error.log

<Directory /home/winners/domains/winners.gr/public_html>
Options +Includes -Indexes



suPHP_Engine ON
#suPHP_UserGroup winners winners

</Directory>



</VirtualHost>




<VirtualHost 93.174.121.132:443 >

SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key


ServerName www.winners.gr
ServerAlias www.winners.gr winners.gr
ServerAdmin [email protected]
DocumentRoot /home/winners/domains/winners.gr/private_html
ScriptAlias /cgi-bin/ /home/winners/domains/winners.gr/public_html/cgi-bin/

UseCanonicalName OFF

SuexecUserGroup winners winners
CustomLog /var/log/httpd/domains/winners.gr.bytes bytes
CustomLog /var/log/httpd/domains/winners.gr.log combined
ErrorLog /var/log/httpd/domains/winners.gr.error.log

<Directory /home/winners/domains/winners.gr/private_html>
Options +Includes -Indexes



suPHP_Engine ON
#suPHP_UserGroup winners winners

</Directory>



</VirtualHost>
<VirtualHost 93.174.121.132:80 >
ServerName demo.winners.gr
ServerAlias www.demo.winners.gr
Redirect 301 / http://www.winners.gr/

SuexecUserGroup winners winners

</VirtualHost>


Would you be so kind to help me and specify to me what is needed to be modified in order to make this work as described?

Thanks a lot in advance for your time.


Best regards,
Angelos Pitsos
 
Why it didnt worked? That should be the way, did you restarted apache after this edit? Have you checked apache logs? The old directory have right owner and permissions?

Regards
 
Hi my friend!

It was a stupidity from my part, not to restart apache! After restarting apache it worked perfect. But this is coming in conflict with the next step, where I need a name like demo.winners.gr as a domain pointer and it also redirected to the "old" directory.

Here is the relevant part of my httpd.conf after the modification:
<VirtualHost 93.174.121.132:80 >


ServerName www.winners.gr
ServerAlias www.winners.gr winners.gr demo.winners.gr www.demo.winners.gr
ServerAdmin [email protected]
DocumentRoot /home/winners/domains/winners.gr/public_html/old
ScriptAlias /cgi-bin/ /home/winners/domains/winners.gr/public_html/cgi-bin/

UseCanonicalName OFF

SuexecUserGroup winners winners
CustomLog /var/log/httpd/domains/winners.gr.bytes bytes
CustomLog /var/log/httpd/domains/winners.gr.log combined
ErrorLog /var/log/httpd/domains/winners.gr.error.log

<Directory /home/winners/domains/winners.gr/public_html>
Options +Includes -Indexes



suPHP_Engine ON
#suPHP_UserGroup winners winners

</Directory>



</VirtualHost>

I have marked the important part as Bold. You can understand that both the domain name and the alias are pointing the same directory now. It will be nice if we could now point the demo.winners.gr to the root directory! Do you have any suggestion of how to do that?

Thanks a lot!


Regards,
Angelos Pitsos
 
Ok, you need to first add demo as subdomain, directadmin will overwrite your httpd.conf and you will have two separated virtualhost, one for the www. and one for demo.

At that point, change the www to point to /old and demo to point to / (default will be /demo(.

Regards
 
Back
Top